Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Cc: alsa-devel@alsa-project.org, garlic.tseng@mediatek.com,
	linux-mediatek@lists.infradead.org, chipeng.chang@mediatek.com,
	wsd_upstream@mediatek.com
Subject: Re: [PATCH v2 1/5] ASoC: add mt6351 codec driver
Date: Mon, 23 Apr 2018 12:39:08 +0100	[thread overview]
Message-ID: <20180423113908.GC19834@sirena.org.uk> (raw)
In-Reply-To: <1524268164.3290.31.camel@mtksdaap41>


[-- Attachment #1.1: Type: text/plain, Size: 1544 bytes --]

On Sat, Apr 21, 2018 at 07:49:24AM +0800, KaiChieh Chuang wrote:

> > These gains should be put in TLVs rather than an enum so userspace can
> > handle them (also it should be dB not Db).  You can handle irregular
> > step sizes like these with DECLARE_TLV_DB_SCALE(), there's several
> > examples in the code already.

> We declare this enum for user space to operate on enum directly,
> unlike alsa-lib, we use tinyalsa in Android, if declared in tlv,
> the mixer control just become a integer control, which is not
> informative for user space.

Your custom userspace isn't really a factor for upstream.

> > > +	if (ucontrol->value.integer.value[0] == 0x1f)	/* reg idx for -40dB*/
> > > +		ucontrol->value.integer.value[0] = ARRAY_SIZE(dl_pga_gain) - 1;

> > Why do this rewriting?

> A little awkward gain register here,
> the range is  for 8dB ~ -10dB and -40dB, corresponding to reg index 0 ~
> 18 and 31.

> 00000: +8dB.
> 00001: +7dB.
> 10010: -10dB
> 11111: -40dB(Mute).

> and where 19 ~ 30 is not defined, and shouldn't be set.

> i think tlv not yet support this kind of gain control?

You can say there's a mute value, but gaps like that aren't easily
handled AFAIR.  You could assign vales to them (I'm guessing there
probably are some that just aren't doucmented for some reason) or...

> Maybe i'll just declare 8dB ~ -10dB for now.

...this is also common, the mixed mute and gain controls aren't always
super useful.  Depending on what goes on with pops and clicks a DAPM
autodisable control might be a good application too.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2018-04-23 11:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16  0:32 [PATCH v2 0/5] ASoC: mediatek: add support for mt6797 SoC KaiChieh Chuang
     [not found] ` <20180416003252.4177-1-kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-16  0:32   ` [PATCH v2 1/5] ASoC: add mt6351 codec driver KaiChieh Chuang
2018-04-18 16:40     ` Mark Brown
2018-04-19  1:58       ` KaiChieh Chuang
2018-04-19 14:41         ` Mark Brown
2018-04-20  6:54           ` KaiChieh Chuang
2018-04-20 23:49       ` KaiChieh Chuang
2018-04-23 11:39         ` Mark Brown [this message]
2018-04-16  0:32   ` [PATCH v2 2/5] ASoC: mt6797: add structure define and clock control function for 6797 KaiChieh Chuang
2018-04-16  0:32   ` [PATCH v2 3/5] ASoC: mt6797: add mt6797 platform driver KaiChieh Chuang
2018-04-18 16:46     ` Mark Brown
2018-04-19  1:51       ` KaiChieh Chuang
2018-04-19 11:29         ` Mark Brown
2018-04-16  0:32   ` [PATCH v2 4/5] ASoC: add mt6797-mt6351 driver and config option KaiChieh Chuang
2018-04-16  0:32 ` [PATCH v2 5/5] ASoC: mediatek: add documents for mt6797 KaiChieh Chuang
2018-04-18 16:46 ` [PATCH v2 0/5] ASoC: mediatek: add support for mt6797 SoC Mark Brown

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=20180423113908.GC19834@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=chipeng.chang@mediatek.com \
    --cc=garlic.tseng@mediatek.com \
    --cc=kaichieh.chuang@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=wsd_upstream@mediatek.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