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 16:46:48 +0200
commitb5cbb6b873d899c67769deca6ceecb34a29f272d (patch)
tree067e66f6f5e9beff217ccefebd2d7442979b9522 /GTA04
parent0735f4d7918284acb167be22d829e75827702355 (diff)
downloadkernel_goldelico_gta04-b5cbb6b873d899c67769deca6ceecb34a29f272d.zip
kernel_goldelico_gta04-b5cbb6b873d899c67769deca6ceecb34a29f272d.tar.gz
kernel_goldelico_gta04-b5cbb6b873d899c67769deca6ceecb34a29f272d.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"