lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200312190805.GJ4038@sirena.org.uk>
Date:   Thu, 12 Mar 2020 19:08:05 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Eason Yen <eason.yen@...iatek.com>
Cc:     Matthias Brugger <matthias.bgg@...il.com>, jiaxin.yu@...iatek.com,
        linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        devicetree@...r.kernel.org, wsd_upstream@...iatek.com
Subject: Re: [PATCH 2/2] ASoC: codec: mediatek: add mt6359 codec driver

On Thu, Mar 12, 2020 at 02:43:07PM +0800, Eason Yen wrote:
> On Wed, 2020-03-11 at 12:12 +0000, Mark Brown wrote:
> > On Wed, Mar 11, 2020 at 05:22:24PM +0800, Eason Yen wrote:
> > > On Mon, 2020-03-09 at 13:13 +0000, Mark Brown wrote:

> > > The following functions are used to set:
> > > - playback_gpio_set/playback_gpio_reset
> > > - capture_gpio_set/capture_gpio_reset
> > > - vow_gpio_set/vow_gpio_reset

> > This sounds like it should be handled at the machine driver level, it's
> > possible some system integrator will wire things up differently.

> machine driver will set default at booting stage to execute
> mt6359_mtkaif_calibration_enable and mt6359_mtkaif_calibration_disable.

> And at runtime stage, it is triggered by mt_dl_gpio_event and
> mt_ul_gpio_event while playback or capture.

What I'm suggesting is moving those to the machine driver (you could
provide helpers in the CODEC driver for the common case I guess...  I'd
need to review).

> OK. So it is better to fix mic_type (ACC/DMIC/DCC/DCC_*) at init stage
> because it will not be changed at runtime.

> And use another dpam mux or kcontrol to enable/disable vow for low power
> scenario.

> Is it right?

Yes.

> enum {
> 	LO_MUX_OPEN = 0,
> 	LO_MUX_L_DAC,
> 	LO_MUX_3RD_DAC,
> 	LO_MUX_TEST_MODE,
> 	LO_MUX_MASK = 0x3,
> };
> 
> static const char * const lo_in_mux_map[] = {
> 	"Open", "Playback_L_DAC", "Playback", "Test Mode"
> };
> 
> static SOC_ENUM_SINGLE_DECL(lo_in_mux_map_enum,
> 			    SND_SOC_NOPM, 0, lo_in_mux_map);
> 
> static const struct snd_kcontrol_new lo_in_mux_control =
> 	SOC_DAPM_ENUM("LO Select", lo_in_mux_map_enum);

That looks OK.

> > > > > +static int mt_delay_250_event(struct snd_soc_dapm_widget *w,
> > > > > +			      struct snd_kcontrol *kcontrol,
> > > > > +			      int event)
> > > > > +{
> > > > > +	switch (event) {
> > > > > +	case SND_SOC_DAPM_POST_PMU:
> > > > > +	case SND_SOC_DAPM_PRE_PMD:
> > > > > +		usleep_range(250, 270);

> > > > Why would having a sleep before power down be useful?

> > > It is based on designer's control sequence to add some delay while
> > > PMU/PMD.

> > But how does the designer know when the sequence starts?  Don't they
> > mean to have a delay *after* power down?

> For PMU, designer think 
> "AUD_CK" --> wait at least 250ms --> "AUDIF_CK" --> next ...

> For PMD, designer think 
> "AUDIF_CK" --> wait at least 250ms --> "AUD_CK" --> next ...

I think you need some comments about this in the code, it looks like a
mistake - it relies on the use of sequenced widgets, you should
reference that.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ