All of lore.kernel.org
 help / color / mirror / Atom feed
From: Curtis Malainey <cujomalainey@google.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: "Oder Chiou" <oder_chiou@realtek.com>,
	"Jack Yu" <jack.yu@realtek.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"Jimmy Cheng-Yi Chiang" <cychiang@google.com>,
	"Curtis Malainey" <cujomalainey@chromium.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"sathya.prakash.m.r@intel.com" <sathya.prakash.m.r@intel.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Derek [方德義]" <derek.fang@realtek.com>,
	"Flove(HsinFu)" <flove@realtek.com>,
	"Shuming [范書銘]" <shumingf@realtek.com>,
	"jairaj.arava@intel.com" <jairaj.arava@intel.com>,
	"Lu, Brent" <brent.lu@intel.com>,
	"bard.liao@intel.com" <bard.liao@intel.com>
Subject: Re: [PATCH 1/2] ASoC: rt711: remap buttons
Date: Thu, 24 Jun 2021 11:06:22 -0700	[thread overview]
Message-ID: <CAOReqxhDT8Z6jC89=m_Hka4diaxJqwhyKZmrVAw626wAAL72Fw@mail.gmail.com> (raw)
In-Reply-To: <638be5ea-a310-3711-df08-798f7bee5804@linux.intel.com>

On Thu, Jun 17, 2021 at 7:23 AM Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com> wrote:
>
>
>
> On 6/17/21 8:27 AM, Mark Brown wrote:
> > On Thu, Jun 17, 2021 at 01:19:05PM +0000, Shuming [范書銘] wrote:
> >
> >>>> 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
> >
> >>> Which machine driver?  Can't there be multiple machine drivers, and if
> >>> they're already overriding things why do this?
> >
> >> The rt711 codec is designed in the Intel platform only for now.
> >
> > I'm sure your sales team would be happy to change that!
> >
> >> The machine driver is 'sof_sdw.c' that resides under sound/soc/intel/boards.
> >> It seems Intel uses the same mapping in all other Intel machine drivers.
> >> Please check the commit as below.
> >> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=1f64a08bd5a9a218deb37c03c1e98e9567379698
> >
> > Sure, but if the machine drivers for these platforms already do the
> > right thing why change the CODEC driver?
> >
> >> Hi Sathya,
> >> Do you know why the m/c driver uses this mapping?
> >
> > I'd guess it's just because that's the standard set of headphone buttons
> > that Intel uses for their platforms.
>
> Intel has no specific requirement, we just follow what the Google 4-button description says [1]
>
> That said, I can't recall why half of the machine drivers follow one pattern and the other half a different one.
>
> Same as spec:
> sof_da7219_max98373.c:  snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
> sof_da7219_max98373.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
> sof_da7219_max98373.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
> sof_da7219_max98373.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
>
> sof_cs42l42.c:  snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
> sof_cs42l42.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
> sof_cs42l42.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
> sof_cs42l42.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
>
> swap wrt. spec:
> sof_sdw_rt711.c:        snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
> sof_sdw_rt711.c-        snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
> sof_sdw_rt711.c-        snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
> sof_sdw_rt711.c-        snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
>
> kbl_rt5663_max98927.c:  snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
> kbl_rt5663_max98927.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
> kbl_rt5663_max98927.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
> kbl_rt5663_max98927.c-  snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
>
> Brent, Curtis, Jimmy, can you comment on the order?

Sorry for the late reply, I couldn't figure out why this slipped by my
email filter, I guess I should look closer next time. Soraka has been
checked (kbl_rt5663_max98927) and yes the mapping does appear to be
incorrect, volume up key returns voice command in evtest. Sathya will
have to check the headset button mapping, on rt711 but my guess is it
is also incorrect.

>
>
> [1] https://source.android.com/devices/accessories/headset/plug-headset-spec#control-function_mapping
>
>
>
>
>

  reply	other threads:[~2021-06-24 18:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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='CAOReqxhDT8Z6jC89=m_Hka4diaxJqwhyKZmrVAw626wAAL72Fw@mail.gmail.com' \
    --to=cujomalainey@google.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=brent.lu@intel.com \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@chromium.org \
    --cc=cychiang@google.com \
    --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=pierre-louis.bossart@linux.intel.com \
    --cc=sathya.prakash.m.r@intel.com \
    --cc=shumingf@realtek.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 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.