All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Implement DMIC support in WM8903
@ 2023-03-25  8:36 Svyatoslav Ryhel
  2023-03-25  8:36 ` [PATCH v1 1/1] ASoC: wm8903: implement DMIC support Svyatoslav Ryhel
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-25  8:36 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Svyatoslav Ryhel, Maxim Schwalm, Dmitry Osipenko
  Cc: patches, alsa-devel, linux-kernel

According to comments in wm8903, driver lacks DMIC support.
My wm8903 based devices (ASUS TF300T and TF101) require DMIC
support for correct internal mic work. I have used downstream
sources to implement DMIC input support for this driver and
I can confirm that internal mic now works as intended.

Svyatoslav Ryhel (1):
  ASoC: wm8903: implement DMIC support

 sound/soc/codecs/wm8903.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.37.2


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
  2023-03-25  8:36 [PATCH v1 0/1] Implement DMIC support in WM8903 Svyatoslav Ryhel
@ 2023-03-25  8:36 ` Svyatoslav Ryhel
  2023-03-27  8:32   ` Charles Keepax via Alsa-devel
  2023-03-27  8:32   ` Charles Keepax
  2023-03-27  8:33 ` [PATCH v1 0/1] Implement DMIC support in WM8903 Charles Keepax
  2023-03-27  8:33 ` Charles Keepax via Alsa-devel
  2 siblings, 2 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-25  8:36 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Svyatoslav Ryhel, Maxim Schwalm, Dmitry Osipenko
  Cc: patches, alsa-devel, linux-kernel

Add DMIC input and routing.

Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 sound/soc/codecs/wm8903.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 41346e5ec5ad..9c2f0aadcff3 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -9,7 +9,6 @@
  *
  * TODO:
  *  - TDM mode configuration.
- *  - Digital microphone support.
  */
 
 #include <linux/module.h>
@@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
 SND_SOC_DAPM_INPUT("IN2R"),
 SND_SOC_DAPM_INPUT("IN3L"),
 SND_SOC_DAPM_INPUT("IN3R"),
+SND_SOC_DAPM_INPUT("DMIC"),
 SND_SOC_DAPM_INPUT("DMICDAT"),
 
 SND_SOC_DAPM_OUTPUT("HPOUTL"),
@@ -996,6 +996,9 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = {
 	{ "AIFTXL", NULL, "Left Capture Mux" },
 	{ "AIFTXR", NULL, "Right Capture Mux" },
 
+	{ "ADCL", NULL, "DMIC" },
+	{ "ADCR", NULL, "DMIC" },
+
 	{ "ADCL", NULL, "Left ADC Input" },
 	{ "ADCL", NULL, "CLK_DSP" },
 	{ "ADCR", NULL, "Right ADC Input" },
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
  2023-03-25  8:36 ` [PATCH v1 1/1] ASoC: wm8903: implement DMIC support Svyatoslav Ryhel
@ 2023-03-27  8:32   ` Charles Keepax via Alsa-devel
  2023-03-27  8:32   ` Charles Keepax
  1 sibling, 0 replies; 16+ messages in thread
From: Charles Keepax via Alsa-devel @ 2023-03-27  8:32 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Takashi Iwai, Maxim Schwalm,
	Dmitry Osipenko, patches, alsa-devel, linux-kernel


[-- Attachment #0: Type: message/rfc822, Size: 6240 bytes --]

From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.com>, Maxim Schwalm <maxim.schwalm@gmail.com>, Dmitry Osipenko <digetx@gmail.com>, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
Date: Mon, 27 Mar 2023 08:32:08 +0000
Message-ID: <20230327083208.GQ68926@ediswmail.ad.cirrus.com>

On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> Add DMIC input and routing.
> 
> Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>  sound/soc/codecs/wm8903.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> index 41346e5ec5ad..9c2f0aadcff3 100644
> --- a/sound/soc/codecs/wm8903.c
> +++ b/sound/soc/codecs/wm8903.c
> @@ -9,7 +9,6 @@
>   *
>   * TODO:
>   *  - TDM mode configuration.
> - *  - Digital microphone support.
>   */
>  
>  #include <linux/module.h>
> @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
>  SND_SOC_DAPM_INPUT("IN2R"),
>  SND_SOC_DAPM_INPUT("IN3L"),
>  SND_SOC_DAPM_INPUT("IN3R"),
> +SND_SOC_DAPM_INPUT("DMIC"),
>  SND_SOC_DAPM_INPUT("DMICDAT"),

There is already a datapath for the DMIC here, DMICDAT. Are you
sure you don't just need to set the "Left/Right ADC Input" muxes
correctly through the ALSA controls?

>  
>  SND_SOC_DAPM_OUTPUT("HPOUTL"),
> @@ -996,6 +996,9 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = {
>  	{ "AIFTXL", NULL, "Left Capture Mux" },
>  	{ "AIFTXR", NULL, "Right Capture Mux" },
>  
> +	{ "ADCL", NULL, "DMIC" },
> +	{ "ADCR", NULL, "DMIC" },
> +

And at any rate these should not be directly connected to the
ADC you need some muxing to indicate whether the DMIC or AMICs
are active. Which the DMICDAT path appears to already have.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
  2023-03-25  8:36 ` [PATCH v1 1/1] ASoC: wm8903: implement DMIC support Svyatoslav Ryhel
  2023-03-27  8:32   ` Charles Keepax via Alsa-devel
@ 2023-03-27  8:32   ` Charles Keepax
  2023-03-27  8:37       ` Svyatoslav Ryhel
  1 sibling, 1 reply; 16+ messages in thread
From: Charles Keepax @ 2023-03-27  8:32 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Maxim Schwalm, Dmitry Osipenko, patches, alsa-devel,
	linux-kernel

On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> Add DMIC input and routing.
> 
> Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>  sound/soc/codecs/wm8903.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> index 41346e5ec5ad..9c2f0aadcff3 100644
> --- a/sound/soc/codecs/wm8903.c
> +++ b/sound/soc/codecs/wm8903.c
> @@ -9,7 +9,6 @@
>   *
>   * TODO:
>   *  - TDM mode configuration.
> - *  - Digital microphone support.
>   */
>  
>  #include <linux/module.h>
> @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
>  SND_SOC_DAPM_INPUT("IN2R"),
>  SND_SOC_DAPM_INPUT("IN3L"),
>  SND_SOC_DAPM_INPUT("IN3R"),
> +SND_SOC_DAPM_INPUT("DMIC"),
>  SND_SOC_DAPM_INPUT("DMICDAT"),

There is already a datapath for the DMIC here, DMICDAT. Are you
sure you don't just need to set the "Left/Right ADC Input" muxes
correctly through the ALSA controls?

>  
>  SND_SOC_DAPM_OUTPUT("HPOUTL"),
> @@ -996,6 +996,9 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = {
>  	{ "AIFTXL", NULL, "Left Capture Mux" },
>  	{ "AIFTXR", NULL, "Right Capture Mux" },
>  
> +	{ "ADCL", NULL, "DMIC" },
> +	{ "ADCR", NULL, "DMIC" },
> +

And at any rate these should not be directly connected to the
ADC you need some muxing to indicate whether the DMIC or AMICs
are active. Which the DMICDAT path appears to already have.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 0/1] Implement DMIC support in WM8903
  2023-03-25  8:36 [PATCH v1 0/1] Implement DMIC support in WM8903 Svyatoslav Ryhel
  2023-03-25  8:36 ` [PATCH v1 1/1] ASoC: wm8903: implement DMIC support Svyatoslav Ryhel
  2023-03-27  8:33 ` [PATCH v1 0/1] Implement DMIC support in WM8903 Charles Keepax
@ 2023-03-27  8:33 ` Charles Keepax via Alsa-devel
  2 siblings, 0 replies; 16+ messages in thread
From: Charles Keepax via Alsa-devel @ 2023-03-27  8:33 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Takashi Iwai, Maxim Schwalm,
	Dmitry Osipenko, patches, alsa-devel, linux-kernel


[-- Attachment #0: Type: message/rfc822, Size: 4903 bytes --]

From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.com>, Maxim Schwalm <maxim.schwalm@gmail.com>, Dmitry Osipenko <digetx@gmail.com>, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 0/1] Implement DMIC support in WM8903
Date: Mon, 27 Mar 2023 08:33:16 +0000
Message-ID: <20230327083316.GR68926@ediswmail.ad.cirrus.com>

On Sat, Mar 25, 2023 at 10:36:42AM +0200, Svyatoslav Ryhel wrote:
> According to comments in wm8903, driver lacks DMIC support.

Which comments? I am having some difficulty finding these?

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 0/1] Implement DMIC support in WM8903
  2023-03-25  8:36 [PATCH v1 0/1] Implement DMIC support in WM8903 Svyatoslav Ryhel
  2023-03-25  8:36 ` [PATCH v1 1/1] ASoC: wm8903: implement DMIC support Svyatoslav Ryhel
@ 2023-03-27  8:33 ` Charles Keepax
  2023-03-27  8:38     ` Svyatoslav Ryhel
  2023-03-27  8:33 ` Charles Keepax via Alsa-devel
  2 siblings, 1 reply; 16+ messages in thread
From: Charles Keepax @ 2023-03-27  8:33 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Maxim Schwalm, Dmitry Osipenko, patches, alsa-devel,
	linux-kernel

On Sat, Mar 25, 2023 at 10:36:42AM +0200, Svyatoslav Ryhel wrote:
> According to comments in wm8903, driver lacks DMIC support.

Which comments? I am having some difficulty finding these?

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
  2023-03-27  8:32   ` Charles Keepax
@ 2023-03-27  8:37       ` Svyatoslav Ryhel
  0 siblings, 0 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27  8:37 UTC (permalink / raw)
  To: Charles Keepax
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Maxim Schwalm, Dmitry Osipenko, patches, alsa-devel,
	linux-kernel

пн, 27 бер. 2023 р. о 11:32 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
>
> On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> > Add DMIC input and routing.
> >
> > Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > ---
> >  sound/soc/codecs/wm8903.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> > index 41346e5ec5ad..9c2f0aadcff3 100644
> > --- a/sound/soc/codecs/wm8903.c
> > +++ b/sound/soc/codecs/wm8903.c
> > @@ -9,7 +9,6 @@
> >   *
> >   * TODO:
> >   *  - TDM mode configuration.
> > - *  - Digital microphone support.
> >   */
> >
> >  #include <linux/module.h>
> > @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
> >  SND_SOC_DAPM_INPUT("IN2R"),
> >  SND_SOC_DAPM_INPUT("IN3L"),
> >  SND_SOC_DAPM_INPUT("IN3R"),
> > +SND_SOC_DAPM_INPUT("DMIC"),
> >  SND_SOC_DAPM_INPUT("DMICDAT"),
>
> There is already a datapath for the DMIC here, DMICDAT. Are you
> sure you don't just need to set the "Left/Right ADC Input" muxes
> correctly through the ALSA controls?
>

I will check once more, but so far I was not able to set the mic to
work with DMICDAT. Only with this patch.

Best regards,
Svyatoslav R.

> >
> >  SND_SOC_DAPM_OUTPUT("HPOUTL"),
> > @@ -996,6 +996,9 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = {
> >       { "AIFTXL", NULL, "Left Capture Mux" },
> >       { "AIFTXR", NULL, "Right Capture Mux" },
> >
> > +     { "ADCL", NULL, "DMIC" },
> > +     { "ADCR", NULL, "DMIC" },
> > +
>
> And at any rate these should not be directly connected to the
> ADC you need some muxing to indicate whether the DMIC or AMICs
> are active. Which the DMICDAT path appears to already have.
>
> Thanks,
> Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
@ 2023-03-27  8:37       ` Svyatoslav Ryhel
  0 siblings, 0 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27  8:37 UTC (permalink / raw)
  To: Charles Keepax
  Cc: Liam Girdwood, Mark Brown, Takashi Iwai, Maxim Schwalm,
	Dmitry Osipenko, patches, alsa-devel, linux-kernel

пн, 27 бер. 2023 р. о 11:32 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
>
> On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> > Add DMIC input and routing.
> >
> > Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > ---
> >  sound/soc/codecs/wm8903.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> > index 41346e5ec5ad..9c2f0aadcff3 100644
> > --- a/sound/soc/codecs/wm8903.c
> > +++ b/sound/soc/codecs/wm8903.c
> > @@ -9,7 +9,6 @@
> >   *
> >   * TODO:
> >   *  - TDM mode configuration.
> > - *  - Digital microphone support.
> >   */
> >
> >  #include <linux/module.h>
> > @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
> >  SND_SOC_DAPM_INPUT("IN2R"),
> >  SND_SOC_DAPM_INPUT("IN3L"),
> >  SND_SOC_DAPM_INPUT("IN3R"),
> > +SND_SOC_DAPM_INPUT("DMIC"),
> >  SND_SOC_DAPM_INPUT("DMICDAT"),
>
> There is already a datapath for the DMIC here, DMICDAT. Are you
> sure you don't just need to set the "Left/Right ADC Input" muxes
> correctly through the ALSA controls?
>

I will check once more, but so far I was not able to set the mic to
work with DMICDAT. Only with this patch.

Best regards,
Svyatoslav R.

> >
> >  SND_SOC_DAPM_OUTPUT("HPOUTL"),
> > @@ -996,6 +996,9 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = {
> >       { "AIFTXL", NULL, "Left Capture Mux" },
> >       { "AIFTXR", NULL, "Right Capture Mux" },
> >
> > +     { "ADCL", NULL, "DMIC" },
> > +     { "ADCR", NULL, "DMIC" },
> > +
>
> And at any rate these should not be directly connected to the
> ADC you need some muxing to indicate whether the DMIC or AMICs
> are active. Which the DMICDAT path appears to already have.
>
> Thanks,
> Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 0/1] Implement DMIC support in WM8903
  2023-03-27  8:33 ` [PATCH v1 0/1] Implement DMIC support in WM8903 Charles Keepax
@ 2023-03-27  8:38     ` Svyatoslav Ryhel
  0 siblings, 0 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27  8:38 UTC (permalink / raw)
  To: Charles Keepax
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Maxim Schwalm, Dmitry Osipenko, patches, alsa-devel,
	linux-kernel

пн, 27 бер. 2023 р. о 11:33 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
>
> On Sat, Mar 25, 2023 at 10:36:42AM +0200, Svyatoslav Ryhel wrote:
> > According to comments in wm8903, driver lacks DMIC support.
>
> Which comments? I am having some difficulty finding these?
>

Lines 10-12

* TODO:
* - TDM mode configuration.
* - Digital microphone support.

> Thanks,
> Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 0/1] Implement DMIC support in WM8903
@ 2023-03-27  8:38     ` Svyatoslav Ryhel
  0 siblings, 0 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27  8:38 UTC (permalink / raw)
  To: Charles Keepax
  Cc: Liam Girdwood, Mark Brown, Takashi Iwai, Maxim Schwalm,
	Dmitry Osipenko, patches, alsa-devel, linux-kernel

пн, 27 бер. 2023 р. о 11:33 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
>
> On Sat, Mar 25, 2023 at 10:36:42AM +0200, Svyatoslav Ryhel wrote:
> > According to comments in wm8903, driver lacks DMIC support.
>
> Which comments? I am having some difficulty finding these?
>

Lines 10-12

* TODO:
* - TDM mode configuration.
* - Digital microphone support.

> Thanks,
> Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 0/1] Implement DMIC support in WM8903
  2023-03-27  8:38     ` Svyatoslav Ryhel
  (?)
  (?)
@ 2023-03-27 10:03     ` Charles Keepax
  -1 siblings, 0 replies; 16+ messages in thread
From: Charles Keepax @ 2023-03-27 10:03 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Maxim Schwalm, Dmitry Osipenko, patches, alsa-devel,
	linux-kernel

On Mon, Mar 27, 2023 at 11:38:10AM +0300, Svyatoslav Ryhel wrote:
> пн, 27 бер. 2023 р. о 11:33 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
> >
> > On Sat, Mar 25, 2023 at 10:36:42AM +0200, Svyatoslav Ryhel wrote:
> > > According to comments in wm8903, driver lacks DMIC support.
> >
> > Which comments? I am having some difficulty finding these?
> >
> 
> Lines 10-12
> 
> * TODO:
> * - TDM mode configuration.
> * - Digital microphone support.
> 

Oops... thanks, I think that comment should have been removed
in this patch:

commit 97945c46a23d ("ASoC: WM8903: Implement DMIC support")

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 0/1] Implement DMIC support in WM8903
  2023-03-27  8:38     ` Svyatoslav Ryhel
  (?)
@ 2023-03-27 10:03     ` Charles Keepax via Alsa-devel
  -1 siblings, 0 replies; 16+ messages in thread
From: Charles Keepax via Alsa-devel @ 2023-03-27 10:03 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Takashi Iwai, Maxim Schwalm,
	Dmitry Osipenko, patches, alsa-devel, linux-kernel


[-- Attachment #0: Type: message/rfc822, Size: 5531 bytes --]

From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.com>, Maxim Schwalm <maxim.schwalm@gmail.com>, Dmitry Osipenko <digetx@gmail.com>, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 0/1] Implement DMIC support in WM8903
Date: Mon, 27 Mar 2023 10:03:30 +0000
Message-ID: <20230327100330.GS68926@ediswmail.ad.cirrus.com>

On Mon, Mar 27, 2023 at 11:38:10AM +0300, Svyatoslav Ryhel wrote:
> пн, 27 бер. 2023 р. о 11:33 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
> >
> > On Sat, Mar 25, 2023 at 10:36:42AM +0200, Svyatoslav Ryhel wrote:
> > > According to comments in wm8903, driver lacks DMIC support.
> >
> > Which comments? I am having some difficulty finding these?
> >
> 
> Lines 10-12
> 
> * TODO:
> * - TDM mode configuration.
> * - Digital microphone support.
> 

Oops... thanks, I think that comment should have been removed
in this patch:

commit 97945c46a23d ("ASoC: WM8903: Implement DMIC support")

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
  2023-03-27  8:37       ` Svyatoslav Ryhel
  (?)
@ 2023-03-27 10:14       ` Charles Keepax
  2023-03-27 14:48           ` Svyatoslav Ryhel
  -1 siblings, 1 reply; 16+ messages in thread
From: Charles Keepax @ 2023-03-27 10:14 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Maxim Schwalm, Dmitry Osipenko, patches, alsa-devel,
	linux-kernel

On Mon, Mar 27, 2023 at 11:37:05AM +0300, Svyatoslav Ryhel wrote:
> пн, 27 бер. 2023 р. о 11:32 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
> >
> > On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> > > Add DMIC input and routing.
> > >
> > > Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > > ---
> > >  sound/soc/codecs/wm8903.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> > > index 41346e5ec5ad..9c2f0aadcff3 100644
> > > --- a/sound/soc/codecs/wm8903.c
> > > +++ b/sound/soc/codecs/wm8903.c
> > > @@ -9,7 +9,6 @@
> > >   *
> > >   * TODO:
> > >   *  - TDM mode configuration.
> > > - *  - Digital microphone support.
> > >   */
> > >
> > >  #include <linux/module.h>
> > > @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
> > >  SND_SOC_DAPM_INPUT("IN2R"),
> > >  SND_SOC_DAPM_INPUT("IN3L"),
> > >  SND_SOC_DAPM_INPUT("IN3R"),
> > > +SND_SOC_DAPM_INPUT("DMIC"),
> > >  SND_SOC_DAPM_INPUT("DMICDAT"),
> >
> > There is already a datapath for the DMIC here, DMICDAT. Are you
> > sure you don't just need to set the "Left/Right ADC Input" muxes
> > correctly through the ALSA controls?
> >
> 
> I will check once more, but so far I was not able to set the mic to
> work with DMICDAT. Only with this patch.
> 

The two should be basically equivalent when the controls are set
right, your patch has:

DMIC -> ADCL

The current code has

DMIC -> Left ADC Input -> ADCL

The only difference is that Left ADC Input sets the ADC_DIG_MIC
bit, but the datasheet clearly indicates that should be
necessary for digital mics to work. Does your system definitely
have DMICs? Without that bit set the decimator should still be
connected to the analogue front end.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
  2023-03-27  8:37       ` Svyatoslav Ryhel
  (?)
  (?)
@ 2023-03-27 10:14       ` Charles Keepax via Alsa-devel
  -1 siblings, 0 replies; 16+ messages in thread
From: Charles Keepax via Alsa-devel @ 2023-03-27 10:14 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Liam Girdwood, Mark Brown, Takashi Iwai, Maxim Schwalm,
	Dmitry Osipenko, patches, alsa-devel, linux-kernel


[-- Attachment #0: Type: message/rfc822, Size: 6829 bytes --]

From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.com>, Maxim Schwalm <maxim.schwalm@gmail.com>, Dmitry Osipenko <digetx@gmail.com>, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
Date: Mon, 27 Mar 2023 10:14:29 +0000
Message-ID: <20230327101429.GT68926@ediswmail.ad.cirrus.com>

On Mon, Mar 27, 2023 at 11:37:05AM +0300, Svyatoslav Ryhel wrote:
> пн, 27 бер. 2023 р. о 11:32 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
> >
> > On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> > > Add DMIC input and routing.
> > >
> > > Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > > ---
> > >  sound/soc/codecs/wm8903.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> > > index 41346e5ec5ad..9c2f0aadcff3 100644
> > > --- a/sound/soc/codecs/wm8903.c
> > > +++ b/sound/soc/codecs/wm8903.c
> > > @@ -9,7 +9,6 @@
> > >   *
> > >   * TODO:
> > >   *  - TDM mode configuration.
> > > - *  - Digital microphone support.
> > >   */
> > >
> > >  #include <linux/module.h>
> > > @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
> > >  SND_SOC_DAPM_INPUT("IN2R"),
> > >  SND_SOC_DAPM_INPUT("IN3L"),
> > >  SND_SOC_DAPM_INPUT("IN3R"),
> > > +SND_SOC_DAPM_INPUT("DMIC"),
> > >  SND_SOC_DAPM_INPUT("DMICDAT"),
> >
> > There is already a datapath for the DMIC here, DMICDAT. Are you
> > sure you don't just need to set the "Left/Right ADC Input" muxes
> > correctly through the ALSA controls?
> >
> 
> I will check once more, but so far I was not able to set the mic to
> work with DMICDAT. Only with this patch.
> 

The two should be basically equivalent when the controls are set
right, your patch has:

DMIC -> ADCL

The current code has

DMIC -> Left ADC Input -> ADCL

The only difference is that Left ADC Input sets the ADC_DIG_MIC
bit, but the datasheet clearly indicates that should be
necessary for digital mics to work. Does your system definitely
have DMICs? Without that bit set the decimator should still be
connected to the analogue front end.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
  2023-03-27 10:14       ` Charles Keepax
@ 2023-03-27 14:48           ` Svyatoslav Ryhel
  0 siblings, 0 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27 14:48 UTC (permalink / raw)
  To: Charles Keepax
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Maxim Schwalm, Dmitry Osipenko, patches, alsa-devel,
	linux-kernel

пн, 27 бер. 2023 р. о 13:14 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
>
> On Mon, Mar 27, 2023 at 11:37:05AM +0300, Svyatoslav Ryhel wrote:
> > пн, 27 бер. 2023 р. о 11:32 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
> > >
> > > On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> > > > Add DMIC input and routing.
> > > >
> > > > Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> > > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > > > ---
> > > >  sound/soc/codecs/wm8903.c | 5 ++++-
> > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> > > > index 41346e5ec5ad..9c2f0aadcff3 100644
> > > > --- a/sound/soc/codecs/wm8903.c
> > > > +++ b/sound/soc/codecs/wm8903.c
> > > > @@ -9,7 +9,6 @@
> > > >   *
> > > >   * TODO:
> > > >   *  - TDM mode configuration.
> > > > - *  - Digital microphone support.
> > > >   */
> > > >
> > > >  #include <linux/module.h>
> > > > @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
> > > >  SND_SOC_DAPM_INPUT("IN2R"),
> > > >  SND_SOC_DAPM_INPUT("IN3L"),
> > > >  SND_SOC_DAPM_INPUT("IN3R"),
> > > > +SND_SOC_DAPM_INPUT("DMIC"),
> > > >  SND_SOC_DAPM_INPUT("DMICDAT"),
> > >
> > > There is already a datapath for the DMIC here, DMICDAT. Are you
> > > sure you don't just need to set the "Left/Right ADC Input" muxes
> > > correctly through the ALSA controls?
> > >
> >
> > I will check once more, but so far I was not able to set the mic to
> > work with DMICDAT. Only with this patch.
> >
>
> The two should be basically equivalent when the controls are set
> right, your patch has:
>
> DMIC -> ADCL
>
> The current code has
>
> DMIC -> Left ADC Input -> ADCL
>
> The only difference is that Left ADC Input sets the ADC_DIG_MIC
> bit, but the datasheet clearly indicates that should be
> necessary for digital mics to work. Does your system definitely
> have DMICs? Without that bit set the decimator should still be
> connected to the analogue front end.
>

You are correct, this patch is not needed. It appears that the
issue was not in routing but in wm8903 gpio configuration.

DMICDAT works as intended.

> Thanks,
> Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v1 1/1] ASoC: wm8903: implement DMIC support
@ 2023-03-27 14:48           ` Svyatoslav Ryhel
  0 siblings, 0 replies; 16+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27 14:48 UTC (permalink / raw)
  To: Charles Keepax
  Cc: Liam Girdwood, Mark Brown, Takashi Iwai, Maxim Schwalm,
	Dmitry Osipenko, patches, alsa-devel, linux-kernel

пн, 27 бер. 2023 р. о 13:14 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
>
> On Mon, Mar 27, 2023 at 11:37:05AM +0300, Svyatoslav Ryhel wrote:
> > пн, 27 бер. 2023 р. о 11:32 Charles Keepax <ckeepax@opensource.cirrus.com> пише:
> > >
> > > On Sat, Mar 25, 2023 at 10:36:43AM +0200, Svyatoslav Ryhel wrote:
> > > > Add DMIC input and routing.
> > > >
> > > > Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF300T
> > > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > > > ---
> > > >  sound/soc/codecs/wm8903.c | 5 ++++-
> > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
> > > > index 41346e5ec5ad..9c2f0aadcff3 100644
> > > > --- a/sound/soc/codecs/wm8903.c
> > > > +++ b/sound/soc/codecs/wm8903.c
> > > > @@ -9,7 +9,6 @@
> > > >   *
> > > >   * TODO:
> > > >   *  - TDM mode configuration.
> > > > - *  - Digital microphone support.
> > > >   */
> > > >
> > > >  #include <linux/module.h>
> > > > @@ -816,6 +815,7 @@ SND_SOC_DAPM_INPUT("IN2L"),
> > > >  SND_SOC_DAPM_INPUT("IN2R"),
> > > >  SND_SOC_DAPM_INPUT("IN3L"),
> > > >  SND_SOC_DAPM_INPUT("IN3R"),
> > > > +SND_SOC_DAPM_INPUT("DMIC"),
> > > >  SND_SOC_DAPM_INPUT("DMICDAT"),
> > >
> > > There is already a datapath for the DMIC here, DMICDAT. Are you
> > > sure you don't just need to set the "Left/Right ADC Input" muxes
> > > correctly through the ALSA controls?
> > >
> >
> > I will check once more, but so far I was not able to set the mic to
> > work with DMICDAT. Only with this patch.
> >
>
> The two should be basically equivalent when the controls are set
> right, your patch has:
>
> DMIC -> ADCL
>
> The current code has
>
> DMIC -> Left ADC Input -> ADCL
>
> The only difference is that Left ADC Input sets the ADC_DIG_MIC
> bit, but the datasheet clearly indicates that should be
> necessary for digital mics to work. Does your system definitely
> have DMICs? Without that bit set the decimator should still be
> connected to the analogue front end.
>

You are correct, this patch is not needed. It appears that the
issue was not in routing but in wm8903 gpio configuration.

DMICDAT works as intended.

> Thanks,
> Charles

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-03-29 16:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25  8:36 [PATCH v1 0/1] Implement DMIC support in WM8903 Svyatoslav Ryhel
2023-03-25  8:36 ` [PATCH v1 1/1] ASoC: wm8903: implement DMIC support Svyatoslav Ryhel
2023-03-27  8:32   ` Charles Keepax via Alsa-devel
2023-03-27  8:32   ` Charles Keepax
2023-03-27  8:37     ` Svyatoslav Ryhel
2023-03-27  8:37       ` Svyatoslav Ryhel
2023-03-27 10:14       ` Charles Keepax
2023-03-27 14:48         ` Svyatoslav Ryhel
2023-03-27 14:48           ` Svyatoslav Ryhel
2023-03-27 10:14       ` Charles Keepax via Alsa-devel
2023-03-27  8:33 ` [PATCH v1 0/1] Implement DMIC support in WM8903 Charles Keepax
2023-03-27  8:38   ` Svyatoslav Ryhel
2023-03-27  8:38     ` Svyatoslav Ryhel
2023-03-27 10:03     ` Charles Keepax via Alsa-devel
2023-03-27 10:03     ` Charles Keepax
2023-03-27  8:33 ` Charles Keepax via Alsa-devel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.