From 35e75d51d235b5bcfb78c8401c906708f7064cb6 Mon Sep 17 00:00:00 2001 From: Vaibhav Bedia Date: Thu, 17 Nov 2011 21:06:45 +0530 Subject: [PATCH] OMAP: voltage: add a hook for normal regulator calls TI processors in TI81x and AM33x family work with PMICs like TPS65910/1 which are not part of the TWL series. These processors also do not have a voltage controller/processor module. In order to invoke the normal regulator calls from the voltage layer the following changes are done to struct voltagedomain - Add a flag use_regulator for the SoC voltagedomain code to indicate its intention of using a PMIC which is not controlled by VC/VP - Add a regulator_init callback which the platform code can utilise for any custom init sequence before making use of the regulator. Platform code is also expected to set the voltdm->scale function in the init callback Signed-off-by: Ravikumar Kattekola Signed-off-by: Vaibhav Bedia --- arch/arm/mach-omap2/voltage.c | 5 +++++ arch/arm/plat-omap/include/plat/voltage.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index c2a5a72..e33bbc9 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -278,6 +278,11 @@ int __init omap_voltage_late_init(void) voltdm->scale = omap_vp_forceupdate_scale; omap_vp_init(voltdm); } + + if (voltdm->use_regulator) { + if(voltdm->regulator_init) + voltdm->regulator_init(voltdm); + } } return 0; diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/arch/arm/plat-omap/include/plat/voltage.h index f309433..9a77489 100644 --- a/arch/arm/plat-omap/include/plat/voltage.h +++ b/arch/arm/plat-omap/include/plat/voltage.h @@ -92,6 +92,10 @@ struct voltagedomain { struct omap_volt_data *volt_data; struct omap_vdd_info *vdd; struct dentry *debug_dir; + + bool use_regulator; + struct regulator *regulator; + int (*regulator_init) (struct voltagedomain *voltdm); }; /** -- 1.9.1