diff options
author | Suman Anna <s-anna@ti.com> | 2012-06-12 19:18:52 -0500 |
---|---|---|
committer | Xavier Boudet <x-boudet@ti.com> | 2012-07-10 17:26:52 +0200 |
commit | 1454cf74bb70ab02c15aaef85dabea32bea5d13e (patch) | |
tree | 970e75f94e5923ea7213ae66c880ac5a5b2c6d05 | |
parent | 97c984656413db77e95fb3b1e43d2628d2bdced1 (diff) |
arm: omap: devices: add support for registering rprm regulators
The regulators are usually defined in the board file, and support
has been added to publish the regulator data relevant to the
remote processor resource manager. This data would be used by the
generic rpmsg resmgr driver layer to request/release and control
a regulator on behalf of the remote processor through the rpmsg
resmgr framework.
Change-Id: I901b6c215d9307ea4a28ff191dcf1dec76233686
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 24 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/rpmsg_resmgr.h | 4 |
2 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 86a38051415e..f780393fcf37 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -11,6 +11,7 @@ #include <linux/gpio.h> #include <linux/kernel.h> #include <linux/init.h> +#include <linux/export.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/clk.h> @@ -38,6 +39,8 @@ #include <plat/omap_hwmod.h> #include <plat/omap_device.h> #include <plat/omap4-keypad.h> +#include <plat/rpmsg_resmgr.h> +#include <linux/mfd/omap_control.h> #if defined(CONFIG_SND_OMAP_SOC_ABE_DSP) || \ defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) @@ -864,6 +867,27 @@ void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) #endif +static struct omap_rprm_regulator *omap_regulators; +static u32 omap_regulators_cnt; +void __init omap_rprm_regulator_init(struct omap_rprm_regulator *regulators, + u32 regulator_cnt) +{ + if (!regulator_cnt) + return; + + omap_regulators = regulators; + omap_regulators_cnt = regulator_cnt; +} + +u32 omap_rprm_get_regulators(struct omap_rprm_regulator **regulators) +{ + if (omap_regulators_cnt) + *regulators = omap_regulators; + + return omap_regulators_cnt; +} +EXPORT_SYMBOL(omap_rprm_get_regulators); + static __init void omap_init_dev(char *name) { struct platform_device *pd; diff --git a/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h b/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h index 5cce8548ad96..7eb62fb4c9ce 100644 --- a/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h +++ b/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h @@ -73,4 +73,8 @@ struct omap_rprm_pdata { struct omap_rprm_ops *ops; }; +void __init omap_rprm_regulator_init(struct omap_rprm_regulator *regulators, + u32 regulator_cnt); +u32 omap_rprm_get_regulators(struct omap_rprm_regulator **regulators); + #endif /* _PLAT_RPMSG_RESMGR_H */ |