mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Ben Zhang <benzh@google.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Bard Liao <bardliao@realtek.com>,
	Oder Chiou <oder_chiou@realtek.com>,
	Anatol Pomozov <anatol@google.com>,
	Dylan Reid <dgreid@chromium.org>,
	Albert Chen <albertchen@realtek.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] ASoC: rt5677: add a platform config option for MICBIAS voltage
Date: Mon, 15 Dec 2014 12:20:22 +0000	[thread overview]
Message-ID: <20141215122022.GA11764@sirena.org.uk> (raw)
In-Reply-To: <CAOV7By+GVAZiqwO9NW3DB87uOzx003K_RPqKhX4+vvf=oB=99A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

On Fri, Dec 12, 2014 at 03:48:51PM -0800, Ben Zhang wrote:
> On Fri, Dec 12, 2014 at 5:27 AM, Mark Brown <broonie@kernel.org> wrote:
> > On Wed, Dec 10, 2014 at 08:15:26PM -0800, Ben Zhang wrote:

> > Why is this being specified as some magic number rather than using the
> > voltage (or at least providing defines for the voltage) - this is going
> > to do little to make the DT legible and...

> >> +enum rt5677_micbias {
> >> +     RT5677_MICBIAS_1_476V = 0,
> >> +     RT5677_MICBIAS_2_970V = 1,
> >> +     RT5677_MICBIAS_1_242V = 2,
> >> +     RT5677_MICBIAS_2_475V = 3,
> >> +};

> > ...I see there are defined for platform data.

> This patch adds both an entry to the platform data and a DT binding
> for MICBIAS level selection. The 4 voltage options
> (1.476V/2.970V/1.242V/2.475V) are the only ones supported by the codec
> hardware, so it seems an enum is better than specifying the exact

It's not that clear that an enum *is* better, and a magic numbers enum
is definitely worse for anyone who has to read the resulting DT.

> voltage directly. I was following the two examples below:
> Documentation/devicetree/bindings/sound/cs42l52.txt (cirrus,micbias-lvl)
> Documentation/devicetree/bindings/sound/tlv320aic3x.txt (ai3x-micbias-vg)

Old DT bindings are old and often not best practice.

> I'm new to devicetree bindings. Is there something like an enum in DT?

include/dt-bindings

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-12-15 12:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11  4:15 [PATCH 1/3] ASoC: rt5677: add REGMAP_I2C and REGMAP_IRQ dependency Ben Zhang
2014-12-11  4:15 ` [PATCH 2/3] ASoC: rt5677: add a platform config option for MICBIAS voltage Ben Zhang
2014-12-12 13:27   ` Mark Brown
2014-12-12 23:48     ` Ben Zhang
2014-12-15 12:20       ` Mark Brown [this message]
2014-12-11  4:15 ` [PATCH 3/3] ASoC: rt5677: add a platform config option for DACREF source Ben Zhang
2014-12-12 13:34   ` Mark Brown
2014-12-12 13:25 ` [PATCH 1/3] ASoC: rt5677: add REGMAP_I2C and REGMAP_IRQ dependency 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=20141215122022.GA11764@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=albertchen@realtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=anatol@google.com \
    --cc=bardliao@realtek.com \
    --cc=benzh@google.com \
    --cc=dgreid@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.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

all inboxes | Powered by JetHome®