ASoC: qcom: common: add kcontrol to jack pins

Add Kcontrol to jack pins so that device switch in ucm can be done correctly.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230302104616.26318-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Srinivas Kandagatla 2023-03-02 10:46:16 +00:00 committed by Mark Brown
parent 5ddcf9768f
commit 4c2c935a27
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 15 additions and 2 deletions

View File

@ -180,6 +180,18 @@ err_put_np:
}
EXPORT_SYMBOL_GPL(qcom_snd_parse_of);
static struct snd_soc_jack_pin qcom_headset_jack_pins[] = {
/* Headset */
{
.pin = "Mic Jack",
.mask = SND_JACK_MICROPHONE,
},
{
.pin = "Headphone Jack",
.mask = SND_JACK_HEADPHONE,
},
};
int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
struct snd_soc_jack *jack, bool *jack_setup)
{
@ -189,13 +201,14 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
int rval, i;
if (!*jack_setup) {
rval = snd_soc_card_jack_new(card, "Headset Jack",
rval = snd_soc_card_jack_new_pins(card, "Headset Jack",
SND_JACK_HEADSET | SND_JACK_LINEOUT |
SND_JACK_MECHANICAL |
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
SND_JACK_BTN_2 | SND_JACK_BTN_3 |
SND_JACK_BTN_4 | SND_JACK_BTN_5,
jack);
jack, qcom_headset_jack_pins,
ARRAY_SIZE(qcom_headset_jack_pins));
if (rval < 0) {
dev_err(card->dev, "Unable to add Headphone Jack\n");