mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
ASoC: rockchip: rockchip_rt5645: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio and PipeWire need to handle jack detection events. The RT5645 codec used here supports detecting Headphone and Headset Mic connections. Expose both to userspace as kcontrols. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Link: https://lore.kernel.org/r/20230802175737.263412-25-alpernebiyasak@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
d60e810a0f
commit
24127e5a07
1 changed files with 17 additions and 5 deletions
|
@ -22,6 +22,16 @@
|
|||
#define DRV_NAME "rockchip-snd-rt5645"
|
||||
|
||||
static struct snd_soc_jack headset_jack;
|
||||
static struct snd_soc_jack_pin headset_jack_pins[] = {
|
||||
{
|
||||
.pin = "Headphones",
|
||||
.mask = SND_JACK_HEADPHONE,
|
||||
},
|
||||
{
|
||||
.pin = "Headset Mic",
|
||||
.mask = SND_JACK_MICROPHONE,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget rk_dapm_widgets[] = {
|
||||
SND_SOC_DAPM_HP("Headphones", NULL),
|
||||
|
@ -103,11 +113,13 @@ static int rk_init(struct snd_soc_pcm_runtime *runtime)
|
|||
int ret;
|
||||
|
||||
/* Enable Headset and 4 Buttons Jack detection */
|
||||
ret = snd_soc_card_jack_new(card, "Headset Jack",
|
||||
SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&headset_jack);
|
||||
ret = snd_soc_card_jack_new_pins(card, "Headset Jack",
|
||||
SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&headset_jack,
|
||||
headset_jack_pins,
|
||||
ARRAY_SIZE(headset_jack_pins));
|
||||
if (ret) {
|
||||
dev_err(card->dev, "New Headset Jack failed! (%d)\n", ret);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue