Moving platform_data contents to device tree
Rob Herring
robherring2 at gmail.com
Sat Feb 12 02:45:07 EST 2011
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
More information about the devicetree-discuss
mailing list