All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Thomas Abraham <thomas.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-discuss
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
Subject: Re: Moving platform_data contents to device tree
Date: Fri, 11 Feb 2011 09:45:07 -0600	[thread overview]
Message-ID: <4D555983.7090102@gmail.com> (raw)
In-Reply-To: <AANLkTikGa9dkM5DMJrM=RDs9twMY=uE21u5NmOv-=dPG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Thomas,

On 02/10/2011 09:29 PM, Thomas Abraham wrote:
> Hi,
>
> I am currently adding device tree support for Samsung's S5PV310
> processor. I have a question about handling platform_data when adding
> device tree support in drivers, specifically about the sdhci-s3c
> driver.
>
> The platform data that is passed to the sdhci-s3c driver is defined in
> file arch/arm/plat-samsung/plat/sdhci.h, struct s3c_sdhci_platdata. In
> this structure, there are some function pointers that are passed to
> the driver. These function pointers are setup by the platform code in
> arch/arm/plat-samsung. But when platform devices are created from the
> device tree, how would such function pointers be passed to the driver?
>
> Any suggestions on the approach to handle the platform_data
> information when moving to device tree would be very helpful.
>
As suggested by Grant, you can use bus notifiers. Here is an example:

arch/powerpc/platforms/512x/pdm360ng.c

Pure data (flags, quirks, chip select assignments, etc.) should 
ultimately go into the device tree.

For board specific functions, use the bus notifiers. For SoC functions, 
put them in the driver and use the OF match table data pointer. See 
sdhci-of-core.c for an example.

Rob

  parent reply	other threads:[~2011-02-11 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11  3:29 Moving platform_data contents to device tree Thomas Abraham
     [not found] ` <AANLkTikGa9dkM5DMJrM=RDs9twMY=uE21u5NmOv-=dPG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-11 15:45   ` Rob Herring [this message]
2011-02-11 16:01     ` 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=4D555983.7090102@gmail.com \
    --to=robherring2-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=thomas.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.