[alsa-devel] [PATCH] ASoC: ts3a227e: Remap keys to match Android headset specification

Anatol Pomozov anatol.pomozov at gmail.com
Fri Jan 23 00:47:16 CET 2015


ts3a227e datasheet says typical key resistance is
  key1 50 Om
  key2 135 Om
  key3 240 Om
  key4 470 Om

The android headset specification expect buttons impedance:
  A (MEDIA) 0-70 Om
  D (VOICECOMMAND) 110-180 Om
  B (VOLUMEUP) 210-290 Om
  C (VOLUMEDOWN) 360-680 Om

Thus key mapping should be
  key1 - MEDIA
  key2 - VOICECOMMAND
  key3 - VOLUMEUP
  key3 - VOLUMEDOWN

Signed-off-by: Anatol Pomozov <anatol.pomozov at gmail.com>
---
 sound/soc/codecs/ts3a227e.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 9f2dced..54d431c 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -221,9 +221,9 @@ int ts3a227e_enable_jack_detect(struct snd_soc_component *component,
 	struct ts3a227e *ts3a227e = snd_soc_component_get_drvdata(component);
 
 	snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_MEDIA);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
 
 	ts3a227e->jack = jack;
 	ts3a227e_jack_report(ts3a227e);
-- 
2.2.0.rc0.207.ga3a616c



More information about the Alsa-devel mailing list