aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/omap_device.c
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2012-02-20 12:43:29 -0500
committerTony Lindgren <tony@atomide.com>2012-02-20 13:00:39 -0500
commit993e4fbd7822cdf874fcf9f1b054a323d67ccf97 (patch)
treeeff8a45e979d7cf35ea332ea2b736de2f70218b0 /arch/arm/plat-omap/omap_device.c
parentd517110243130965e2803cc2373d434bdaf6dafb (diff)
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/omap_device.c')
-rw-r--r--arch/arm/plat-omap/omap_device.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index e8d98693d2d..f72fafc9e9f 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -97,14 +97,7 @@
97#define USE_WAKEUP_LAT 0 97#define USE_WAKEUP_LAT 0
98#define IGNORE_WAKEUP_LAT 1 98#define IGNORE_WAKEUP_LAT 1
99 99
100static int omap_device_register(struct platform_device *pdev);
101static int omap_early_device_register(struct platform_device *pdev); 100static int omap_early_device_register(struct platform_device *pdev);
102static struct omap_device *omap_device_alloc(struct platform_device *pdev,
103 struct omap_hwmod **ohs, int oh_cnt,
104 struct omap_device_pm_latency *pm_lats,
105 int pm_lats_cnt);
106static void omap_device_delete(struct omap_device *od);
107
108 101
109static struct omap_device_pm_latency omap_default_latency[] = { 102static struct omap_device_pm_latency omap_default_latency[] = {
110 { 103 {
@@ -509,7 +502,7 @@ static int omap_device_fill_resources(struct omap_device *od,
509 * 502 *
510 * Returns an struct omap_device pointer or ERR_PTR() on error; 503 * Returns an struct omap_device pointer or ERR_PTR() on error;
511 */ 504 */
512static struct omap_device *omap_device_alloc(struct platform_device *pdev, 505struct omap_device *omap_device_alloc(struct platform_device *pdev,
513 struct omap_hwmod **ohs, int oh_cnt, 506 struct omap_hwmod **ohs, int oh_cnt,
514 struct omap_device_pm_latency *pm_lats, 507 struct omap_device_pm_latency *pm_lats,
515 int pm_lats_cnt) 508 int pm_lats_cnt)
@@ -591,7 +584,7 @@ oda_exit1:
591 return ERR_PTR(ret); 584 return ERR_PTR(ret);
592} 585}
593 586
594static void omap_device_delete(struct omap_device *od) 587void omap_device_delete(struct omap_device *od)
595{ 588{
596 if (!od) 589 if (!od)
597 return; 590 return;
@@ -817,7 +810,7 @@ static struct dev_pm_domain omap_device_pm_domain = {
817 * platform_device_register() on the underlying platform_device. 810 * platform_device_register() on the underlying platform_device.
818 * Returns the return value of platform_device_register(). 811 * Returns the return value of platform_device_register().
819 */ 812 */
820static int omap_device_register(struct platform_device *pdev) 813int omap_device_register(struct platform_device *pdev)
821{ 814{
822 pr_debug("omap_device: %s: registering\n", pdev->name); 815 pr_debug("omap_device: %s: registering\n", pdev->name);
823 816