ASoC: amd: acp3x-5682: Remove SND_JACK_LINEOUT
Subsystems (3)
PATCH 1/2 ASoC: amd: acp3x-5682: Remove SND_JACK_LINEOUT
RT5682 only has a headset jack.
--- sound/soc/amd/acp3x-rt5682-max9836.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp3x-rt5682-max9836.c +1 -1
@@ -87,7 +87,7 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd) rt5682_dai_bclk =clk_get (component->dev,"rt5682-dai-bclk" ); ret =snd_soc_card_jack_new (card,"Headset Jack" , -SND_JACK_HEADSET |SND_JACK_LINEOUT | +SND_JACK_HEADSET |SND_JACK_BTN_0 |SND_JACK_BTN_1 |SND_JACK_BTN_2 |SND_JACK_BTN_3 , &pco_jack);
Signature · 1 line
2.37.3
PATCH 2/2 ASoC: amd: acp3x-5682: Expose individual headset jack pins
The rt5682 codec is able to distinguish between two event types:
headphone insertion/removal and headset microphone insertion/removal. However, currently, the acp3x-5682 driver exposes a single kcontrol for the headset jack, so userspace isn't able to differentiate between the two events.
Add a definition for the headset jack pins, so that a separate jack kcontrol is created for each one, allowing userspace to track and handle them individually.
This change is based on commit 194ff8db0378 ("ASoC: mediatek:
mt8192-mt6359: Expose individual headset jack pins").
--- sound/soc/amd/acp3x-rt5682-max9836.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
sound/soc/amd/acp3x-rt5682-max9836.c +14 -2
@@ -39,6 +39,17 @@ enum { EC, }; +static struct snd_soc_jack_pin acp3x_5682_jack_pins[] = { + { + .pin ="Headphone Jack" , + .mask =SND_JACK_HEADPHONE , + }, + { + .pin ="Headset Mic" , + .mask =SND_JACK_MICROPHONE , + }, +}; +static int acp3x_5682_init (struct snd_soc_pcm_runtime *rtd) {int ret;
@@ -86,11 +97,12 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd) rt5682_dai_wclk =clk_get (component->dev,"rt5682-dai-wclk" ); rt5682_dai_bclk =clk_get (component->dev,"rt5682-dai-bclk" ); - ret =snd_soc_card_jack_new (card,"Headset Jack" , + ret =snd_soc_card_jack_new_pins (card,"Headset Jack" ,SND_JACK_HEADSET |SND_JACK_BTN_0 |SND_JACK_BTN_1 |SND_JACK_BTN_2 |SND_JACK_BTN_3 , - &pco_jack); + &pco_jack, acp3x_5682_jack_pins, +ARRAY_SIZE (acp3x_5682_jack_pins));if (ret) {dev_err (card->dev,"HP jack creation failed %d\n" , ret);return ret;
Signature · 1 line
2.37.3
Mark Brown
maintainersound/soc/amd/acp3x-rt5682-max9836.c static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd) · line 90
Quoted 5 lines · Akihiko Odaki
RT5682 only has a headset jack.
sound/soc/amd/acp3x-rt5682-max9836.c +1
-1ret = snd_soc_card_jack_new(card, "Headset Jack", - SND_JACK_HEADSET | SND_JACK_LINEOUT | + SND_JACK_HEADSET |
Will the device by any chance happily drive this as a line output (possibly even detect if it's a headphone or a line output device attached)? The CODEC hardware is often interchangable.