ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs
Subsystems (5)
Nishanth Menon
maintainercover ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs
smartreflex.c now resides in drivers/power/avs directory, but class driver is in mach-omap2. High time we move it to drivers/power/avs.
This series *does not* try to fix VP/VC to be voltage regulator OR introduce a new OMAP voltage regulator series. Instead, it purely tries to do the minimal changes needed to move code to drivers/power/avs as a start.
Baseline: k.org v3.7-rc4
Testing: Platform: beagle XM C1 (3730)
while [ 1 ]
do
echo -n "0" >/sys/kernel/debug/smartreflex/smartreflex_core/autocomp date
echo -n "1" >/sys/kernel/debug/smartreflex/smartreflex_core/autocomp done
Screen capture after the series(RFC): on inductor L5 (VDD2 - core):
https://plus.google.com/photos/112464029509057661457/albums/5715034179943520193/5802619719180530114
RFC: http://marc.info/?t=135102876700003&r=1&w=2
Changes since RFC:
- added Jean's Acked-by
- review comments addressed
Nishanth Menon (6):
PM / AVS / OMAP: move Kconfig definition of smartreflex to avs
directory
ARM: OMAP: voltage: remove duplicate header definitions
ARM: OMAP: voltage: move voltdm_reset to platform_data header
ARM: OMAP: SmartReflex: provide SoC integration API for VP
ARM: OMAP: SmartReflex: use pr_warn instead of pr_warning PM / AVS / OMAP: move Smartreflex-class3 driver to power/avs
arch/arm/mach-omap2/Makefile | 1 -
arch/arm/mach-omap2/sr_device.c | 5 ++++
arch/arm/mach-omap2/voltage.h | 4 ---
arch/arm/plat-omap/Kconfig | 31 --------------------
drivers/power/avs/Kconfig | 31 ++++++++++++++++++++
drivers/power/avs/Makefile | 1 +
.../power/avs}/smartreflex-class3.c | 20 +++++++++----
drivers/power/avs/smartreflex.c | 2 ++
include/linux/platform_data/voltage-omap.h | 1 +
include/linux/power/smartreflex.h | 18 ++++++++++++
10 files changed, 73 insertions(+), 41 deletions(-)
rename {arch/arm/mach-omap2 => drivers/power/avs}/smartreflex-class3.c (75%)Regards,
Nishanth Menon
Signature · 1 line
1.7.9.5
Nishanth Menon
maintainercover ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs
smartreflex.c now resides in drivers/power/avs directory, but class driver is in mach-omap2. High time we move it to drivers/power/avs.
This series *does not* try to fix VP/VC to be voltage regulator OR introduce a new OMAP voltage regulator series. Instead, it purely tries to do the minimal changes needed to move code to drivers/power/avs as a start.
Baseline: k.org v3.7-rc4
Testing: Platform: beagle XM C1 (3730)
while [ 1 ]
do
echo -n "0" >/sys/kernel/debug/smartreflex/smartreflex_core/autocomp date
echo -n "1" >/sys/kernel/debug/smartreflex/smartreflex_core/autocomp done
Screen capture after the series(RFC): on inductor L5 (VDD2 - core):
https://plus.google.com/photos/112464029509057661457/albums/5715034179943520193/5802619719180530114
RFC: http://marc.info/?t=135102876700003&r=1&w=2
Nishanth Menon (6):
PM / AVS / OMAP: move Kconfig definition of smartreflex to avs
directory
ARM: OMAP: voltage: remove duplicate header definitions
ARM: OMAP: voltage: move voltdm_reset to platform_data header
ARM: OMAP: SmartReflex: provide SoC integration API for VP
ARM: OMAP: SmartReflex: use pr_warn instead of pr_warning PM / AVS / OMAP: move Smartreflex-class3 driver to power/avs
arch/arm/mach-omap2/Makefile | 1 -
arch/arm/mach-omap2/sr_device.c | 5 ++++
arch/arm/mach-omap2/voltage.h | 4 ---
arch/arm/plat-omap/Kconfig | 31 --------------------
drivers/power/avs/Kconfig | 31 ++++++++++++++++++++
drivers/power/avs/Makefile | 1 +
.../power/avs}/smartreflex-class3.c | 20 +++++++++----
drivers/power/avs/smartreflex.c | 2 ++
include/linux/platform_data/voltage-omap.h | 1 +
include/linux/power/smartreflex.h | 18 ++++++++++++
10 files changed, 73 insertions(+), 41 deletions(-)
rename {arch/arm/mach-omap2 => drivers/power/avs}/smartreflex-class3.c (75%)Regards,
Nishanth Menon
Signature · 1 line
1.7.9.5
Nishanth Menon
maintainerPATCH 1/6 PM / AVS / OMAP: move Kconfig definition of smartreflex to avs directory
In reply to Nishanth MenonDon't see why the source should be in drivers/power/avs, but not config option
--- arch/arm/plat-omap/Kconfig | 22 ---------------------- drivers/power/avs/Kconfig | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-)
arch/arm/plat-omap/Kconfig +0 -22
@@ -47,28 +47,6 @@ config OMAP_DEBUG_LEDS depends on OMAP_DEBUG_DEVICES select LEDS_CLASS -config POWER_AVS_OMAP - bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" - depends on POWER_AVS && (ARCH_OMAP3 || ARCH_OMAP4) && PM - select POWER_SUPPLY - help - Say Y to enable AVS(Adaptive Voltage Scaling) - support on OMAP containing the version 1 or - version 2 of the SmartReflex IP. - V1 is the 65nm version used in OMAP3430. - V2 is the update for the 45nm version of the IP used in OMAP3630 - and OMAP4430 - - Please note, that by default SmartReflex is only - initialized and not enabled. To enable the automatic voltage - compensation for vdd mpu and vdd core from user space, - user must write 1 to - /debug/smartreflex/sr_<X>/autocomp, - where X is mpu_iva or core for OMAP3. - Optionally autocompensation can be enabled in the kernel - by default during system init via the enable_on_init flag - which an be passed as platform data to the smartreflex driver. - config POWER_AVS_OMAP_CLASS3 bool "Class 3 mode of Smartreflex Implementation" depends on POWER_AVS_OMAP && TWL4030_CORE
drivers/power/avs/Kconfig +22 -0
@@ -10,3 +10,25 @@ menuconfig POWER_AVS AVS is also called SmartReflex on OMAP devices. Say Y here to enable Adaptive Voltage Scaling class support. + +config POWER_AVS_OMAP + bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" + depends on POWER_AVS && (ARCH_OMAP3 || ARCH_OMAP4) && PM + select POWER_SUPPLY + help + Say Y to enable AVS(Adaptive Voltage Scaling) + support on OMAP containing the version 1 or + version 2 of the SmartReflex IP. + V1 is the 65nm version used in OMAP3430. + V2 is the update for the 45nm version of the IP used in OMAP3630 + and OMAP4430 + + Please note, that by default SmartReflex is only + initialized and not enabled. To enable the automatic voltage + compensation for vdd mpu and vdd core from user space, + user must write 1 to + /debug/smartreflex/sr_<X>/autocomp, + where X is mpu_iva or core for OMAP3. + Optionally autocompensation can be enabled in the kernel + by default during system init via the enable_on_init flag + which an be passed as platform data to the smartreflex driver.
Signature · 1 line
1.7.9.5
Nishanth Menon
maintainerPATCH 2/6 ARM: OMAP: voltage: remove duplicate header definitions
In reply to Nishanth Menonremove duplicate definitions which are already present in linux/platform_data/voltage-omap.h
--- arch/arm/mach-omap2/voltage.h | 3 --- 1 file changed, 3 deletions(-)
arch/arm/mach-omap2/voltage.h +0 -3
@@ -142,7 +142,6 @@ extern void omap3xxx_voltagedomains_init(void);extern void am33xx_voltagedomains_init (void );extern void omap44xx_voltagedomains_init (void ); -struct voltagedomain *voltdm_lookup (const char *name);void voltdm_init (struct voltagedomain **voltdm_list);int voltdm_add_pwrdm (struct voltagedomain *voltdm,struct powerdomain *pwrdm); int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user),
@@ -150,7 +149,5 @@ int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user),int voltdm_for_each_pwrdm (struct voltagedomain *voltdm,int (*fn)(struct voltagedomain *voltdm,struct powerdomain *pwrdm)); -int voltdm_scale (struct voltagedomain *voltdm,unsigned long target_volt);void voltdm_reset (struct voltagedomain *voltdm); -unsigned long voltdm_get_voltage (struct voltagedomain *voltdm);#endif
Signature · 1 line
1.7.9.5
Nishanth Menon
maintainerPATCH 3/6 ARM: OMAP: voltage: move voltdm_reset to platform_data header
In reply to Nishanth MenonMove voltdm_reset to include/linux/platform_data/voltage-omap.h
--- arch/arm/mach-omap2/voltage.h | 1 - include/linux/platform_data/voltage-omap.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/voltage.h +0 -1
@@ -149,5 +149,4 @@ int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user),int voltdm_for_each_pwrdm (struct voltagedomain *voltdm,int (*fn)(struct voltagedomain *voltdm,struct powerdomain *pwrdm)); -void voltdm_reset (struct voltagedomain *voltdm);#endif
include/linux/platform_data/voltage-omap.h +1 -0
@@ -36,4 +36,5 @@ int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt);unsigned long voltdm_get_voltage (struct voltagedomain *voltdm);struct omap_volt_data *omap_voltage_get_voltdata (struct voltagedomain *voltdm,unsigned long volt); +void voltdm_reset (struct voltagedomain *voltdm);#endif
Signature · 1 line
1.7.9.5
Tony Lindgren
maintainerRe: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
Quoted 24 lines · Nishanth Menon
Move
voltdm_resettoinclude/linux/platform_data/voltage-omap.hAcked-by Jean Pihet <[email protected]>Signed-off-by Nishanth Menon <[email protected]>--- arch/arm/mach-omap2/voltage.h | 1 - include/linux/platform_data/voltage-omap.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-omap2/voltage.h +0
-1@@ -149,5 +149,4 @@ int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user),int voltdm_for_each_pwrdm (struct voltagedomain *voltdm,int (*fn)(struct voltagedomain *voltdm,struct powerdomain *pwrdm)); -void voltdm_reset (struct voltagedomain *voltdm);#endif include/linux/platform_data/voltage-omap.h +0
-0
include/linux/platform_data/voltage-omap.h int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); · line 40
Quoted 5 lines
include/linux/platform_data/voltage-omap.h +1
-0@@ -36,4 +36,5 @@ int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt);unsigned long voltdm_get_voltage (struct voltagedomain *voltdm);struct omap_volt_data *omap_voltage_get_voltdata (struct voltagedomain *voltdm,unsigned long volt); +void voltdm_reset (struct voltagedomain *voltdm);#endif
The include/linux/platform_data/voltage-omap.h should only contain pure platform_data, these should internal defines to the driver.
Looks like there are other things there too that's not platform data:
struct voltagedomain *voltdm_lookup(const char *name);
int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
unsigned long volt);
Can you please add a patch fixing that ASAP?
Thanks,
Tony
Nishanth Menon
maintainerRe: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
Quoted 25 lines · Tony Lindgren
Quoted 24 lines · Nishanth Menon
Move
voltdm_resettoinclude/linux/platform_data/voltage-omap.hAcked-by Jean Pihet <[email protected]>Signed-off-by Nishanth Menon <[email protected]>--- arch/arm/mach-omap2/voltage.h | 1 - include/linux/platform_data/voltage-omap.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-omap2/voltage.h +0
-1@@ -149,5 +149,4 @@ int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user),int voltdm_for_each_pwrdm (struct voltagedomain *voltdm,int (*fn)(struct voltagedomain *voltdm,struct powerdomain *pwrdm)); -void voltdm_reset (struct voltagedomain *voltdm);#endif include/linux/platform_data/voltage-omap.h +0
-0@@ -36,4 +36,5 @@ int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt);
Quoted 8 lines
include/linux/platform_data/voltage-omap.h int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); · line 40
Quoted 5 lines
include/linux/platform_data/voltage-omap.h +1
-0unsigned long voltdm_get_voltage (struct voltagedomain *voltdm);struct omap_volt_data *omap_voltage_get_voltdata (struct voltagedomain *voltdm,unsigned long volt); +void voltdm_reset (struct voltagedomain *voltdm);#endif The
include/linux/platform_data/voltage-omap.hshould only contain pureplatform_data, these should internal defines to the driver.
considering the move took place as part of:
commit 2203747c97712975accc5e69bdaf1ad38a691635
(ARM: omap: move platform_data definitions)
I suppose we should clean up the following as well include/linux/platform_data/dsp-omap.h - has function - reserve include/linux/platform_data/mtd-nand-omap2.h - has function -init include/linux/platform_data/mtd-onenand-omap2.h - has function -init include/linux/platform_data/remoteproc-omap.h - has function - reserve
Quoted 10 lines
Looks like there are other things there too that's not platform data:
struct voltagedomain *voltdm_lookup(const char *name);
intvoltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); unsigned longvoltdm_get_voltage(struct voltagedomain *voltdm); structomap_volt_data*omap_voltage_get_voltdata(struct voltagedomain *voltdm,unsigned long volt);Can you please add a patch fixing that ASAP?
Agreed include/linux/platform_data/voltage-omap.h has more functions as well. Considering it did:
rename arch/arm/plat-omap/include/plat/voltage.h => include/linux/platform_data/voltage-omap.h
Where do we move these functions to?
drivers/power/avs/smartreflex.c needs:omap_voltage_get_voltdata
anddrivers/power/avs/smartreflex-class3.c
will need voltdm_reset and voltdm_get_voltage
Signature · 2 lines
Regards, Nishanth Menon
Tony Lindgren
maintainerRe: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
Quoted 17 lines · Nishanth Menon
Quoted 10 lines · Tony Lindgren
Looks like there are other things there too that's not platform data:
struct voltagedomain *voltdm_lookup(const char *name);
intvoltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); unsigned longvoltdm_get_voltage(struct voltagedomain *voltdm); structomap_volt_data*omap_voltage_get_voltdata(struct voltagedomain *voltdm,unsigned long volt);Can you please add a patch fixing that ASAP?
Agreed
include/linux/platform_data/voltage-omap.hhas more functions as well. Considering it did:
renamearch/arm/plat-omap/include/plat/voltage.h=>include/linux/platform_data/voltage-omap.h
Quoted 7 lines
Where do we move these functions to?
drivers/power/avs/smartreflex.cneeds:omap_voltage_get_voltdata
anddrivers/power/avs/smartreflex-class3.c
will needvoltdm_resetandvoltdm_get_voltage
How about something local drivers/power/avs/smartreflex.h?
Regards,
Tony
Nishanth Menon
maintainerRe: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
Quoted 20 lines · Tony Lindgren
Quoted 19 lines · Nishanth Menon
Quoted 10 lines · Tony Lindgren
Looks like there are other things there too that's not platform data:
struct voltagedomain *voltdm_lookup(const char *name);
intvoltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); unsigned longvoltdm_get_voltage(struct voltagedomain *voltdm); structomap_volt_data*omap_voltage_get_voltdata(struct voltagedomain *voltdm,unsigned long volt);Can you please add a patch fixing that ASAP?
Agreed
include/linux/platform_data/voltage-omap.hhas more functions as well. Considering it did:
renamearch/arm/plat-omap/include/plat/voltage.h=>include/linux/platform_data/voltage-omap.hWhere do we move these functions to?
Quoted 7 lines
Quoted 5 lines
drivers/power/avs/smartreflex.cneeds:omap_voltage_get_voltdata
anddrivers/power/avs/smartreflex-class3.c
will needvoltdm_resetandvoltdm_get_voltageHow about something local
drivers/power/avs/smartreflex.h?
These APIs are exposed by voltage layer, not smartreflex :( stuff like voltdm_scale will have to be used by regulator logic eventually, so moving to AVS driver header is probably not right.
Signature · 2 lines
Regards, Nishanth Menon
Tony Lindgren
maintainerRe: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
Quoted 27 lines · Nishanth Menon
Quoted 26 lines · Tony Lindgren
Quoted 24 lines · Nishanth Menon
Quoted 10 lines · Tony Lindgren
Looks like there are other things there too that's not platform data:
struct voltagedomain *voltdm_lookup(const char *name);
intvoltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); unsigned longvoltdm_get_voltage(struct voltagedomain *voltdm); structomap_volt_data*omap_voltage_get_voltdata(struct voltagedomain *voltdm,unsigned long volt);Can you please add a patch fixing that ASAP?
Agreed
include/linux/platform_data/voltage-omap.hhas more functions as well. Considering it did:
renamearch/arm/plat-omap/include/plat/voltage.h=>include/linux/platform_data/voltage-omap.hWhere do we move these functions to?
drivers/power/avs/smartreflex.cneeds:omap_voltage_get_voltdata
anddrivers/power/avs/smartreflex-class3.c
will needvoltdm_resetandvoltdm_get_voltage
Quoted 4 lines
Quoted 1 line
How about something local
drivers/power/avs/smartreflex.h?These APIs are exposed by voltage layer, not smartreflex :( stuff like
voltdm_scalewill have to be used by regulator logic eventually, so moving to AVS driver header is probably not right.
Well ideally you'd have some generic API doing it rather than these omap specifc exported functions.
Meanwhile, I guess you need to find some suitable location for the header file that works for Rafael.
Regards,
Tony
Nishanth Menon
maintainerRe: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
Quoted 33 lines · Tony Lindgren
Quoted 27 lines · Nishanth Menon
Quoted 26 lines · Tony Lindgren
Quoted 24 lines · Nishanth Menon
Quoted 10 lines · Tony Lindgren
Looks like there are other things there too that's not platform data:
struct voltagedomain *voltdm_lookup(const char *name);
intvoltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); unsigned longvoltdm_get_voltage(struct voltagedomain *voltdm); structomap_volt_data*omap_voltage_get_voltdata(struct voltagedomain *voltdm,unsigned long volt);Can you please add a patch fixing that ASAP?
Agreed
include/linux/platform_data/voltage-omap.hhas more functions as well. Considering it did:
renamearch/arm/plat-omap/include/plat/voltage.h=>include/linux/platform_data/voltage-omap.hWhere do we move these functions to?
drivers/power/avs/smartreflex.cneeds:omap_voltage_get_voltdata
anddrivers/power/avs/smartreflex-class3.c
will needvoltdm_resetandvoltdm_get_voltageQuoted 4 lines
Quoted 1 line
How about something local
drivers/power/avs/smartreflex.h?These APIs are exposed by voltage layer, not smartreflex :( stuff like
voltdm_scalewill have to be used by regulator logic eventually, so moving to AVS driver header is probably not right.
Quoted 5 lines
Well ideally you'd have some generic API doing it rather than these omap specifc exported functions.
Meanwhile, I guess you need to find some suitable location for the header file that works for Rafael.
I wonder if including mach/voltage.h is acceptable here? if Kevin could suggest an option as well, it will be great.
Signature · 2 lines
Regards, Nishanth Menon
Nishanth Menon
maintainerPATCH 4/6 ARM: OMAP: SmartReflex: provide SoC integration API for VP
In reply to Nishanth MenonSoC integration of SmartReflex AVS block is varied. Some use Voltage Processor for a hardware loop in certain OMAP SoC (called hardware loop), while others have just the AVS block without hardware loop automatic calibration mechanism for AVS block to talk through. So provide the Voltage Processor API to allow for SmartReflex class drivers to use the same.
NOTE: SmartReflex class 3 mode of operation mandates VP APIs so, refuse to enable AVS driver if corresponding APIs are not available.
As part of this change, remove the inclusion of voltage.h which is no longer needed as smartreflex.h includes linux/platform_data/voltage-omap.h which contain relevant definitions used here.
--- arch/arm/mach-omap2/smartreflex-class3.c | 16 +++++++++++++--- arch/arm/mach-omap2/sr_device.c | 5 +++++ drivers/power/avs/smartreflex.c | 2 ++ include/linux/power/smartreflex.h | 18 ++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/smartreflex-class3.c +13 -3
@@ -12,7 +12,6 @@*/ #include <linux/power/smartreflex.h> -#include "voltage.h" static int sr_class3_enable (struct omap_sr *sr) {
@@ -23,15 +22,26 @@ static int sr_class3_enable(struct omap_sr *sr) __func__, sr->name);return -ENODATA ; } +if (!sr->soc_ops.vp_enable) { +pr_warn ("%s: no VP enable available. Cannot enable %s!!\n" , + __func__, sr->name); +return -EINVAL ; + } -omap_vp_enable (sr->voltdm); + sr->soc_ops.vp_enable (sr->voltdm);return sr_enable (sr->voltdm, volt); }static int sr_class3_disable (struct omap_sr *sr,int is_volt_reset) { +if (!sr->soc_ops.vp_disable) { +pr_warn ("%s: no VP disable available. Cannot disable %s!!\n" , + __func__, sr->name); +return -EINVAL ; + }sr_disable_errgen (sr->voltdm); -omap_vp_disable (sr->voltdm); + + sr->soc_ops.vp_disable (sr->voltdm);sr_disable (sr->voltdm);if (is_volt_reset)voltdm_reset (sr->voltdm);
arch/arm/mach-omap2/sr_device.c +5 -0
@@ -139,6 +139,11 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user) sr_data->enable_on_init = sr_enable_on_init; +if (sr_data->voltdm->vp) { + sr_data->soc_ops.vp_enable = omap_vp_enable; + sr_data->soc_ops.vp_disable = omap_vp_disable; + } + pdev =omap_device_build (name, i, oh, sr_data,sizeof (*sr_data),NULL ,0 ,0 );if (IS_ERR (pdev))
drivers/power/avs/smartreflex.c +2 -0
@@ -920,6 +920,8 @@ static int __init omap_sr_probe(struct platform_device *pdev) sr_info->pdev = pdev; sr_info->srid = pdev->id; sr_info->voltdm = pdata->voltdm; + sr_info->soc_ops.vp_enable = pdata->soc_ops.vp_enable; + sr_info->soc_ops.vp_disable = pdata->soc_ops.vp_disable; sr_info->nvalue_table = pdata->nvalue_table; sr_info->nvalue_count = pdata->nvalue_count; sr_info->senn_mod = pdata->senn_mod;
include/linux/power/smartreflex.h +18 -0
@@ -143,6 +143,21 @@#define OMAP3430_SR_ERRWEIGHT 0x04#define OMAP3430_SR_ERRMAXLIMIT 0x02 +/** +* struct omap_sr_soc_ops - SoC specific APIs +* @vp_enable: Voltage Processor enable +* @vp_disable: Voltage Processor disable +* +* SmartReflex AVS module integration tends to be SoC +* variant. some are integrated with modules like +* Voltage Processor (VP), while, some SoC integration +* donot use VP. Provide that variance here. +*/ +struct omap_sr_soc_ops { +void (*vp_enable)(struct voltagedomain *voltdm); +void (*vp_disable)(struct voltagedomain *voltdm); +}; +struct omap_sr {char *name;struct list_head node;
@@ -165,6 +180,7 @@ struct omap_sr {u32 senp_mod;u32 senn_mod;void __iomem *base; +struct omap_sr_soc_ops soc_ops; };/**
@@ -268,6 +284,7 @@ struct omap_sr_nvalue_table {* @nvalue_table: table containing the efuse offsets and nvalues * corresponding to them. * @voltdm: Pointer to the voltage domain associated with the SR +* @soc_ops: SoC specific ops to deal with integration variance */ struct omap_sr_data {const char *name;
@@ -278,6 +295,7 @@ struct omap_sr_data {bool enable_on_init;struct omap_sr_nvalue_table *nvalue_table;struct voltagedomain *voltdm; +struct omap_sr_soc_ops soc_ops; };/* Smartreflex module enable/disable interface */
Signature · 1 line
1.7.9.5
Nishanth Menon
maintainerPATCH 5/6 ARM: OMAP: SmartReflex: use pr_warn instead of pr_warning
In reply to Nishanth MenonMinor cleanup to use the preferred pr_warn
--- arch/arm/mach-omap2/smartreflex-class3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/smartreflex-class3.c +2 -2
@@ -18,8 +18,8 @@ static int sr_class3_enable(struct omap_sr *sr)unsigned long volt =voltdm_get_voltage (sr->voltdm);if (!volt) { -pr_warning ("%s: Curr voltage unknown. Cannot enable %s\n" , - __func__, sr->name); +pr_warn ("%s: Curr voltage unknown. Cannot enable %s\n" , + __func__, sr->name);return -ENODATA ; }if (!sr->soc_ops.vp_enable) {
Signature · 1 line
1.7.9.5
Nishanth Menon
maintainerPATCH 6/6 PM / AVS / OMAP: move Smartreflex-class3 driver to power/avs
In reply to Nishanth MenonMove the AVS class 3 driver to AVS directory
---
arch/arm/mach-omap2/Makefile | 1 -
arch/arm/plat-omap/Kconfig | 9 ---------
drivers/power/avs/Kconfig | 9 +++++++++
drivers/power/avs/Makefile | 1 +
.../power/avs}/smartreflex-class3.c | 0
5 files changed, 10 insertions(+), 10 deletions(-)
rename {arch/arm/mach-omap2 => drivers/power/avs}/smartreflex-class3.c (100%)arch/arm/mach-omap2/Makefile +0 -1
@@ -71,7 +71,6 @@ obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o sleep44xx.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o -obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o AFLAGS_sleep24xx.o :=-Wa,-march=armv6 AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec)
arch/arm/plat-omap/Kconfig +0 -9
@@ -47,15 +47,6 @@ config OMAP_DEBUG_LEDS depends on OMAP_DEBUG_DEVICES select LEDS_CLASS -config POWER_AVS_OMAP_CLASS3 - bool "Class 3 mode of Smartreflex Implementation" - depends on POWER_AVS_OMAP && TWL4030_CORE - help - Say Y to enable Class 3 implementation of Smartreflex - - Class 3 implementation of Smartreflex employs continuous hardware - voltage calibration. - config OMAP_RESET_CLOCKS bool "Reset unused clocks during boot" depends on ARCH_OMAP
drivers/power/avs/Kconfig +9 -0
@@ -32,3 +32,12 @@ config POWER_AVS_OMAP Optionally autocompensation can be enabled in the kernel by default during system init via the enable_on_init flag which an be passed as platform data to the smartreflex driver. + +config POWER_AVS_OMAP_CLASS3 + bool "Class 3 mode of Smartreflex Implementation" + depends on POWER_AVS_OMAP && TWL4030_CORE + help + Say Y to enable Class 3 implementation of Smartreflex + + Class 3 implementation of Smartreflex employs continuous hardware + voltage calibration.
drivers/power/avs/Makefile +1 -0
@@ -1 +1,2 @@ obj-$(CONFIG_POWER_AVS_OMAP) += smartreflex.o +obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o
drivers/power/avs/smartreflex-class3.c renamed from arch/arm/mach-omap2/smartreflex-class3.c +0 -0
Signature · 1 line
1.7.9.5