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 23:58:45 +0100	[thread overview]
Message-ID: <20130730225845.GB9858@sirena.org.uk> (raw)
In-Reply-To: <51F8302D.406@wwwdotorg.org>

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

On Tue, Jul 30, 2013 at 03:29:17PM -0600, Stephen Warren wrote:
> On 07/30/2013 02:45 PM, Mark Brown wrote:

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

> What it accomplishes is not polluting the CODEC's binding with a set
> of strings that must always be supported since DT is an ABI. The
> strings are isolated into the specific audio complex binding, which
> might possibly become deprecated and replaced with something better
> and more generic.

You seem to be assuming that the strings are a bad thing.  I'm not sure
that this is the case modulo the tooling issues...

Besides the reality is that we're using strings right now and they're
being baked into bindings right now, I can't see anything being saved by
listing them in the board binding rather than in the CODEC binding since
both are ABIs especially once you get to the second board binding.  The
ship has sailed on that one.  

All the CODEC binding does is say "there are pins called this", it's up
to some other binding to define how they're used and the CODEC binding
can always add extra information to that list, including a mapping to
integers.

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

> Yes, you'd certainly have to use defines not raw integers. The strings
> wouldn't appear in the binding doc so much as the numbers.

The strings would be there in the text explaining what the numbers mean
- whatever happens the pin names are going to be physically present in
the document, it's just a formatting difference.  The CODEC document
has to list all the pins, we're not going to avoid that by defining a
mapping to integers since adding the integers will in some way end up
defining the names even if just as part of the name of a constant.

We could start adding the integers right now - something like:

	The X CODEC has the following numbered input and output pins:

		1. HPOUTL
		2. HPOUTR
		...

	(see datasheet for details), a header file is provided with
	constants X_PIN_foo for convenience.

would work with either approach to identifying the pins or if we're
being less verbose and just reference the header file for the
definitions that becomes something like:

	The X CODEC has input and output pins listed with numerical
	identifiers in the form the X_PIN_foo defined in the X.h header
	file where foo is the name of the pin.

(that's not good boilerplate wording but you get my drift) which still
ends up defining a set of known strings for pins.

In fact now that I think about this why don't we just go ahead and do
all this, starting by putting the numbers into the bindings for the
CODECs since that's the simplest thing and doesn't involve writing code?
I even have several boards on my desk that run DT ASoC...

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

  reply	other threads:[~2013-07-30 22:58 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
2013-07-30 21:29       ` Stephen Warren
2013-07-30 22:58         ` Mark Brown [this message]
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=20130730225845.GB9858@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®