Skip to content

Commit 82f76ac

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
ASoC: qcom: common: add default jack dapm pins
If the soundcard does not specify the dapm pins, let the common code add these pins for jack. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/Message-Id: <20230302120327.10823-1-srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 012fa26 commit 82f76ac

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

sound/soc/qcom/common.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
#include "qdsp6/q6afe.h"
99
#include "common.h"
1010

11+
static const struct snd_soc_dapm_widget qcom_jack_snd_widgets[] = {
12+
SND_SOC_DAPM_HP("Headphone Jack", NULL),
13+
SND_SOC_DAPM_MIC("Mic Jack", NULL),
14+
};
15+
1116
int qcom_snd_parse_of(struct snd_soc_card *card)
1217
{
1318
struct device_node *np;
@@ -153,6 +158,11 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
153158
of_node_put(platform);
154159
}
155160

161+
if (!card->dapm_widgets) {
162+
card->dapm_widgets = qcom_jack_snd_widgets;
163+
card->num_dapm_widgets = ARRAY_SIZE(qcom_jack_snd_widgets);
164+
}
165+
156166
return 0;
157167
err:
158168
of_node_put(cpu);

0 commit comments

Comments
 (0)