All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: rt711: remap buttons
@ 2021-06-17  9:08 shumingf
  2021-06-17 12:39 ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: shumingf @ 2021-06-17  9:08 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, Shuming Fan, jairaj.arava,
	derek.fang, bard.liao, sathya.prakash.m.r, flove

From: Shuming Fan <shumingf@realtek.com>

This patch uses the same mapping as the machine driver:
BTN_0 : KEY_PLAYPAUSE
BTN_1 : KEY_VOICECOMMAND
BTN_2 : KEY_VOLUMEUP
BTN_3 : KEY_VOLUMEDOWN

Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/soc/codecs/rt711.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c
index 9f5b2dc16c54..c3a82b462a93 100644
--- a/sound/soc/codecs/rt711.c
+++ b/sound/soc/codecs/rt711.c
@@ -154,26 +154,26 @@ static unsigned int rt711_button_detect(struct rt711_priv *rt711)
 	case 0x0200:
 	case 0x0100:
 	case 0x0080:
-		btn_type |= SND_JACK_BTN_0;
+		btn_type |= SND_JACK_BTN_2;
 		break;
 	case 0x0001:
-		btn_type |= SND_JACK_BTN_3;
+		btn_type |= SND_JACK_BTN_1;
 		break;
 	}
 	switch (val81) {
 	case 0x8000:
 	case 0x4000:
 	case 0x2000:
-		btn_type |= SND_JACK_BTN_1;
+		btn_type |= SND_JACK_BTN_0;
 		break;
 	case 0x1000:
 	case 0x0800:
 	case 0x0400:
-		btn_type |= SND_JACK_BTN_2;
+		btn_type |= SND_JACK_BTN_3;
 		break;
 	case 0x0200:
 	case 0x0100:
-		btn_type |= SND_JACK_BTN_3;
+		btn_type |= SND_JACK_BTN_1;
 		break;
 	}
 read_error:
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-06-30 13:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  9:08 [PATCH 1/2] ASoC: rt711: remap buttons shumingf
2021-06-17 12:39 ` Mark Brown
     [not found]   ` <d6374c5158c844d69b4f546fd741f07f@realtek.com>
2021-06-17 13:27     ` Mark Brown
2021-06-17 14:23       ` Pierre-Louis Bossart
2021-06-24 18:06         ` Curtis Malainey
2021-06-25 18:31           ` Curtis Malainey
2021-06-30  6:01             ` Shuming [范書銘]
2021-06-30 13:07               ` Mark Brown
2021-06-25  0:56         ` Lu, Brent

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.