From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Eric Miao" <eric.y.miao@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Fundamental Design Flaw of the Device Driver Model?
Date: Fri, 22 Aug 2008 23:54:51 -0400 [thread overview]
Message-ID: <9e4733910808222054i56d9d481v97df477617445ab8@mail.gmail.com> (raw)
In-Reply-To: <f17812d70808221802t250e4210y826a635d6e9688ed@mail.gmail.com>
On 8/22/08, Eric Miao <eric.y.miao@gmail.com> wrote:
> On Fri, Aug 22, 2008 at 10:33 AM, Jon Smirl <jonsmirl@gmail.com> wrote:
> > On 8/22/08, Eric Miao <eric.y.miao@gmail.com> wrote:
> > ======================================================
> >> This, however, creates many questions you have to face with:
> >>
> >> 1. on what bus shall these sub-devices be?
> >> ** this is the reason I choose to use "platform_device", at least they
> >> can reside on the platform_bus_type, thus platform_driver can be used
> >> for this sub-device
> >
> > Another option is making your own bus. If I understand your hardware
> > it effectively has an internal bus.
> >
>
>
> That's another option around, but it didn't solve my fundamental question
> of, (e.g. an PCI card with multiple network interfaces and other functionality):
>
> Why should I have to create an intermediate device provided that a
> "struct net_device" already contains a "struct device"? And that
> device-driver binding, parameter passing (platform_data), bus and
> other functionalities of this "struct net_device" is not used while
> that's used solely by that intermediate device (platform_device maybe)?
>
> They should have perfectly been combined into a single virtual device.
>
First device represent the hardware with the PCI interface for the
card. Instantiating it creates a bus for the card. You then auto add
devices to this bus for each of the sub-devices on the card. Auto add
is fine in this case since the sub-devices aren't optional.
A multifunction card really is a local private bus with multiple
devices on it. First device is a real device - it's the bus controller
for the multifunction card.
A stranger problem is encountered with audio hardware. The SOC CPU
code loads an i2s/ac97 driver. A generic driver for the audio codec is
also loaded. Now you have to create a strange "fabric" device which
represent the specific PCB the generic codec and SOC have been
soldered into. The fabric driver describes how the codec and CPU are
wired together and if all of the codec functions are brought out to
jacks. For example, you don't want to display an ALSA capture device
if the codec supports it but no mic-in jack has been soldered to the
PCB. Is the fabric device a real device? You can't program it but you
can't get rid of it either.
--
Jon Smirl
jonsmirl@gmail.com
prev parent reply other threads:[~2008-08-23 3:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-22 6:25 Eric Miao
2008-08-22 9:03 ` Pavel Machek
2008-08-22 9:32 ` Eric Miao
2008-08-22 11:29 ` pHilipp Zabel
2008-08-23 0:56 ` Eric Miao
2008-08-22 11:17 ` Liam Girdwood
2008-08-22 14:00 ` Stefan Richter
2008-08-22 14:33 ` Jon Smirl
2008-08-23 1:02 ` Eric Miao
2008-08-23 3:54 ` Jon Smirl [this message]
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=9e4733910808222054i56d9d481v97df477617445ab8@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=eric.y.miao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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®