linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Juergen Beisert <jbe@pengutronix.de>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: How to add platform specific data to a of_device
Date: Sun, 15 Jul 2007 06:48:53 +1000	[thread overview]
Message-ID: <1184446133.6059.284.camel@localhost.localdomain> (raw)
In-Reply-To: <200707141831.04107.jbe@pengutronix.de>

On Sat, 2007-07-14 at 18:31 +0200, Juergen Beisert wrote:
> Hi,
> 
> I'm trying to use the drivers/spi/mpc52xx_psc_spi.c as an open firmware device
> (ARCH=powerpc). This device needs some platform specific data (the devices
> connected to the SPI bus and how to drive the chipselects to these devices).
> 
> The driver itself get a "struct of_device *op" in his probe function and
> does something like this:
> 
> struct fsl_spi_platform_data *pdata = op->dev.platform_data;
> 
> My question is: How is the correct way to bring the platform specific data
> into this device structure? Is there a way to do it in the OFTree (dts file)?

Your approach would work I suppose.... though it's a bit ugly. I've long
considered removing platform_data from struct device, and make it part
strictly of platform device...

I'm not sure what you actually need here... if it's to know what your
child devices are, you can always walk the device-tree, though for most
things, it would be the child devices themslves who would call into your
SPI driver with whatever identification they retreived from there.

Ben.

  reply	other threads:[~2007-07-14 20:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-14 16:31 How to add platform specific data to a of_device Juergen Beisert
2007-07-14 20:48 ` Benjamin Herrenschmidt [this message]
2007-07-15  8:33   ` Juergen Beisert
2007-07-15  8:57     ` Benjamin Herrenschmidt
2007-07-16 16:13       ` Segher Boessenkool
2007-07-16  6:51   ` Robert Schwebel
2007-07-16  7:09     ` Benjamin Herrenschmidt
2007-07-16  7:19       ` Robert Schwebel
2007-07-16  7:29         ` Benjamin Herrenschmidt
2007-07-16 16:47         ` Segher Boessenkool
2007-07-16 16:28       ` Segher Boessenkool
2007-07-16  7:40     ` Michael Ellerman
2007-07-16 16:16     ` Segher Boessenkool

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=1184446133.6059.284.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=jbe@pengutronix.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).