linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Milton Miller <miltonm@bga.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: SPI devices and OF
Date: Thu, 5 Apr 2007 21:11:45 +0200	[thread overview]
Message-ID: <20070405191145.GA20139@himalia.labnet.pengutronix.de> (raw)
In-Reply-To: <030212e9acd638e71b2f50aa39fb90ed@bga.com>

On Thu, Apr 05, 2007 at 09:44:13AM -0500, Milton Miller wrote:
> 
> 
> ok, so what is the problem with the platform data?

Not a problem of programming technique but a problem of where to
actually get the information in the platform from. device tree or
board setup code?

> You kzalloc the
> data structure that the device needs, fill it in, and fill out
> the pointer in the auto _info variable that gets copied by
> register_new_device.

My point is that we have two possibilities to handle spi devices. a) We
put the information about all devices connected to a spi bus into the
device tree in which case we must also put the data described in the
platform_data (e.g. the mentioned page_size for at25 eeproms) into the
tree. b) would be to put only the spi masters into the tree (well they
already are).

It seems b) is the prefered way. If I understand Ben correctly I can
then put some proprietary tag into the tree to differentiate between
different spi controllers so that the board code knows which spi
controller is which. So my tree could look like:

spi@f00 {
	device_type = "spi";
	compatible = "mpc5200b-spi\0mpc5200-spi";
	reg = <f00 20>;
	interrupts = <2 d 0 2 e 0>;
	interrupt-parent = <500>;
	identifier = <0>;
}

spi@xxx {
	device_type = "spi";
	...
	identifier = <1>;
}

I can then use the board code to populate the spi devices depending on
the identifier. Perhaps there is a better name instead of 'identifier'?

Sascha

  reply	other threads:[~2007-04-05 19:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04 11:09 SPI devices and OF Sascha Hauer
2007-04-04 11:51 ` Vitaly Wool
2007-04-04 16:34   ` Kumar Gala
2007-04-04 17:03     ` Arnd Bergmann
2007-04-04 17:12       ` Kumar Gala
2007-04-05  7:32         ` Benjamin Herrenschmidt
2007-04-05 15:00           ` Milton Miller
2007-04-05  8:33     ` Sascha Hauer
2007-04-04 15:57 ` Milton Miller
2007-04-05  8:50   ` Sascha Hauer
2007-04-05 14:44     ` Milton Miller
2007-04-05 19:11       ` Sascha Hauer [this message]
2007-04-05 19:52         ` Arnd Bergmann

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=20070405191145.GA20139@himalia.labnet.pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.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).