aboutsummaryrefslogtreecommitdiffstats
path: root/GTA04
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-08-18 07:58:33 +1000
committerH. Nikolaus Schaller <hns@goldelico.com>2013-07-22 17:35:28 +0200
commit3bc3e92b3cec1cb3e1faad02f552111e110c1b4b (patch)
treefcae02af51147ff986a35194536e4fb267535b31 /GTA04
parentf0defa60f8b54ef3864867e1a76c64651dd7276c (diff)
downloadkernel_goldelico_gta04-3bc3e92b3cec1cb3e1faad02f552111e110c1b4b.zip
kernel_goldelico_gta04-3bc3e92b3cec1cb3e1faad02f552111e110c1b4b.tar.gz
kernel_goldelico_gta04-3bc3e92b3cec1cb3e1faad02f552111e110c1b4b.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. Input device will appear as /dev/input/jack if the udev rules file in GTA04/udev-rules/input.rules is installed. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'GTA04')
-rw-r--r--GTA04/udev-rules/input.rules2
1 files changed, 1 insertions, 1 deletions
diff --git a/GTA04/udev-rules/input.rules b/GTA04/udev-rules/input.rules
index 2cc8df9..a96feb8 100644
--- a/GTA04/udev-rules/input.rules
+++ b/GTA04/udev-rules/input.rules
@@ -4,4 +4,4 @@ SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,3,*a0,1,
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k74,*", SYMLINK+="input/power"
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*kA9,*", SYMLINK+="input/aux"
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*kF0,*", SYMLINK+="input/incoming"
-SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,5,*w[24678D]*", SYMLINK+="input/jack"
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,5,*w[24678D]*", SYMLINK+="input/jack"