aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/omap_device.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-07-26 18:34:33 -0400
committerPaul Walmsley <paul@pwsan.com>2010-07-26 18:34:33 -0400
commitdb2a60bf2527209b42e6f512d5892089a835ceaa (patch)
tree98436f3f27ada90324110c6fd3e3256162ec7b34 /arch/arm/plat-omap/omap_device.c
parent08072acf3a23febd1b676f1d908c6c0b9ddf167c (diff)
OMAP: hwmod/device: add omap_{device,hwmod}_get_mpu_rt_va
Add omap_device_get_mpu_rt_va(). This is intended to be used by device drivers (currently, via a struct platform_data function pointer) to retrieve their corresponding device's virtual base address that the MPU should use to access the device. This is needed because the omap_hwmod code does its own ioremap(), in order to gain access to the module's OCP_SYSCONFIG register. Add omap_hwmod_get_mpu_rt_va(). omap_device_get_mpu_rt_va() calls this function to do the real work. While here, rename struct omap_hwmod._rt_va to struct omap_hwmod._mpu_rt_va, to reinforce that it refers to the MPU's register target virtual address base (as opposed to, for example, the L3's). In the future, this belongs as a function in an omap_bus, so it is not necessary to call this through a platform_data function pointer. The use-case for this function was originally presented by Santosh Shilimkar <santosh.shilimkar@ti.com>. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/omap_device.c')
-rw-r--r--arch/arm/plat-omap/omap_device.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index f9dec0d32fa4..dee4629b7b47 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -655,6 +655,25 @@ struct powerdomain *omap_device_get_pwrdm(struct omap_device *od)
655 return omap_hwmod_get_pwrdm(od->hwmods[0]); 655 return omap_hwmod_get_pwrdm(od->hwmods[0]);
656} 656}
657 657
658/**
659 * omap_device_get_mpu_rt_va - return the MPU's virtual addr for the hwmod base
660 * @od: struct omap_device *
661 *
662 * Return the MPU's virtual address for the base of the hwmod, from
663 * the ioremap() that the hwmod code does. Only valid if there is one
664 * hwmod associated with this device. Returns NULL if there are zero
665 * or more than one hwmods associated with this omap_device;
666 * otherwise, passes along the return value from
667 * omap_hwmod_get_mpu_rt_va().
668 */
669void __iomem *omap_device_get_rt_va(struct omap_device *od)
670{
671 if (od->hwmods_cnt != 1)
672 return NULL;
673
674 return omap_hwmod_get_mpu_rt_va(od->hwmods[0]);
675}
676
658/* 677/*
659 * Public functions intended for use in omap_device_pm_latency 678 * Public functions intended for use in omap_device_pm_latency
660 * .activate_func and .deactivate_func function pointers 679 * .activate_func and .deactivate_func function pointers