Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Srinivas Kandagatla and committed by
Mark Brown
82f76ac2 012fa262

+10
+10
sound/soc/qcom/common.c
··· 8 8 #include "qdsp6/q6afe.h" 9 9 #include "common.h" 10 10 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 + 11 16 int qcom_snd_parse_of(struct snd_soc_card *card) 12 17 { 13 18 struct device_node *np; ··· 156 151 of_node_put(cpu); 157 152 of_node_put(codec); 158 153 of_node_put(platform); 154 + } 155 + 156 + if (!card->dapm_widgets) { 157 + card->dapm_widgets = qcom_jack_snd_widgets; 158 + card->num_dapm_widgets = ARRAY_SIZE(qcom_jack_snd_widgets); 159 159 } 160 160 161 161 return 0;