diff options
author | NeilBrown <neilb@suse.de> | 2012-08-18 07:58:33 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-05-24 16:44:16 +1000 |
commit | 3cdcc5985a51cc017d2017231c4044d6da4ee2e8 (patch) | |
tree | 84c9e2eb0a19712539229a01a1699ea488b21716 /mm/filemap.c | |
parent | 284e75259b30f0bc9e965750ebb5c61f671d2c60 (diff) | |
download | kernel_goldelico_gta04-3cdcc5985a51cc017d2017231c4044d6da4ee2e8.zip kernel_goldelico_gta04-3cdcc5985a51cc017d2017231c4044d6da4ee2e8.tar.gz kernel_goldelico_gta04-3cdcc5985a51cc017d2017231c4044d6da4ee2e8.tar.bz2 |
GTA04: add simple headset-jack detection support.
As headset-insert doesn't generate an interrupt we need to
poll the MICSENSE line to see if a headset is present.
We do this every 500ms. It takes nearly that long to physically
insert a jack, so much faster wouldn't help and would impact
power drain more.
As detection is done by polling, a jack-insert or removal event cannot
wake the device from suspend. Events are only detected while device
is awake.
We keep the HSMIC bias enabled whenever the 'input' device is open,
except during suspend so that we can poll reliably. Turning it off
and on seems to interfere with reliable measurements.
Currently a reading below 100 is 'nothing plugged in' while a reading
above that is 'mic and headphone plugged in'.
I measure between 19 and 26 when nothing is plugged in, and between
804 and 811 when a headset is plugged in.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mm/filemap.c')
0 files changed, 0 insertions, 0 deletions