linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linuxppc-dev@ozlabs.org, Gary Jennejohn <garyj@denx.de>
Subject: Re: [PATCH 2/4] [OF] spi_of: add support for dedicated SPI constructors
Date: Wed, 21 May 2008 20:10:39 +0400	[thread overview]
Message-ID: <20080521161039.GA9050@polina.dev.rtsoft.ru> (raw)
In-Reply-To: <Pine.LNX.4.64.0805211754300.5386@axis700.grange>

On Wed, May 21, 2008 at 05:56:33PM +0200, Guennadi Liakhovetski wrote:
> On Wed, 21 May 2008, Anton Vorontsov wrote:
> 
> > Dedicated (usually the ones that need to fill platform data) constructors
> > will create board info, so SPI core will probe them as normal SPI devices.
> > 
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > ---
> >  drivers/spi/spi_of.c       |   67 ++++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/spi/spi_of.h |    5 +++
> >  2 files changed, 72 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/spi/spi_of.c b/drivers/spi/spi_of.c
> > index b5ae434..2e1a11f 100644
> > --- a/drivers/spi/spi_of.c
> > +++ b/drivers/spi/spi_of.c
> > @@ -11,6 +11,66 @@
> >  #include <linux/spi/spi.h>
> >  #include <linux/spi/spi_of.h>
> >  
> > +/*
> > + * Caller have no idea who is master, i.e. this function does not
> > + * accept pointer to the master, instead we use board infos.
> > + */
> > +int of_spi_device_probe_common(struct device_node *np,
> > +			       struct spi_board_info *spi_binfo,
> > +			       const char *modalias)
> > +{
> 
> Hm, I might well misunderstand something here, but it looks to me like you 
> are again trying to use both OF _and_ platform (spi_board_info) bindings 
> for your SPI setup?

Yes, you didn't misunderstand. ;-)

> And this is exactly what we are trying to avoid in 
> Grant's series of patches...

I didn't find other way... The show stopper is "master" argument,
drivers don't know about masters (and should not, since if they should,
then this implies that masters should be registered prior to devices,
and that complicates everything).

What is the problem with board infos, btw? I missed that part. Board
infos are good because:

1. This is how things work in real life: SPI isn't probe-able bus, so
   platform code (or board code, or OF helpers) should explicitly probe
   and create devices.
2. With platform infos we're probing in a Linux usual way (e.g.
   master's .bus_id + chip_select matching).

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  reply	other threads:[~2008-05-21 16:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 15:41 [RFC/DRAFT] SPI OF bindings, MMC-over-SPI, chip-selects and so on Anton Vorontsov
2008-05-21 15:41 ` [PATCH 1/4] [SPI] spi_mpc83xx: convert to the OF platform driver Anton Vorontsov
2008-05-21 16:50   ` Grant Likely
2008-05-21 17:05     ` Anton Vorontsov
2008-05-21 17:17       ` Grant Likely
2008-05-21 15:41 ` [PATCH 2/4] [OF] spi_of: add support for dedicated SPI constructors Anton Vorontsov
2008-05-21 15:56   ` Guennadi Liakhovetski
2008-05-21 16:10     ` Anton Vorontsov [this message]
2008-05-21 16:24       ` Guennadi Liakhovetski
2008-05-21 16:48         ` Anton Vorontsov
2008-05-21 17:05           ` Grant Likely
2008-05-21 17:51             ` Guennadi Liakhovetski
2008-05-21 19:06               ` Grant Likely
2008-05-21 19:20                 ` Guennadi Liakhovetski
2008-05-21 19:53                   ` Grant Likely
2008-05-21 20:00                     ` Guennadi Liakhovetski
2008-05-21 20:07                       ` Grant Likely
2008-05-21 17:30   ` Grant Likely
2008-05-21 15:41 ` [PATCH 3/4] [OF] MMC-over-SPI OF constructor Anton Vorontsov
2008-05-21 15:41 ` [PATCH 4/4] [POWERPC] 86xx: mpc8610_hpcd: support for MMC-over-SPI and PIXIS' GPIOs Anton Vorontsov
2008-05-21 15:54 ` [RFC/DRAFT] SPI OF bindings, MMC-over-SPI, chip-selects and so on Guennadi Liakhovetski
2008-05-21 16:01   ` Anton Vorontsov
2008-05-21 16:51 ` Grant Likely
2008-05-21 17:32 ` 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=20080521161039.GA9050@polina.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=garyj@denx.de \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).