ASoC: ts3a227e: Remap keys to match Android headset specification
PATCH 1/1 ASoC: ts3a227e: Remap keys to match Android headset specification
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
--- sound/soc/codecs/ts3a227e.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/ts3a227e.c +3 -3
@@ -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);
Signature · 1 line
2.2.0.rc0.207.ga3a616c
Quoted 12 lines · Anatol Pomozov
ts3a227e datasheet says typical key resistance is
key1 50 Om
key2 135 Om
key3 240 Om
key4 470 OmThe 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
Quoted 7 lines
Thus key mapping should be
key1 - MEDIA
key2 - VOICECOMMAND
key3 - VOLUMEUP
key3 - VOLUMEDOWNSigned-off-by Anatol Pomozov <[email protected]>
Quoted 9 lines
--- sound/soc/codecs/ts3a227e.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)sound/soc/codecs/ts3a227e.c +0
-0
sound/soc/codecs/ts3a227e.c int ts3a227e_enable_jack_detect(struct snd_soc_component *component, · line 226
Quoted 9 lines
sound/soc/codecs/ts3a227e.c +3
-3@@ -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 );
These are correct. The initial mapping was based on a mislabeled, pre-production eval board. The new mapping was tested with the reference headsets.
Quoted 6 lines
sound/soc/codecs/ts3a227e.c +0
-1ts3a227e->jack = jack;ts3a227e_jack_report (ts3a227e); --2.2.0.rc0.207.ga3a616c
Hi
Quoted 3 lines · Anatol Pomozov
ts3a227e datasheet says typical key resistance is
key1 50 Om
It is a misspelling in the commit message. "Om" should be replaced with "Ohm" here and below.
Mark are you ok to fix it in your repo or do you want me to resend the updated patch?
Quoted 44 lines
key2 135 Om
key3 240 Om
key4 470 OmThe 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 OmThus key mapping should be
key1 - MEDIA
key2 - VOICECOMMAND
key3 - VOLUMEUP
key3 - VOLUMEDOWNSigned-off-by Anatol Pomozov <[email protected]>--- sound/soc/codecs/ts3a227e.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)sound/soc/codecs/ts3a227e.c +3
-3@@ -221,9 +221,9 @@ int ts3a227e_enable_jack_detect(structsnd_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
Quoted 1 line · Anatol Pomozov
ts3a227e datasheet says typical key resistance is
Applied, thanks.