From: Grant Likely <glikely@gmail.com>
To: David Brownell <david-b@pacbell.net>
Cc: linux-kernel@vger.kernel.org, basicmark@yahoo.com,
dpervushin@ru.mvista.com
Subject: Re: SPI redux ... driver model support
Date: Fri, 9 Sep 2005 11:40:39 -0600 [thread overview]
Message-ID: <528646bc0509091040364ae7d4@mail.gmail.com> (raw)
In-Reply-To: <20050909030934.8419AE9DCC@adsl-69-107-32-110.dsl.pltn13.pacbell.net>
On 9/8/05, David Brownell <david-b@pacbell.net> wrote:
> That implies whoever is registering is actually going and creating the
> SPI devices ... and doing it AFTER the controller driver is registered.
> I actually have issues with each of those implications.
>
> However, I was also aiming to support the model where the controller
> drivers are modular, and the "add driver" and "declare hardware" steps
> can go in any order. That way things can work "just like other busses"
> when you load the controller drivers ... and the approach is like the
> familiar "boot firmware gives hardware description tables to the OS"
> approach used by lots of _other_ hardware that probes poorly. (Except
> that Linux is likely taking over lots of that "boot firmware" role.)
To clarify/confirm what your saying:
(I'm going to make liberal use of stars to hilight "devices" and
"drivers" just to make sure that a critical word doesn't get
transposed)
There should be four parts to the SPI model:
1. SPI bus controller *devices*; attached to another bus *instance*
(ie. platform, PCI, etc)
2. SPI bus controller *drivers*; registered with the other bus
*subsystem* (platform, PCI, etc)
3. SPI slave *devices*; attached to a specifiec SPI bus *instance*
4. SPI slave *drivers*; registered with the SPI *subsystem*
a. SPI bus controller *drivers* and slave *drivers* can be registered
at any time in any order
b. SPI bus controller *devices* can be attached to the bus subsystem at any time
c. SPI bus controller *drivers* attach to bus controller *devices* to
create new spi bus instances whenever the driver model makes a 'match'
d. SPI slave devices can be attached to an SPI bus instance only after
that bus instance is created.
e. SPI slave *drivers* attach to SPI slave *devices* when the driver
model makes a match. (let's call it an SPI slave instance)
f. Unregistration of any SPI bus controller *driver* or *device* will
cause attached SPI bus instance(s) and any attached devices to go away
g. Unregistration of any SPI slave *driver* or *device* will cause SPI
slave instance to go away.
[pretty much exactly how the driver model is supposed to work I guess :) ]
Ideally controller drivers, controller devices, slave drivers and
slave devices are all independent of each other. The board setup code
will probably take care of attaching devices to busses independent of
the bus controller drivers and spi slave drivers. Driver code is
responsible for registering itself with the SPI subsystem.
If this is what your saying, then I *strongly* second that opinion.
If not, then what is your view?
I've been dealing with the same problems on my project. Just for
kicks, here's another implementation to look at.
http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019259.html
http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019260.html
http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019261.html
http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019262.html
It also is not based on i2c in any way and it tries ot follow the
device model. It solves my problem, but I've held off active work on
it while looking at the other options being discussed here.
Thanks,
g.
next prev parent reply other threads:[~2005-09-09 17:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-30 2:42 SPI redux ... driver model support David Brownell
2005-08-31 7:59 ` Mark Underwood
2005-09-01 19:17 ` David Brownell
2005-09-02 7:21 ` Mark Underwood
2005-09-02 8:00 ` Leeds United Fan
2005-09-06 2:09 ` David Brownell
2005-09-06 10:05 ` Mark Underwood
2005-09-06 16:00 ` David Brownell
2005-09-06 20:10 ` Mark Underwood
2005-09-06 21:53 ` David Brownell
2005-09-07 18:38 ` Mark Underwood
2005-09-09 3:09 ` David Brownell
2005-09-09 10:33 ` Mark Underwood
2005-09-10 1:48 ` David Brownell
2005-09-11 9:02 ` Mark Underwood
2005-09-15 1:20 ` David Brownell
2005-09-09 17:40 ` Grant Likely [this message]
2005-09-09 19:23 ` Mark Underwood
2005-09-09 20:48 ` David Brownell
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=528646bc0509091040364ae7d4@mail.gmail.com \
--to=glikely@gmail.com \
--cc=basicmark@yahoo.com \
--cc=david-b@pacbell.net \
--cc=dpervushin@ru.mvista.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