alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Martin Kepplinger <martin.kepplinger@puri.sm>
Cc: alsa-devel@alsa-project.org, kernel@puri.sm,
	patches@opensource.cirrus.com, tiwai@suse.com,
	lgirdwood@gmail.com, broonie@kernel.org, geert@glider.be,
	daniel.baluta@nxp.com
Subject: Re: [PATCH] wm8962: add a simple DMIC enable control
Date: Wed, 2 Feb 2022 09:53:01 +0000	[thread overview]
Message-ID: <20220202095301.GZ18506@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <20220201150113.880330-1-martin.kepplinger@puri.sm>

On Tue, Feb 01, 2022 at 04:01:13PM +0100, Martin Kepplinger wrote:
> In order to use the external mic we need to switch DMIC_ENA off.

When you say external mic do you mean an analogue mic connected
to the INxy pins on the chip?

> I know when DMIC is not used at all, the codec driver does
> snd_soc_dapm_nc_pin(dapm, "DMICDAT"); but I'm not sure how I'd create
> a control based on that.

snd_soc_dapm_nc_pin should be called on DMICDAT if the GPIOs are
not configured for use of a DMIC. And if called DMIC_ENA should
never be set by the driver, since it can't be used as the pins
are not configured to operate as DMICs.

> I'm not yet looking into detection - only making it work when selected
> manually, via ucm. Although I need detection too later.
> 
> While this works when I set the control in ucm, AFAIK the way I do it
> here is not correct though due to dapm.
> 
> I guess this conflicts with the widget:
> SND_SOC_DAPM_AIF_IN("DMIC_ENA", NULL, 0, WM8962_PWR_MGMT_1, 10, 0),
> 
> Do you have any advice for me on how to do what I want?
> 

Yes the DMIC enable should be controlled through DAPM when the
relevant audio path is enabled.

Just to check I understand the problem correctly. You have a system
that has both analogue and digital mics connected, and the
problem is that DMIC_ENA is then permanently enabled, meaning you
can't access the audio from the analogue mics?

Assuming I am correct above, looking through the DAPM graph it does
look like the DMIC is oddly wired. It does appear to be hard wired
into ADCL, which would indeed cause it to be permanently enabled
if the pins are configured for DMIC. Assuming there isn't some
reason the chip can't switch between digital and analogue modes
(I can't see an obvious one in the datasheet), I think really there
is a DAPM mux missing here. There should be a mux connecting both
MIXINL and DMIC_ENA to ADCL/ADCR, rather than them both being
directly connected that would let the user switch between
analogue and digital inputs.

Thanks,
Charles

       reply	other threads:[~2022-02-02  9:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220201150113.880330-1-martin.kepplinger@puri.sm>
2022-02-02  9:53 ` Charles Keepax [this message]
     [not found]   ` <3542af028b622ec1513810b014c35a94b82a94c0.camel@puri.sm>
2022-02-02 10:46     ` [PATCH] wm8962: add a simple DMIC enable control Charles Keepax
     [not found]       ` <99b847d17e8ac399dba10842ec20091df926aa06.camel@puri.sm>
2022-02-02 13:35         ` Charles Keepax
2022-02-03  9:57           ` Martin Kepplinger
2022-02-03 11:05             ` Charles Keepax
2022-02-04  9:43               ` Martin Kepplinger
2022-02-04  9:50                 ` Martin Kepplinger
2022-02-04 17:21                 ` Charles Keepax
2022-02-07 10:49                   ` Martin Kepplinger
2022-02-07 14:21                     ` Charles Keepax
2022-03-01 13:44                       ` Charles Keepax
2022-03-01 14:00                         ` Martin Kepplinger
2022-03-02 11:48                           ` Martin Kepplinger
2022-03-02 13:40                             ` Charles Keepax
2022-03-02 14:11                               ` Martin Kepplinger
2022-03-03 11:27                                 ` Charles Keepax

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=20220202095301.GZ18506@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=geert@glider.be \
    --cc=kernel@puri.sm \
    --cc=lgirdwood@gmail.com \
    --cc=martin.kepplinger@puri.sm \
    --cc=patches@opensource.cirrus.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;
as well as URLs for NNTP newsgroup(s).