devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cosmin Samoila <cosmin.samoila-3arQi8VN3Tc@public.gmane.org>
To: "broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: dl-linux-imx <linux-imx-3arQi8VN3Tc@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"wakasugi.jb-r6lgfPJHJciWyREYz5tgSuqrae++aQT8@public.gmane.org"
	<wakasugi.jb-r6lgfPJHJciWyREYz5tgSuqrae++aQT8@public.gmane.org>,
	"mihai.serban-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<mihai.serban-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"S.j. Wang" <shengjiu.wang-3arQi8VN3Tc@public.gmane.org>,
	Daniel Baluta <daniel.baluta-3arQi8VN3Tc@public.gmane.org>,
	"alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org"
	<alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org>,
	"mihai.serban-3arQi8VN3Tc@public.gmane.org"
	<mihai.serban-3arQi8VN3Tc@public.gmane.org>
Subject: Re: [PATCH] ASoC: codecs: Add support for AK4458 DAC driver
Date: Fri, 9 Feb 2018 10:22:16 +0000	[thread overview]
Message-ID: <1518171736.19973.7.camel@nxp.com> (raw)
In-Reply-To: <20180131170330.GB7763-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

Hi Mark,

> > +static const struct soc_enum ak4458_dac_enum[] = {
> > +/*0*/	SOC_ENUM_SINGLE(AK4458_01_CONTROL2, 1,
> > +			ARRAY_SIZE(ak4458_dem_select_texts),
> > +			ak4458_dem_select_texts),
> > +/*1*/	SOC_ENUM_SINGLE(AK4458_0A_CONTROL6, 0,
> The fact that you need these comments is why these arrays are a bad
> idea
> - just use individually named variables as other drivers do.
> 
> > 
> > +static const struct snd_kcontrol_new ak4458_snd_controls[] = {
> > +	SOC_SINGLE_TLV("AK4458 L1ch Digital Volume",
> > +		       AK4458_03_LCHATT, 0/*shift*/, 0xFF/*max
> > value*/,
> > +		       0/*invert*/, latt_tlv),
> > +	SOC_SINGLE_TLV("AK4458 R1ch Digital Volume",
> > +		       AK4458_04_RCHATT, 0, 0xFF, 0, ratt_tlv),
> It'd be more idiomatic to combine these into stereo pairs than have
> them
> as single channel controls.
> 
> > 
> > +static const char * const ak4458_dac_select_texts[] = { "OFF",
> > "ON" };
> This looks like the users should be switch controls - what's the goal
> here?
> 
> > 

I think this is to allow users to switch off sound for all channels but
it seems silly to have 4 controls doing the same thing.
We now have two options:
- one control to switch off sound for all channels
- one controll per DAC

What do you mean by "users should be switch controls" ?
Should we use SND_SOC_DAPM_SWITCH instead of SND_SOC_DAPM_MUX?

We are still learing the inner details of ASoC.
Thank you for your help.

Cosmin

  parent reply	other threads:[~2018-02-09 10:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 13:20 [PATCH] ASoC: codecs: Add support for AK4458 DAC driver Cosmin-Gabriel Samoila
2018-01-31 17:03 ` Mark Brown
     [not found]   ` <20180131170330.GB7763-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2018-02-09 10:22     ` Cosmin Samoila [this message]
2018-02-09 15:47       ` Mark Brown
2018-02-13  9:22   ` Cosmin Samoila
2018-02-13 11:55     ` Mark Brown
2018-02-05  6:08 ` Rob Herring
     [not found] ` <1517404809-25250-1-git-send-email-cosmin.samoila-3arQi8VN3Tc@public.gmane.org>
2018-02-12 12:47   ` Fabio Estevam

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=1518171736.19973.7.camel@nxp.com \
    --to=cosmin.samoila-3arqi8vn3tc@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=daniel.baluta-3arQi8VN3Tc@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-imx-3arQi8VN3Tc@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mihai.serban-3arQi8VN3Tc@public.gmane.org \
    --cc=mihai.serban-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=shengjiu.wang-3arQi8VN3Tc@public.gmane.org \
    --cc=wakasugi.jb-r6lgfPJHJciWyREYz5tgSuqrae++aQT8@public.gmane.org \
    /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).