Commit 2a172d2f authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASoC: Intel: sof_nau8825: remap jack pins

The card did not map jack pins to controls, which prevents
PulseAudio/PipeWire from dealing with jack detection. It's likely that
jack detection was only tested with the CRAS server and extensions of
UCM.
Suggested-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220616214055.134943-13-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2913bb1f
...@@ -81,6 +81,17 @@ static int sof_hdmi_init(struct snd_soc_pcm_runtime *rtd) ...@@ -81,6 +81,17 @@ static int sof_hdmi_init(struct snd_soc_pcm_runtime *rtd)
return 0; return 0;
} }
static struct snd_soc_jack_pin jack_pins[] = {
{
.pin = "Headphone Jack",
.mask = SND_JACK_HEADPHONE,
},
{
.pin = "Headset Mic",
.mask = SND_JACK_MICROPHONE,
},
};
static int sof_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd) static int sof_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card);
...@@ -93,11 +104,13 @@ static int sof_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -93,11 +104,13 @@ static int sof_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
* Headset buttons map to the google Reference headset. * Headset buttons map to the google Reference headset.
* These can be configured by userspace. * These can be configured by userspace.
*/ */
ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack",
SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_HEADSET | SND_JACK_BTN_0 |
SND_JACK_BTN_1 | SND_JACK_BTN_2 | SND_JACK_BTN_1 | SND_JACK_BTN_2 |
SND_JACK_BTN_3, SND_JACK_BTN_3,
&ctx->sof_headset); &ctx->sof_headset,
jack_pins,
ARRAY_SIZE(jack_pins));
if (ret) { if (ret) {
dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment