mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Richard Genoud <richard.genoud@gmail.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Bo Shen <voice.shen@atmel.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH v6 2/8] ASoC: atmel: machine driver for at91sam9x5-wm8731 boards
Date: Tue, 30 Jul 2013 21:45:11 +0100	[thread overview]
Message-ID: <20130730204511.GX9858@sirena.org.uk> (raw)
In-Reply-To: <51F7FBA8.6080400@wwwdotorg.org>

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

On Tue, Jul 30, 2013 at 11:45:12AM -0600, Stephen Warren wrote:
> On 07/30/2013 04:32 AM, Richard Genoud wrote:

> > +wm8731 pins:
> > +cf Documentation/devicetree/bindings/sound/wm8731.txt

> In the Tegra bindings, I deliberately put the list of CODEC pins into
> the audio complex binding rather than the CODEC binding. That's because

You really shouldn't do this, it's not accomplishing much.

> I'm not sure that in the long-term we want to use strings to identify
> the CODEC pins, rather than using integers. By putting the list orf
> CODEC pins in the audio complex binding rather than the CODEC binding, I
> didn't lumber the CODEC binding with a list of strings that it had to
> support forever.

How would you create the numbers - you can't use the pin numbers since
BGA type packages have alphanumeric ball identifiers?  Even with
numerical pin numbering ou'd need to specify some defines for this not
to be totally awful at which point you may as well have the strings
documented since you'd end up writing a table in the binding document
that's basically a mapping of pin names to numbers,

> One reason that strings are problematic is because they can't be mixed
> with integers/phandles in the same property, so if we ever end up with
> more generic audio bindings where the routing table is expressed more like:

> audio-routes = <&component_a $a_pin &component_b $b_pin>;

> ... in order to allow completely arbitrary and fully name-spaced routing
> specification[1], then $a_pin and $b_pin need to be integers not strings.

The above is going to be legibility challenged without defines at which
point the strings end up appearing in the binding document anyway.

Besides, you're stuck with the names you picked anyway so you may as
well put them in the CODEC driver binding document so that anyone else
using the same CODEC can reuse that bit of work.

> [1] and perhaps we can get rid of properties like
> audio-codec/ssc-controller, and automatically deduce which components
> are needed simply by finding all phandles in the audio-routes property.

> Perhaps the solution here is to allow mixing phandles/integers/strings
> in one property, but that's potentially quite a large change to the DTB
> format; we'd need to introduce type fields into the property data, and
> other data format changes.

I really do think this is a DT failure which ought to be addressed
there; people are working around this with things like parallel arrays
with names and phandles which aren't awesome once the arrays get to be
any size.

One option that seems sensible is to introduce syntactic sugar which
will do the parallel arrays trick automatically - the actual DT that
gets output could still be two arrays with indexes that match up (so no
impact on parsers) but the DT author would be able to write an array of
(phandle, string) tuples or something instead of having to line up two
arrays.

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

  reply	other threads:[~2013-07-30 20:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30 10:32 [PATCH v6 0/8] Sound support for at91sam9x5-wm8731 based boards Richard Genoud
2013-07-30 10:32 ` [PATCH v6 1/8] ASoC: wm8731: add rates constraints Richard Genoud
2013-07-30 11:29   ` Mark Brown
2013-07-30 10:32 ` [PATCH v6 2/8] ASoC: atmel: machine driver for at91sam9x5-wm8731 boards Richard Genoud
2013-07-30 17:45   ` Stephen Warren
2013-07-30 20:45     ` Mark Brown [this message]
2013-07-30 21:29       ` Stephen Warren
2013-07-30 22:58         ` Mark Brown
2013-07-31 22:16           ` Stephen Warren
2013-08-01  9:53             ` Mark Brown
2013-08-06 17:11   ` Mark Brown
2013-08-07  8:20     ` Richard Genoud
2013-07-30 10:32 ` [PATCH v6 3/8] Documentation: DT: update atmel SSC with DMA binding Richard Genoud
2013-08-06 17:12   ` Mark Brown
2013-07-30 10:32 ` [PATCH v6 4/8] ARM: AT91: DTS: sam9x5: add SSC DMA parameters Richard Genoud
2013-07-30 10:32 ` [PATCH v6 5/8] ARM: AT91: DTS: sam9x5ek: add WM8731 codec Richard Genoud
2013-07-30 10:32 ` [PATCH v6 6/8] ARM: AT91: DTS: sam9x5ek: enable SSC Richard Genoud
2013-07-30 10:32 ` [PATCH v6 7/8] ARM: AT91: DTS: sam9x5ek: add sound configuration Richard Genoud
2013-07-30 10:32 ` [PATCH v6 8/8] ASoC: sam9x5: get codec MCLK via device tree Richard Genoud
2013-07-30 12:03   ` Mark Brown
2013-07-30 12:15     ` Richard Genoud
  -- strict thread matches above, loose matches on Subject: below --
2013-07-30  9:59 [PATCH v6 0/8] Sound support for at91sam9x5-wm8731 based boards Richard Genoud
2013-07-30  9:59 ` [PATCH v6 2/8] ASoC: atmel: machine driver for at91sam9x5-wm8731 boards Richard Genoud

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=20130730204511.GX9858@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=richard.genoud@gmail.com \
    --cc=swarren@wwwdotorg.org \
    --cc=voice.shen@atmel.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®