From: David Gibson <david@gibson.dropbear.id.au>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: PowerPC dev list <Linuxppc-dev@ozlabs.org>,
Timur Tabi <timur@freescale.com>
Subject: Re: Revisited, audio codec device tree entries.
Date: Tue, 20 Nov 2007 11:59:41 +1100 [thread overview]
Message-ID: <20071120005941.GC3126@localhost.localdomain> (raw)
In-Reply-To: <fa686aa40711191128i59245403g3e15e3b6c545b6ee@mail.gmail.com>
On Mon, Nov 19, 2007 at 12:28:02PM -0700, Grant Likely wrote:
> On 11/19/07, Jon Smirl <jonsmirl@gmail.com> wrote:
> > On 11/19/07, Grant Likely <grant.likely@secretlab.ca> wrote:
> > > You might be stuck with using either a platform_device or an
> > > of_platform_device as a stepping stone to creating the device on the
> > > ALSA fabric driver.
> >
> > I also concluded that I need a of_platform stepping stone.
> >
> > There are several ways this could be done, which one is the right one?
> > a) fabric is global, create a global device node for it and implement
> > it as a of_platform device
>
> This is really board level description stuff. I'd make the node
> global off the root myself and use whatever linkage you think
> appropriate to get you to the codec nodes (phandle's most likely)
No. I think this is the whole damn point we've been spiralling
around.
An of_platform device is appropriate *only* if there is an OF node for
the device. There should be an OF node for the device only if it it
really is a well-defined hardware component which implements it.
As far as I can understand, the "fabric" driver is really just a
catchall to cover whatever various interconnections there are between
audio components on the board.
Those interconnections could (and probably should) be described in the
OF tree. But that description would be to describe each of those
interconnections individually e.g. codecs have links to "sound PHY"
devices (speakers) or whatever, codecs, i2s AC97 and so forth devices
have links between them appropriate to the type of device. Not as
some imaginary "fabric device".
Therefore the fabric driver cannot be instantiated as an of_platfornm
device.
Therfore arch code will have to instantiate the fabric driver some
other way. There are a couple of options here:
1) We have a "universal" device-tree-based fabric driver which
parses all the above-described interconnection information in the
device tree and handles any situation. Cool, but probably a lot of
work and fiddly to get right.
2) Or, the platform code instantiates an appopriate fabric
driver for the board (which will probably make assumptions about how
things are interconnected). Platform code can optionally examine
board level model properties or other device information to select the
correct fabric driver and/or options. The fabric driver can
optionally look at some parts of the device tree information to
configure details of its operation.
Option (2) is a hack, but it's a reasonably well-contained hack. It
works for now, and doesn't preclude switching to option (1) later -
without changes to the device tree, and on a board-by-board basis. It
can also handle the (almost inevitable) case of device trees with
missing or incorrect detailed audio interconnection information.
The basic thing is that we have a mismatch between the Linux driver
model and the device tree model. Rather than hacking the device tree
to match the Linux model, we should provide whatever glue code is
necessary to instantiate the necessary Linux drivers from the device
tree information we have. This is, essentially, the exact purpose for
which platform code exists.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next prev parent reply other threads:[~2007-11-20 0:59 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-18 18:10 Revisited, audio codec device tree entries Jon Smirl
2007-11-18 20:16 ` Segher Boessenkool
2007-11-18 21:49 ` Jon Smirl
2007-11-18 22:46 ` Matt Sealey
2007-11-18 23:31 ` Matt Sealey
2007-11-18 23:47 ` Jon Smirl
2007-11-19 0:12 ` David Gibson
2007-11-19 0:22 ` Jon Smirl
2007-11-19 12:48 ` Segher Boessenkool
2007-11-20 0:22 ` David Gibson
2007-11-19 16:31 ` Matt Sealey
2007-11-19 17:05 ` Scott Wood
2007-11-19 18:55 ` Grant Likely
2007-11-20 0:33 ` David Gibson
2007-11-19 12:07 ` Segher Boessenkool
2007-11-19 16:58 ` Matt Sealey
2007-11-20 1:42 ` David Gibson
2007-11-19 14:57 ` Timur Tabi
2007-11-19 15:33 ` Jon Smirl
2007-11-19 15:02 ` Timur Tabi
2007-11-19 15:15 ` Jon Loeliger
2007-11-19 15:33 ` Grant Likely
2007-11-19 16:00 ` Jon Smirl
2007-11-19 16:31 ` Grant Likely
2007-11-19 16:51 ` Jon Smirl
2007-11-19 17:33 ` Grant Likely
2007-11-19 19:20 ` Jon Smirl
2007-11-19 19:28 ` Grant Likely
2007-11-20 0:59 ` David Gibson [this message]
2007-11-26 15:51 ` Timur Tabi
2007-11-26 16:38 ` Jon Smirl
2007-11-26 16:40 ` Timur Tabi
2007-11-19 16:45 ` Timur Tabi
2007-11-19 22:37 ` Jon Smirl
2007-11-19 16:44 ` Timur Tabi
2007-11-19 16:53 ` Grant Likely
2007-11-19 16:55 ` Jon Smirl
2007-11-19 15:37 ` Jon Smirl
2007-11-19 15:42 ` Grant Likely
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=20071120005941.GC3126@localhost.localdomain \
--to=david@gibson.dropbear.id.au \
--cc=Linuxppc-dev@ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=timur@freescale.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;
as well as URLs for NNTP newsgroup(s).