From: Mark Underwood <basicmark@yahoo.com>
To: David Brownell <david-b@pacbell.net>, linux-kernel@vger.kernel.org
Cc: dpervushin@ru.mvista.com
Subject: Re: SPI redux ... driver model support
Date: Wed, 7 Sep 2005 19:38:43 +0100 (BST) [thread overview]
Message-ID: <20050907183843.14745.qmail@web30307.mail.mud.yahoo.com> (raw)
In-Reply-To: <20050906215325.813B1BF3C8@adsl-69-107-32-110.dsl.pltn13.pacbell.net>
--- David Brownell <david-b@pacbell.net> wrote:
> > With my subsystem that would look like:
> >
> > static const struct spi_cs_table
> > platform_spi1_cs_table[] = {
> > {
> > .name = "touchscreen",
> > .cs_no = 1,
> > .platform_data = NULL,
> > .flags = SPI_CS_IDLE_HIGH,
> > .cs_data = 0,
> > },
> > {
> > .name = "flash",
> > .cs_no = 3,
> > .platform_data = NULL,
> > .flags = SPI_CS_IDLE_HIGH,
> > .cs_data = 0,
> > },
> > };
>
> The problem scenario was that only one configuration
> is valid at a time ... it would have been clearer if
> both the add-on boards used CS1, so that device
> would
> be either ads7864 _or_ at25640a, but not both.
>
>
>
> > As far as I can see most SPI devices have fixed
> > wirering to an adapter as SPI is not really a
> hotplug
> > bus.
>
> That wiring can be through an expansion connector
> though, which
> is what I meant when I wrote that it's "vaguely
> hotplug-ish".
> Example, the mainboard could have some SPI devices
> hard-wired,
> on CS0 and CS2, while each different plugin board
> might add very
> different devices on CS1 and/or CS3.
>
> In any case, you were the one who also wanted to
> ship sample USB
> peripherals that acted as adapters to various SPI
> chips... so that
> bus adapters would really need to hotplug! :)
>
I see several posabiltiys of how SPI devices could be
connected to an adapter.
1) All SPI devices are hardwired to the adapter. I
think this would be the most common. In this case you
would register a cs table as part of the platform data
of the SPI adapter like in the example platform in my
patch. Note: this is even the case with a PCI or usb
based device as it is the adapter that is hotpluged
and not the SPI devices on that device.
2) Some SPI devices are hardwired and some are
removable. In this case these the hardwired ones would
be put in the cs table and the other SPI devices would
be registered by calling spi_device_register. I would
add a call in my core layer to which you could pass
the bus_id and it would pass back the adapters pointer
to put in the spi_device structure.
3) All SPI devices are removable. An empty cs table
would be used and SPI devices would be registered by
calling spi_device_register.
>
> > The subsystem does allow you to add extra devices
> that
> > aren't in the cs table if you want by calling
> > spi_device_register in which case you have to
> setup
> > the spi_device with the correct information.
>
> Right, but as I had explained, the scenario is that
> the
> SPI devices are on some easily-swapped add-on card.
> That's a common physical arrangement for small
> embeddable
> boards, because it takes so few wires per device.
>
> Swapping those SPI connectors shouldn't involve
> changing
> the declaration of the controller on the mainboard
> ...
Your not when you use spi_device_register /
spi_device_unregister. You can register an adapter
with an empty cs table if you don't have any hardwired
SPI devices. When you plug a card in you use
spi_device_register to add that device to the system
and when you remove the card you call
spi_device_unregister. You can then do the same for a
different card and at no time have you changed the
declaration of the controller.
>
>
> > > One reason I posted this driver-model-only patch
> was
> > > to highlight how
> > > minimal an SPI core can be if it reuses the
> driver
> > > model core. I'm
> > > not a fan of much "mid-layer" infrastructure in
> > > driver stacks.
> > >
> >
> > This is what my SPI core tries to do. I would like
> to
> > make at 'as small as possible and no smaller'
>
> I'll post a refresh of my patch that seems to me to
> be
> a much better match for those goals. The refresh
> includes
> some tweaks based on what you sent, but it's still
> just
> one KByte of overhead in the target ROM. :)
OK. I will post an updated version of my SPI subsystem
within the next few days with the transfer stuff added
and maybe the interrupt and GPO abstraction as well.
I haven't seen any replies to my SPI patch :( did you
reply to it?
Mark
>
> - Dave
>
>
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
next prev parent reply other threads:[~2005-09-07 18:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-30 2:42 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 [this message]
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
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=20050907183843.14745.qmail@web30307.mail.mud.yahoo.com \
--to=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
all inboxes | Powered by JetHome®