diff options
author | Suman Anna <s-anna@ti.com> | 2012-06-12 13:57:00 -0500 |
---|---|---|
committer | Guillaume Aubertin <g-aubertin@ti.com> | 2012-06-26 12:20:37 +0200 |
commit | 105761d8d0123a396a28740f6ee4a219c690a25c (patch) | |
tree | dbe8ffa62ae93e7f6ba202836e38cada0268b10f | |
parent | 63ef939f998077d548f08954b57b416a91d67e86 (diff) |
omap: rpmsg_resmgr: add support for regulators lookup
Support has been added to the machine-specific rpmsg resmgr layer
to retrieve and store the regulator data (defined in the board file).
A lookup_regulator op function is added to the mach-ops to retrieve
this data by the generic omap rpmsg resmgr layer based on the
regulator id.
Change-Id: I715e1b3c9f53a85bc785fcb42dfd8a7ce24d6131
Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/rpmsg_resmgr.c | 15 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/rpmsg_resmgr.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/rpmsg_resmgr.c b/arch/arm/mach-omap2/rpmsg_resmgr.c index 49ed090088e7..64e2e79bce36 100644 --- a/arch/arm/mach-omap2/rpmsg_resmgr.c +++ b/arch/arm/mach-omap2/rpmsg_resmgr.c @@ -45,10 +45,25 @@ static int omap2_rprm_device_scale(struct device *rdev, struct device *tdev, #define omap2_rprm_device_scale NULL #endif +static struct omap_rprm_regulator *omap2_rprm_lookup_regulator(u32 reg_id) +{ + static struct omap_rprm_regulator *regulators; + static u32 regulators_cnt; + + if (!regulators) + regulators_cnt = omap_rprm_get_regulators(®ulators); + + if (reg_id-- > regulators_cnt) + return NULL; + + return ®ulators[reg_id]; +} + static struct omap_rprm_ops omap2_rprm_ops = { .set_min_bus_tput = omap2_rprm_set_min_bus_tput, // .set_max_dev_wakeup_lat = omap2_rprm_set_max_dev_wakeup_lat, .device_scale = omap2_rprm_device_scale, + .lookup_regulator = omap2_rprm_lookup_regulator, }; static struct omap_rprm_pdata omap2_rprm_data = { diff --git a/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h b/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h index 40711bc70462..3cd83d1168df 100644 --- a/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h +++ b/arch/arm/plat-omap/include/plat/rpmsg_resmgr.h @@ -25,6 +25,8 @@ * @set_max_dev_wakeup_lat: set a latency constraint to @tdev * @device_scale: scale @tdev, it can be used to set a frequency * constraint in @tdev + * @lookup_regulator: return the regulator identified by the @reg_id + * */ struct omap_rprm_ops { int (*set_min_bus_tput)(struct device *rdev, struct device *tdev, @@ -33,6 +35,7 @@ struct omap_rprm_ops { unsigned long val); int (*device_scale)(struct device *rdev, struct device *tdev, unsigned long val); + struct omap_rprm_regulator *(*lookup_regulator)(u32 reg_id); }; /* |