diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2012-02-20 09:43:29 -0800 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-02-20 10:00:39 -0800 |
commit | 993e4fbd7822cdf874fcf9f1b054a323d67ccf97 (patch) | |
tree | eff8a45e979d7cf35ea332ea2b736de2f70218b0 /arch/arm/plat-omap/include/plat/omap_device.h | |
parent | d517110243130965e2803cc2373d434bdaf6dafb (diff) | |
download | lwn-993e4fbd7822cdf874fcf9f1b054a323d67ccf97.tar.gz lwn-993e4fbd7822cdf874fcf9f1b054a323d67ccf97.zip |
ARM: OMAP: omap_device: Expose omap_device_{alloc, delete, register}
Expose omap_device_{alloc, delete, register} so we can use them outside
of omap_device.c.
This approach allows users, which need to manipulate an archdata member
of a device before it is registered, to do so. This is also useful
for users who have their devices created very early so they can be used
at ->reserve() time to reserve CMA memory.
The immediate use case for this is to set the private iommu archdata
member, which binds a device to its associated iommu controller.
This way, generic code will be able to attach omap devices to their
iommus, without calling any omap-specific API.
With this in hand, we can further clean the existing mainline OMAP iommu
driver and its mainline users, and focus on generic IOMMU approaches
for future users (rpmsg/remoteproc and the upcoming generic DMA API).
This patch is still considered an interim solution until DT fully materializes
for omap; at that point, this functionality will be removed as DT will
take care of creating the devices and configuring them correctly.
Tested on OMAP4 with a generic rpmsg/remoteproc that doesn't use any
omap-specific IOMMU API anymore.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/include/plat/omap_device.h')
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 51423d2727a5..05f7615b61f0 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -100,6 +100,13 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, struct omap_device_pm_latency *pm_lats, int pm_lats_cnt, int is_early_device); +struct omap_device *omap_device_alloc(struct platform_device *pdev, + struct omap_hwmod **ohs, int oh_cnt, + struct omap_device_pm_latency *pm_lats, + int pm_lats_cnt); +void omap_device_delete(struct omap_device *od); +int omap_device_register(struct platform_device *pdev); + void __iomem *omap_device_get_rt_va(struct omap_device *od); struct device *omap_device_get_by_hwmod_name(const char *oh_name); |