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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Jan 2020 11:12:53 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     jeff_chang (張世佳) <jeff_chang@...htek.com>
Cc:     Jeff Chang <richtek.jeff.chang@...il.com>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "perex@...ex.cz" <perex@...ex.cz>,
        "tiwai@...e.com" <tiwai@...e.com>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6] ASoC: Add MediaTek MT6660 Speaker Amp Driver

On Tue, 14 Jan 2020 10:48:24 +0100,
jeff_chang(張世佳) wrote:
> 
> Dear Takashi:
> 
> Thank for your replying.
> 
> 1.> +static int mt6660_component_get_volsw(struct snd_kcontrol *kcontrol,
> > +  struct snd_ctl_elem_value *ucontrol) {
> > +struct snd_soc_component *component =
> > +snd_soc_kcontrol_component(kcontrol);
> > +struct mt6660_chip *chip = (struct mt6660_chip *)
> > +snd_soc_component_get_drvdata(component);
> > +int ret = -EINVAL;
> > +
> > +if (!strcmp(kcontrol->id.name, "Chip Rev")) {
> > +ucontrol->value.integer.value[0] = chip->chip_rev & 0x0f;
> > +ret = 0;
> > +}
> > +return ret;
> 
> So, "T0 SEL" control gets always an error when reading?
> Then can't we pass simply NULL for get ops instead?
> 
> Jeff : T0 SEL use snd_soc_get_volsw, it will not use this function.

Then what's the reason of this hackish check?


> 2. So here both 24 and 32 bits data are handled equally, and...
> 
> ....
> > +ret = snd_soc_component_update_bits(dai->component,
> > +MT6660_REG_TDM_CFG3, 0x3f0, word_len << 4);
> 
> ... word_len is same for both S32 and S24 formats, so there can be no difference between S24 and S32 format handling in the code.
> Meanwhile, the supported formats are:
> 
> > +#define STUB_FORMATS(SNDRV_PCM_FMTBIT_S16_LE | \
> > +SNDRV_PCM_FMTBIT_U16_LE | \
> > +SNDRV_PCM_FMTBIT_S24_LE | \
> > +SNDRV_PCM_FMTBIT_U24_LE | \
> > +SNDRV_PCM_FMTBIT_S32_LE | \
> > +SNDRV_PCM_FMTBIT_U32_LE)
> 
> Are you sure that S24_* formats really work properly?
> 
> Also, the code has no check / setup of the format signedness.
> Do unsigned formats (U16, U24, etc) really work as expected, too?
> 
> 
> Jeff :  Yes, it works.

So, for the codec, it doesn't matter at all about the signedness and
the alingment of 32bit / 24bit of the incoming signals, but magically
handled as is?  Interesting...


thanks,

Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ