From: Alifer Moraes <alifer.m@variscite.com>
To: linux-kernel@vger.kernel.org
Cc: pierluigi.p@variscite.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, nicoleotsuka@gmail.com,
Xiubo.Lee@gmail.com, linuxppc-dev@lists.ozlabs.org,
shengjiu.wang@gmail.com, tiwai@suse.com, lgirdwood@gmail.com,
robh+dt@kernel.org, eran.m@variscite.com, broonie@kernel.org,
patches@opensource.cirrus.com, festevam@gmail.com
Subject: [PATCH 4/4] ASoC: wm8904: add DMIC support
Date: Mon, 7 Mar 2022 11:10:41 -0300 [thread overview]
Message-ID: <20220307141041.27538-4-alifer.m@variscite.com> (raw)
In-Reply-To: <20220307141041.27538-1-alifer.m@variscite.com>
From: Pierluigi Passaro <pierluigi.p@variscite.com>
The WM8904 codec supports both ADC and DMIC inputs.
Add dedicated controls to support the additional routing.
Signed-off-by: Pierluigi Passaro <pierluigi.p@variscite.com>
Signed-off by: Alifer Moraes <alifer.m@variscite.com>
---
sound/soc/codecs/wm8904.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 4121771db104..c7987dc81e4d 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -837,6 +837,26 @@ static int out_pga_event(struct snd_soc_dapm_widget *w,
return 0;
}
+static const char *dmic_text[] = {
+ "DMIC1", "DMIC2"
+};
+
+static SOC_ENUM_SINGLE_DECL(dmic_enum,
+ WM8904_DIGITAL_MICROPHONE_0, 11, dmic_text);
+
+static const struct snd_kcontrol_new dmic_mux =
+ SOC_DAPM_ENUM("DMIC Mux", dmic_enum);
+
+static const char *cin_text[] = {
+ "ADC", "DMIC"
+};
+
+static SOC_ENUM_SINGLE_DECL(cin_enum,
+ WM8904_DIGITAL_MICROPHONE_0, 12, cin_text);
+
+static const struct snd_kcontrol_new cin_mux =
+ SOC_DAPM_ENUM("Capture Input", cin_enum);
+
static const char *input_mode_text[] = {
"Single-Ended", "Differential Line", "Differential Mic"
};
@@ -930,6 +950,10 @@ SND_SOC_DAPM_INPUT("IN2R"),
SND_SOC_DAPM_INPUT("IN3L"),
SND_SOC_DAPM_INPUT("IN3R"),
+SND_SOC_DAPM_MUX("DMIC Mux", SND_SOC_NOPM, 0, 0, &dmic_mux),
+SND_SOC_DAPM_MUX("Left Capture Input", SND_SOC_NOPM, 0, 0, &cin_mux),
+SND_SOC_DAPM_MUX("Right Capture Input", SND_SOC_NOPM, 0, 0, &cin_mux),
+
SND_SOC_DAPM_SUPPLY("MICBIAS", WM8904_MIC_BIAS_CONTROL_0, 0, 0, NULL, 0),
SND_SOC_DAPM_MUX("Left Capture Mux", SND_SOC_NOPM, 0, 0, &lin_mux),
@@ -1093,11 +1117,21 @@ static const struct snd_soc_dapm_route adc_intercon[] = {
{ "AIFOUTL", NULL, "AIFOUTL Mux" },
{ "AIFOUTR", NULL, "AIFOUTR Mux" },
+ { "DMIC Mux", "DMIC1", "IN1L" },
+ { "DMIC Mux", "DMIC2", "IN1R" },
+
+ { "Left Capture Input", "ADC", "Left Capture PGA" },
+ { "Left Capture Input", "DMIC", "DMIC Mux" },
+ { "Right Capture Input", "ADC", "Right Capture PGA" },
+ { "Right Capture Input", "DMIC", "DMIC Mux" },
+
{ "ADCL", NULL, "CLK_DSP" },
{ "ADCL", NULL, "Left Capture PGA" },
+ { "ADCL", NULL, "Left Capture Input" },
{ "ADCR", NULL, "CLK_DSP" },
{ "ADCR", NULL, "Right Capture PGA" },
+ { "ADCR", NULL, "Right Capture Input" },
};
static const struct snd_soc_dapm_route dac_intercon[] = {
--
2.25.1
next prev parent reply other threads:[~2022-03-08 15:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 14:10 [PATCH 1/4] ASoC: fsl-asoc-card: add WM8904 support Alifer Moraes
2022-03-07 14:10 ` [PATCH 2/4] ASoC: bindings: fsl-asoc-card: Add compatible string for wm8904 Alifer Moraes
2022-03-07 14:10 ` [PATCH 3/4] ASoC: wm8904: extend device tree support Alifer Moraes
2022-03-07 16:16 ` Mark Brown
2022-03-10 20:51 ` Rob Herring
2022-06-20 14:39 ` Pierluigi Passaro
2022-03-07 14:10 ` Alifer Moraes [this message]
2022-03-07 16:25 ` [PATCH 4/4] ASoC: wm8904: add DMIC support Mark Brown
2022-06-20 19:53 ` Pierluigi Passaro
2022-06-21 13:11 ` Mark Brown
2022-03-11 17:16 ` [PATCH 1/4] ASoC: fsl-asoc-card: add WM8904 support Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2022-06-20 14:49 [PATCH 4/4] ASoC: wm8904: add DMIC support Pierluigi Passaro
2022-06-20 14:56 ` Mark Brown
2022-06-20 15:03 Pierluigi Passaro
2022-06-20 15:09 ` Mark Brown
2022-06-20 15:30 Pierluigi Passaro
2022-06-20 17:38 ` Mark Brown
2022-06-20 17:52 Pierluigi Passaro
2022-06-20 18:04 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220307141041.27538-4-alifer.m@variscite.com \
--to=alifer.m@variscite.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eran.m@variscite.com \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=patches@opensource.cirrus.com \
--cc=pierluigi.p@variscite.com \
--cc=robh+dt@kernel.org \
--cc=shengjiu.wang@gmail.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox