Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: <shumingf@realtek.com>
To: <broonie@kernel.org>, <lgirdwood@gmail.com>
Cc: oder_chiou@realtek.com, jack.yu@realtek.com,
	alsa-devel@alsa-project.org, lars@metafoo.de,
	Shuming Fan <shumingf@realtek.com>,
	jairaj.arava@intel.com, derek.fang@realtek.com,
	bard.liao@intel.com, sathya.prakash.m.r@intel.com,
	flove@realtek.com
Subject: [PATCH 1/2] ASoC: rt711: remap buttons
Date: Thu, 17 Jun 2021 17:08:09 +0800	[thread overview]
Message-ID: <20210617090809.16901-1-shumingf@realtek.com> (raw)

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


             reply	other threads:[~2021-06-17  9:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  9:08 shumingf [this message]
2021-06-17 12:39 ` [PATCH 1/2] ASoC: rt711: remap buttons 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210617090809.16901-1-shumingf@realtek.com \
    --to=shumingf@realtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=jairaj.arava@intel.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=sathya.prakash.m.r@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox