alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: jeff_chang <jeff_chang@richtek.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	Jeff Chang <richtek.jeff.chang@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [alsa-devel] [PATCH v6] ASoC: Add MediaTek MT6660 Speaker Amp Driver
Date: Tue, 14 Jan 2020 11:12:53 +0100	[thread overview]
Message-ID: <s5hwo9uqrbu.wl-tiwai@suse.de> (raw)
In-Reply-To: <36357249c6ed4a989cd11535fdefef6e@ex1.rt.l>

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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2020-01-14 13:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14  2:22 [alsa-devel] [PATCH v6] ASoC: Add MediaTek MT6660 Speaker Amp Driver Jeff Chang
2020-01-14  7:44 ` Takashi Iwai
     [not found]   ` <36357249c6ed4a989cd11535fdefef6e@ex1.rt.l>
2020-01-14 10:12     ` Takashi Iwai [this message]
2020-01-14 14:49       ` Mark Brown
2020-01-14 12:47   ` Mark Brown
2020-01-14 13:27     ` Takashi Iwai

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=s5hwo9uqrbu.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeff_chang@richtek.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=richtek.jeff.chang@gmail.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).