mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-21 06:50:25 +00:00
ASoC: Intel: sof_da7219_max98373: 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: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220616214055.134943-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7459c8940a
commit
2913bb1f68
1 changed files with 18 additions and 5 deletions
|
@ -135,6 +135,17 @@ static const struct snd_soc_dapm_route max98360a_map[] = {
|
||||||
{"DMic", NULL, "SoC DMIC"},
|
{"DMic", NULL, "SoC DMIC"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct snd_soc_jack_pin jack_pins[] = {
|
||||||
|
{
|
||||||
|
.pin = "Headphone Jack",
|
||||||
|
.mask = SND_JACK_HEADPHONE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.pin = "Headset Mic",
|
||||||
|
.mask = SND_JACK_MICROPHONE,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
static struct snd_soc_jack headset;
|
static struct snd_soc_jack headset;
|
||||||
|
|
||||||
static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
|
static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
|
||||||
|
@ -156,11 +167,13 @@ static int da7219_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_LINEOUT,
|
SND_JACK_BTN_3 | SND_JACK_LINEOUT,
|
||||||
&headset);
|
&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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue