linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: linuxppc-dev@ozlabs.org, alsa-devel@alsa-project.org,
	Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC
Date: Fri, 4 Jan 2008 16:01:13 +1100	[thread overview]
Message-ID: <20080104050113.GE4326@localhost.localdomain> (raw)
In-Reply-To: <9e4733910801030654i7409e383n6b7f844aa543f234@mail.gmail.com>

On Thu, Jan 03, 2008 at 09:54:45AM -0500, Jon Smirl wrote:
> On 1/2/08, David Gibson <david@gibson.dropbear.id.au> wrote:
[snip]
> > Instantiating the fabric driver off any node is wrong, precisely
> > because it is an abstraction.  The fabric driver should be
> > instantiated by the platform code.
> 
> Instantiating it from the platform code forces me to put it either the
> of_platform_bus or the platform_bus since there aren't any other buses
> around when the platform code runs. Platform bus doesn't implement
> dynamic module loading. So that means it has to go onto the
> of_platform_bus. That implies that is it a pseudo-device without a
> pseudo-device entry in the device tree which is fine with me. I'll
> need to poke around in the of_bus code and see if the driver will load
> without a device tree entry.

You're letting implementation warts influence basic design decisions.
This is not sensible.  Step back and think for a moment, work out a
sane organization *then* think how you might need to fix or workaround
limitations of existing infrastructure.

> A simple fix to this would be to let me instantiate the driver off
> from the root node of the tree. That's the conceptually correct place
> for instantiating a driver that extends the platform code. Should I
> try adjusting the of probing code to pass the node in, or are there
> major objections?

The current probing system can't instantiate a device for the root
node in any sane way, since it takes a list of suitable busses.

The constructor based approach we're looking at implementing could do
it.  It should, in any case, be constructing a platform_device - so
the platform bus code would still need to be extended to handle the
module loading.  Creating it as an of_platform device bound to the
root node might be a workable interim solution though.

of_platform_device simply does not *ever* make sense conceptually: the
type of struct device wrapper in use depends on the bus the device is
attached to, not on how we figured out the device was there.  OF can
potentially give information about any sort of device be it
simple-bus, i2c, PCI or whatever connected.

> Also, as others have pointed out, this driver is not an abstraction.
> It represents the mess of wires hooking the codec up to the jacks on
> the back panel and possibly GPIO pins that control the wiring. You
> need this because the pins on HD audio codecs are completely
> reconfigurable and the same chip can be wired in a thousand different
> ways. It lets you have a generic codec driver and the move the
> platform specific code out of the driver.

Well, "abstraction" is maybe not the right word.  But the point is
that the fabric driver doesn't represent a neatly isolated device with
well defined bus connections.  Instead it represents the tangle of
essentially every link between audio devices in the platform.  About
the clearest possible example of a true "platform device" (as opposed
to a device on some bus that just doesn't have any bus-specific
logic).

-- 
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

  reply	other threads:[~2008-01-04  5:01 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-20  0:03 [PATCH] ASoC drivers for the Freescale MPC8610 SoC Timur Tabi
2007-12-20  4:06 ` Olof Johansson
2007-12-20 14:24   ` Timur Tabi
2007-12-20 13:54     ` [alsa-devel] " Takashi Iwai
2007-12-20 17:04       ` Timur Tabi
2007-12-21  5:28       ` Lee Revell
2007-12-23  3:23         ` Timur Tabi
2007-12-20 22:39     ` Olof Johansson
2007-12-20 22:37       ` Timur Tabi
2007-12-20 22:43         ` Scott Wood
2007-12-23  2:58           ` Timur Tabi
2008-01-02 18:08             ` Scott Wood
2007-12-20 14:47 ` Jon Loeliger
2007-12-20 22:29 ` Jon Smirl
2007-12-20 22:32   ` Timur Tabi
2007-12-20 22:38     ` Jon Smirl
2007-12-20 22:40       ` Timur Tabi
2007-12-20 22:44         ` Scott Wood
2007-12-20 23:13           ` Jon Smirl
2007-12-21  0:00             ` David Gibson
2008-01-01 17:25 ` Jon Smirl
2008-01-01 17:42   ` Jon Smirl
2008-01-02 15:19     ` Timur Tabi
2008-01-02 15:34       ` Jon Smirl
2008-01-03 17:54         ` Timur Tabi
2008-01-03 18:13           ` Grant Likely
2008-01-03 18:20             ` Timur Tabi
2008-01-03 18:32               ` Grant Likely
2008-01-03 23:51           ` David Gibson
2008-01-05  2:39             ` [alsa-devel] " Timur Tabi
2008-01-06  0:46               ` David Gibson
2008-01-07 14:24                 ` Mark Brown
2008-01-07 15:52                 ` Timur Tabi
2008-01-07 18:28                   ` Mark Brown
2008-01-10  3:49                     ` David Gibson
2008-01-10  5:41                       ` Jon Smirl
2008-01-10 10:30                         ` Liam Girdwood
2008-01-10 15:39                           ` Timur Tabi
2008-01-10 16:01                             ` Grant Likely
2008-01-10 16:03                               ` Timur Tabi
2008-01-10 20:10                                 ` Jon Smirl
2008-01-10 20:13                                   ` Timur Tabi
2008-01-10 20:24                                     ` Grant Likely
2008-01-10 20:35                                       ` Timur Tabi
2008-01-10 20:39                                     ` Jon Smirl
2008-01-10 20:44                                       ` Timur Tabi
2008-01-07 18:44                   ` Liam Girdwood
2008-01-07 18:45                     ` Timur Tabi
2008-01-02 16:12       ` Grant Likely
2008-01-03 18:08         ` Timur Tabi
2008-01-03 18:17           ` Grant Likely
2008-01-03 18:54             ` Scott Wood
2008-01-03 19:13               ` Grant Likely
2008-01-03 19:18                 ` Scott Wood
2008-01-03 23:13                   ` [alsa-devel] " Mark Brown
2008-01-05  2:35                 ` Timur Tabi
2008-01-05  3:28                   ` Grant Likely
2008-01-02  0:26   ` David Gibson
2008-01-02 15:10   ` Timur Tabi
2008-01-02 17:23     ` [alsa-devel] " Mark Brown
2008-01-03 18:23       ` Timur Tabi
2008-01-03 23:00         ` Mark Brown
2008-01-05  2:43           ` Timur Tabi
2008-01-07 13:37             ` Mark Brown
2008-01-02  4:27 ` Jon Smirl
2008-01-02 15:29   ` Timur Tabi
2008-01-02 15:56     ` Jon Smirl
2008-01-02 16:32       ` Grant Likely
2008-01-02 17:12         ` Jon Smirl
2008-01-02 17:22           ` Grant Likely
2008-01-02 18:43             ` Jon Smirl
2008-01-02 18:50               ` Grant Likely
2008-01-02 18:56                 ` Jon Smirl
2008-01-03  4:46           ` David Gibson
2008-01-03 14:33             ` Jon Smirl
2008-01-03 17:57       ` Timur Tabi
2008-01-02 16:28     ` Grant Likely
2008-01-02 18:49       ` [alsa-devel] " Mark Brown
2008-01-03 18:16         ` Timur Tabi
2008-01-03 23:47           ` David Gibson
2008-01-04 13:39             ` Mark Brown
2008-01-03 18:14       ` Timur Tabi
2008-01-03 18:25         ` Grant Likely
2008-01-03 18:28           ` Timur Tabi
2008-01-03 18:38             ` Grant Likely
2008-01-03  4:44     ` David Gibson
2008-01-03 14:54       ` Jon Smirl
2008-01-04  5:01         ` David Gibson [this message]
2008-01-03 18:16       ` Timur Tabi

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=20080104050113.GE4326@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=alsa-devel@alsa-project.org \
    --cc=jonsmirl@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --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).