All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs
@ 2012-11-05 15:02 Nishanth Menon
  2012-11-05 15:02 ` Nishanth Menon
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

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
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs
  2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
@ 2012-11-05 15:02 ` Nishanth Menon
  2012-11-05 15:02 ` [PATCH 1/6] PM / AVS / OMAP: move Kconfig definition of smartreflex to avs directory Nishanth Menon
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

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
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/6] PM / AVS / OMAP: move Kconfig definition of smartreflex to avs directory
  2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
  2012-11-05 15:02 ` Nishanth Menon
@ 2012-11-05 15:02 ` Nishanth Menon
  2012-11-05 15:02 ` [PATCH 2/6] ARM: OMAP: voltage: remove duplicate header definitions Nishanth Menon
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

Don't see why the source should be in drivers/power/avs, but not config option

Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/plat-omap/Kconfig |   22 ----------------------
 drivers/power/avs/Kconfig  |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 82fcb20..b49cff3 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -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
diff --git a/drivers/power/avs/Kconfig b/drivers/power/avs/Kconfig
index 2a1008b..466a391 100644
--- a/drivers/power/avs/Kconfig
+++ b/drivers/power/avs/Kconfig
@@ -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.
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/6] ARM: OMAP: voltage: remove duplicate header definitions
  2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
  2012-11-05 15:02 ` Nishanth Menon
  2012-11-05 15:02 ` [PATCH 1/6] PM / AVS / OMAP: move Kconfig definition of smartreflex to avs directory Nishanth Menon
@ 2012-11-05 15:02 ` Nishanth Menon
  2012-11-05 15:02 ` [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header Nishanth Menon
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

remove duplicate definitions which are already present
in linux/platform_data/voltage-omap.h

Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/voltage.h |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index 7283b7e..af9d469 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -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
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
  2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
                   ` (2 preceding siblings ...)
  2012-11-05 15:02 ` [PATCH 2/6] ARM: OMAP: voltage: remove duplicate header definitions Nishanth Menon
@ 2012-11-05 15:02 ` Nishanth Menon
  2012-11-06 18:49   ` Tony Lindgren
  2012-11-05 15:02 ` [PATCH 4/6] ARM: OMAP: SmartReflex: provide SoC integration API for VP Nishanth Menon
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

Move voltdm_reset to include/linux/platform_data/voltage-omap.h

Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/voltage.h              |    1 -
 include/linux/platform_data/voltage-omap.h |    1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index af9d469..0665f21 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -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
diff --git a/include/linux/platform_data/voltage-omap.h b/include/linux/platform_data/voltage-omap.h
index 5be4d5d..4eb3d43 100644
--- a/include/linux/platform_data/voltage-omap.h
+++ b/include/linux/platform_data/voltage-omap.h
@@ -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
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/6] ARM: OMAP: SmartReflex: provide SoC integration API for VP
  2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
                   ` (3 preceding siblings ...)
  2012-11-05 15:02 ` [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header Nishanth Menon
@ 2012-11-05 15:02 ` Nishanth Menon
  2012-11-05 15:02 ` [PATCH 5/6] ARM: OMAP: SmartReflex: use pr_warn instead of pr_warning Nishanth Menon
  2012-11-05 15:02 ` [PATCH 6/6] PM / AVS / OMAP: move Smartreflex-class3 driver to power/avs Nishanth Menon
  6 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

SoC 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.

Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 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(-)

diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
index 1da8f03..7ccf57f 100644
--- a/arch/arm/mach-omap2/smartreflex-class3.c
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -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);
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index f8217a5..6aac2c7 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -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))
diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c
index 24768a2..32a9e3e 100644
--- a/drivers/power/avs/smartreflex.c
+++ b/drivers/power/avs/smartreflex.c
@@ -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;
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
index 4a496eb..203fc64 100644
--- a/include/linux/power/smartreflex.h
+++ b/include/linux/power/smartreflex.h
@@ -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 */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/6] ARM: OMAP: SmartReflex: use pr_warn instead of pr_warning
  2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
                   ` (4 preceding siblings ...)
  2012-11-05 15:02 ` [PATCH 4/6] ARM: OMAP: SmartReflex: provide SoC integration API for VP Nishanth Menon
@ 2012-11-05 15:02 ` Nishanth Menon
  2012-11-05 15:02 ` [PATCH 6/6] PM / AVS / OMAP: move Smartreflex-class3 driver to power/avs Nishanth Menon
  6 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

Minor cleanup to use the preferred pr_warn

Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/smartreflex-class3.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
index 7ccf57f..23d45f9 100644
--- a/arch/arm/mach-omap2/smartreflex-class3.c
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -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) {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/6] PM / AVS / OMAP: move Smartreflex-class3 driver to power/avs
  2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
                   ` (5 preceding siblings ...)
  2012-11-05 15:02 ` [PATCH 5/6] ARM: OMAP: SmartReflex: use pr_warn instead of pr_warning Nishanth Menon
@ 2012-11-05 15:02 ` Nishanth Menon
  6 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-05 15:02 UTC (permalink / raw)
  To: linux-omap
  Cc: Rafael, Kevin Hilman, Anton Vorontsov, linux-pm, Nishanth Menon

Move the AVS class 3 driver to AVS directory

Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 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%)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fe40d9e..1eae31d 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -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)
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index b49cff3..cd2c60d 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -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
diff --git a/drivers/power/avs/Kconfig b/drivers/power/avs/Kconfig
index 466a391..4f1c1b4 100644
--- a/drivers/power/avs/Kconfig
+++ b/drivers/power/avs/Kconfig
@@ -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.
diff --git a/drivers/power/avs/Makefile b/drivers/power/avs/Makefile
index 0843386..ac72ec5 100644
--- a/drivers/power/avs/Makefile
+++ b/drivers/power/avs/Makefile
@@ -1 +1,2 @@
 obj-$(CONFIG_POWER_AVS_OMAP)		+= smartreflex.o
+obj-$(CONFIG_POWER_AVS_OMAP_CLASS3)	+= smartreflex-class3.o
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/drivers/power/avs/smartreflex-class3.c
similarity index 100%
rename from arch/arm/mach-omap2/smartreflex-class3.c
rename to drivers/power/avs/smartreflex-class3.c
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
  2012-11-05 15:02 ` [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header Nishanth Menon
@ 2012-11-06 18:49   ` Tony Lindgren
  2012-11-06 21:48     ` Nishanth Menon
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2012-11-06 18:49 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: linux-omap, Rafael, Kevin Hilman, Anton Vorontsov, linux-pm

* Nishanth Menon <nm@ti.com> [121105 07:04]:
> Move voltdm_reset to include/linux/platform_data/voltage-omap.h
> 
> Acked-by: Jean Pihet <j-pihet@ti.com>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  arch/arm/mach-omap2/voltage.h              |    1 -
>  include/linux/platform_data/voltage-omap.h |    1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
> index af9d469..0665f21 100644
> --- a/arch/arm/mach-omap2/voltage.h
> +++ b/arch/arm/mach-omap2/voltage.h
> @@ -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
> diff --git a/include/linux/platform_data/voltage-omap.h b/include/linux/platform_data/voltage-omap.h
> index 5be4d5d..4eb3d43 100644
> --- a/include/linux/platform_data/voltage-omap.h
> +++ b/include/linux/platform_data/voltage-omap.h
> @@ -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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
  2012-11-06 18:49   ` Tony Lindgren
@ 2012-11-06 21:48     ` Nishanth Menon
  2012-11-07  1:18       ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Nishanth Menon @ 2012-11-06 21:48 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Rafael, Kevin Hilman, Anton Vorontsov, linux-pm

On 10:49-20121106, Tony Lindgren wrote:
> * Nishanth Menon <nm@ti.com> [121105 07:04]:
> > Move voltdm_reset to include/linux/platform_data/voltage-omap.h
> > 
> > Acked-by: Jean Pihet <j-pihet@ti.com>
> > Signed-off-by: Nishanth Menon <nm@ti.com>
> > ---
> >  arch/arm/mach-omap2/voltage.h              |    1 -
> >  include/linux/platform_data/voltage-omap.h |    1 +
> >  2 files changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
> > index af9d469..0665f21 100644
> > --- a/arch/arm/mach-omap2/voltage.h
> > +++ b/arch/arm/mach-omap2/voltage.h
> > @@ -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
> > diff --git a/include/linux/platform_data/voltage-omap.h b/include/linux/platform_data/voltage-omap.h
> > index 5be4d5d..4eb3d43 100644
> > --- a/include/linux/platform_data/voltage-omap.h
> > +++ b/include/linux/platform_data/voltage-omap.h
> > @@ -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.
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
> 
> 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?

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
and
drivers/power/avs/smartreflex-class3.c
will need voltdm_reset and voltdm_get_voltage

-- 
Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
  2012-11-06 21:48     ` Nishanth Menon
@ 2012-11-07  1:18       ` Tony Lindgren
  2012-11-07  1:28         ` Nishanth Menon
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2012-11-07  1:18 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: linux-omap, Rafael, Kevin Hilman, Anton Vorontsov, linux-pm

* Nishanth Menon <nm@ti.com> [121106 13:50]:
> On 10:49-20121106, Tony Lindgren wrote:
> > 
> > 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?
> 
> 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
> and
> drivers/power/avs/smartreflex-class3.c
> will need voltdm_reset and voltdm_get_voltage

How about something local drivers/power/avs/smartreflex.h?

Regards,

Tony

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
  2012-11-07  1:18       ` Tony Lindgren
@ 2012-11-07  1:28         ` Nishanth Menon
  2012-11-07  1:46           ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Nishanth Menon @ 2012-11-07  1:28 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Rafael, Kevin Hilman, Anton Vorontsov, linux-pm

On 17:18-20121106, Tony Lindgren wrote:
> * Nishanth Menon <nm@ti.com> [121106 13:50]:
> > On 10:49-20121106, Tony Lindgren wrote:
> > > 
> > > 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?
> > 
> > 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
> > and
> > drivers/power/avs/smartreflex-class3.c
> > will need voltdm_reset and voltdm_get_voltage
> 
> How 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.
-- 
Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
  2012-11-07  1:28         ` Nishanth Menon
@ 2012-11-07  1:46           ` Tony Lindgren
  2012-11-08  4:52             ` Nishanth Menon
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2012-11-07  1:46 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: linux-omap, Rafael, Kevin Hilman, Anton Vorontsov, linux-pm

* Nishanth Menon <nm@ti.com> [121106 17:30]:
> On 17:18-20121106, Tony Lindgren wrote:
> > * Nishanth Menon <nm@ti.com> [121106 13:50]:
> > > On 10:49-20121106, Tony Lindgren wrote:
> > > > 
> > > > 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?
> > > 
> > > 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
> > > and
> > > drivers/power/avs/smartreflex-class3.c
> > > will need voltdm_reset and voltdm_get_voltage
> > 
> > How 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.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header
  2012-11-07  1:46           ` Tony Lindgren
@ 2012-11-08  4:52             ` Nishanth Menon
  0 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2012-11-08  4:52 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Rafael, Kevin Hilman, Anton Vorontsov, linux-pm

On 17:46-20121106, Tony Lindgren wrote:
> * Nishanth Menon <nm@ti.com> [121106 17:30]:
> > On 17:18-20121106, Tony Lindgren wrote:
> > > * Nishanth Menon <nm@ti.com> [121106 13:50]:
> > > > On 10:49-20121106, Tony Lindgren wrote:
> > > > > 
> > > > > 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?
> > > > 
> > > > 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
> > > > and
> > > > drivers/power/avs/smartreflex-class3.c
> > > > will need voltdm_reset and voltdm_get_voltage
> > > 
> > > How 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.
> 
> 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.

-- 
Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-11-08  4:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 15:02 [PATCH 0/6] ARM: OMAP3+: move smartreflex-class3.c to drivers/power/avs Nishanth Menon
2012-11-05 15:02 ` Nishanth Menon
2012-11-05 15:02 ` [PATCH 1/6] PM / AVS / OMAP: move Kconfig definition of smartreflex to avs directory Nishanth Menon
2012-11-05 15:02 ` [PATCH 2/6] ARM: OMAP: voltage: remove duplicate header definitions Nishanth Menon
2012-11-05 15:02 ` [PATCH 3/6] ARM: OMAP: voltage: move voltdm_reset to platform_data header Nishanth Menon
2012-11-06 18:49   ` Tony Lindgren
2012-11-06 21:48     ` Nishanth Menon
2012-11-07  1:18       ` Tony Lindgren
2012-11-07  1:28         ` Nishanth Menon
2012-11-07  1:46           ` Tony Lindgren
2012-11-08  4:52             ` Nishanth Menon
2012-11-05 15:02 ` [PATCH 4/6] ARM: OMAP: SmartReflex: provide SoC integration API for VP Nishanth Menon
2012-11-05 15:02 ` [PATCH 5/6] ARM: OMAP: SmartReflex: use pr_warn instead of pr_warning Nishanth Menon
2012-11-05 15:02 ` [PATCH 6/6] PM / AVS / OMAP: move Smartreflex-class3 driver to power/avs Nishanth Menon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.