[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201701092029.53939@pali>
Date: Mon, 9 Jan 2017 20:29:53 +0100
From: Pali Rohár <pali.rohar@...il.com>
To: Mark Brown <broonie@...nel.org>
Cc: Tony Lindgren <tony@...mide.com>,
Peter Ujfalusi <peter.ujfalusi@...com>,
Jarkko Nikula <jarkko.nikula@...mer.com>,
Liam Girdwood <lgirdwood@...il.com>,
"Lars-Peter Clausen" <lars@...afoo.de>,
Aaro Koskinen <aaro.koskinen@....fi>,
Nishanth Menon <nm@...com>, Sebastian Reichel <sre@...nel.org>,
Pavel Machek <pavel@....cz>,
Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>,
joerg Reisenweber <joerg@...nmoko.org>,
linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Nokia N900 headset detection & MIC Bias + TVOUT
On Monday 09 January 2017 20:22:01 Mark Brown wrote:
> On Mon, Jan 09, 2017 at 02:13:17PM +0100, Pali Rohár wrote:
> > So... can I call snd_soc_dapm_mutex_lock(dapm) at function startup,
> > start doing cable detection and when needed call this?
> >
> > snd_soc_dapm_enable_pin_unlocked(dapm, "HS Mic");
> > snd_soc_dapm_sync_unlocked(dapm);
> >
> > And at the end of function revert back "HS Mic" pin status and call
> > snd_soc_dapm_mutex_unlock(dapm)?
>
> You shouldn't need to lock I'd expect, and you'll want to sync at any
> point where you need an actual change. Note that if something holds
> the microphone bias on (like something using the microphone)
> separately then that'll take effect so if you really need things to
> get turned off then that won't work but you probably have trouble
> anyway in that situation.
This is needed for cable/jack detection at time when jack is inserted.
So before it there cannot be any user of (disconnected) microphone.
What I need is to enable mic bias, measure ADC of some time period,
check status of some GPIOs. Then disable mic bias, measure ADC again and
check GPIOs. I in this detection procedure I need to ensure that nobody
changes mic bias. So I though that locking the whole procedure could
ensure that.
--
Pali Rohár
pali.rohar@...il.com
Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists