summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2023-03-02 15:03:27 +0300
committerMark Brown <broonie@kernel.org>2023-06-22 20:02:07 +0300
commit82f76ac26c601c5b0c0db7f69500efc42f2ee7ed (patch)
tree9a6e88cda0d8f39d3d6bd0f26ce6520c4ba4de32 /sound/soc
parent012fa2622e30675f61413485785e708ba02be78b (diff)
downloadlinux-82f76ac26c601c5b0c0db7f69500efc42f2ee7ed.tar.xz
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>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/qcom/common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index 43b0a888f1e8..e2d8c41945fa 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -8,6 +8,11 @@
#include "qdsp6/q6afe.h"
#include "common.h"
+static const struct snd_soc_dapm_widget qcom_jack_snd_widgets[] = {
+ SND_SOC_DAPM_HP("Headphone Jack", NULL),
+ SND_SOC_DAPM_MIC("Mic Jack", NULL),
+};
+
int qcom_snd_parse_of(struct snd_soc_card *card)
{
struct device_node *np;
@@ -153,6 +158,11 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
of_node_put(platform);
}
+ if (!card->dapm_widgets) {
+ card->dapm_widgets = qcom_jack_snd_widgets;
+ card->num_dapm_widgets = ARRAY_SIZE(qcom_jack_snd_widgets);
+ }
+
return 0;
err:
of_node_put(cpu);