All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] AM35x: Adding PM init
@ 2011-08-19 11:49 ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: tony, linux, khilman, sameo, santosh.shilimkar, premi,
	david.woodhouse, Abhilash K V

This patch-set fixes the power and voltage management initialization sequence
for AM35x.
These patches are dependent on the following patch-set
http://marc.info/?l=linux-omap&m=131247357813228&w=2
which gets the AM3517 EVM booting.

The patches are tested on master of tmlind/linux-omap-2.6.git.
Kernel version is 3.0.0-rc7 and last commit on top of which these patches
were added is:

        885cf6ff7d3dad4cc44be74b0577d3a554d3ab71: Linux-omap rebuilt:
        Updated to -rc7, added new boards

Cc: Sanjeev Premi <premi@ti.com>
---
Abhilash K V (1):
  OMAP3: Remove auto-selection of PMICs

Sanjeev Premi (2):
  AM35x: voltage: Basic initialization
  OMAP3: Add support for TPS65023 (AM35x only)

 arch/arm/configs/omap2plus_defconfig          |    3 +
 arch/arm/mach-omap2/Kconfig                   |    3 -
 arch/arm/mach-omap2/Makefile                  |    3 +-
 arch/arm/mach-omap2/omap_opp_data.h           |    1 +
 arch/arm/mach-omap2/opp3xxx_data.c            |   10 +++
 arch/arm/mach-omap2/pm.c                      |    4 +-
 arch/arm/mach-omap2/pm.h                      |    9 +++
 arch/arm/mach-omap2/pmic_tps65023.c           |   84 +++++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.c                 |   18 +++++
 arch/arm/mach-omap2/voltagedomains3xxx_data.c |   40 +++++++++++-
 drivers/mfd/Kconfig                           |    4 +-
 11 files changed, 171 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pmic_tps65023.c


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

* [PATCH 0/3] AM35x: Adding PM init
@ 2011-08-19 11:49 ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: tony, linux, khilman, sameo, santosh.shilimkar, premi,
	david.woodhouse, Abhilash K V

This patch-set fixes the power and voltage management initialization sequence
for AM35x.
These patches are dependent on the following patch-set
http://marc.info/?l=linux-omap&m=131247357813228&w=2
which gets the AM3517 EVM booting.

The patches are tested on master of tmlind/linux-omap-2.6.git.
Kernel version is 3.0.0-rc7 and last commit on top of which these patches
were added is:

        885cf6ff7d3dad4cc44be74b0577d3a554d3ab71: Linux-omap rebuilt:
        Updated to -rc7, added new boards

Cc: Sanjeev Premi <premi@ti.com>
---
Abhilash K V (1):
  OMAP3: Remove auto-selection of PMICs

Sanjeev Premi (2):
  AM35x: voltage: Basic initialization
  OMAP3: Add support for TPS65023 (AM35x only)

 arch/arm/configs/omap2plus_defconfig          |    3 +
 arch/arm/mach-omap2/Kconfig                   |    3 -
 arch/arm/mach-omap2/Makefile                  |    3 +-
 arch/arm/mach-omap2/omap_opp_data.h           |    1 +
 arch/arm/mach-omap2/opp3xxx_data.c            |   10 +++
 arch/arm/mach-omap2/pm.c                      |    4 +-
 arch/arm/mach-omap2/pm.h                      |    9 +++
 arch/arm/mach-omap2/pmic_tps65023.c           |   84 +++++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.c                 |   18 +++++
 arch/arm/mach-omap2/voltagedomains3xxx_data.c |   40 +++++++++++-
 drivers/mfd/Kconfig                           |    4 +-
 11 files changed, 171 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pmic_tps65023.c

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

* [PATCH 0/3] AM35x: Adding PM init
@ 2011-08-19 11:49 ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-arm-kernel

This patch-set fixes the power and voltage management initialization sequence
for AM35x.
These patches are dependent on the following patch-set
http://marc.info/?l=linux-omap&m=131247357813228&w=2
which gets the AM3517 EVM booting.

The patches are tested on master of tmlind/linux-omap-2.6.git.
Kernel version is 3.0.0-rc7 and last commit on top of which these patches
were added is:

        885cf6ff7d3dad4cc44be74b0577d3a554d3ab71: Linux-omap rebuilt:
        Updated to -rc7, added new boards

Cc: Sanjeev Premi <premi@ti.com>
---
Abhilash K V (1):
  OMAP3: Remove auto-selection of PMICs

Sanjeev Premi (2):
  AM35x: voltage: Basic initialization
  OMAP3: Add support for TPS65023 (AM35x only)

 arch/arm/configs/omap2plus_defconfig          |    3 +
 arch/arm/mach-omap2/Kconfig                   |    3 -
 arch/arm/mach-omap2/Makefile                  |    3 +-
 arch/arm/mach-omap2/omap_opp_data.h           |    1 +
 arch/arm/mach-omap2/opp3xxx_data.c            |   10 +++
 arch/arm/mach-omap2/pm.c                      |    4 +-
 arch/arm/mach-omap2/pm.h                      |    9 +++
 arch/arm/mach-omap2/pmic_tps65023.c           |   84 +++++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.c                 |   18 +++++
 arch/arm/mach-omap2/voltagedomains3xxx_data.c |   40 +++++++++++-
 drivers/mfd/Kconfig                           |    4 +-
 11 files changed, 171 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pmic_tps65023.c

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

* [PATCH 1/3] AM35x: voltage: Basic initialization
  2011-08-19 11:49 ` Abhilash K V
  (?)
@ 2011-08-19 11:49   ` Abhilash K V
  -1 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: tony, linux, khilman, sameo, santosh.shilimkar, premi,
	david.woodhouse, Abhilash K V

From: Sanjeev Premi <premi@ti.com>

This patch adds the basic initialization of voltage layer
for AM35x. Since AM35x doesn't support voltage scaling,
Many functions have been defined to plug into existing
voltage layer.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/mach-omap2/omap_opp_data.h           |    1 +
 arch/arm/mach-omap2/opp3xxx_data.c            |   10 ++++++
 arch/arm/mach-omap2/pm.c                      |    3 +-
 arch/arm/mach-omap2/voltage.c                 |   18 +++++++++++
 arch/arm/mach-omap2/voltagedomains3xxx_data.c |   40 ++++++++++++++++++++++++-
 5 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h
index c784c12..c7cedf3 100644
--- a/arch/arm/mach-omap2/omap_opp_data.h
+++ b/arch/arm/mach-omap2/omap_opp_data.h
@@ -88,6 +88,7 @@ extern struct omap_volt_data omap34xx_vddmpu_volt_data[];
 extern struct omap_volt_data omap34xx_vddcore_volt_data[];
 extern struct omap_volt_data omap36xx_vddmpu_volt_data[];
 extern struct omap_volt_data omap36xx_vddcore_volt_data[];
+extern struct omap_volt_data am35xx_vdd_volt_data[];
 
 extern struct omap_volt_data omap44xx_vdd_mpu_volt_data[];
 extern struct omap_volt_data omap44xx_vdd_iva_volt_data[];
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index d95f3f9..2337d0f 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -150,6 +150,16 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
 	OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
 };
 
+/* AM35x
+ *
+ * Fields related to SmartReflex and Voltage Processor are set to 0.
+ */
+struct omap_volt_data am35xx_vdd_volt_data[] = {
+	VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, 0x0, 0x0, 0x0),
+	VOLT_DATA_DEFINE(0, 0, 0, 0),
+};
+
+
 /**
  * omap3_opp_init() - initialize omap3 opp table
  */
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 3feb359..e3e2d1e 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -227,7 +227,8 @@ static void __init omap3_init_voltages(void)
 {
 	if (!cpu_is_omap34xx())
 		return;
-
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return;
 	omap2_set_init_voltage("mpu", "dpll1_ck", mpu_dev);
 	omap2_set_init_voltage("core", "l3_ick", l3_dev);
 }
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index 9ef3789..3fa0652 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -60,6 +60,12 @@ static struct dentry *voltage_dir;
 static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
 					unsigned long target_volt);
 
+static int volt_scale_nop(struct omap_vdd_info *vdd,
+				unsigned long target_volt)
+{
+	return 0;
+}
+
 static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
 {
 	return omap2_prm_read_mod_reg(mod, offset);
@@ -114,6 +120,12 @@ static int __init _config_common_vdd_data(struct omap_vdd_info *vdd)
 	sys_clk_speed /= 1000;
 
 	/* Generic voltage parameters */
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		vdd->volt_scale = volt_scale_nop;
+		vdd->vp_enabled = false;
+		return 0;
+	}
+
 	vdd->volt_scale = vp_forceupdate_scale_voltage;
 	vdd->vp_enabled = false;
 
@@ -217,6 +229,9 @@ static void __init vp_init(struct omap_vdd_info *vdd)
 {
 	u32 vp_val;
 
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return ;
+
 	if (!vdd->read_reg || !vdd->write_reg) {
 		pr_err("%s: No read/write API for accessing vdd_%s regs\n",
 			__func__, vdd->voltdm.name);
@@ -598,6 +613,9 @@ static void __init omap_vc_init(struct omap_vdd_info *vdd)
 {
 	u32 vc_val;
 
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return ;
+
 	if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
 		pr_err("%s: PMIC info requried to configure vc for"
 			"vdd_%s not populated.Hence cannot initialize vc\n",
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index def230f..b45d145 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -67,6 +67,38 @@ static struct omap_vdd_info *omap3_vdd_info[] = {
 	&omap3_vdd2_info,
 };
 
+/*
+ * AM35x VDD structures
+ *
+ * In AM35x there neither scalable voltage domain nor any hook-up with
+ * voltage controller/processor. However, when trying to re-use the hwmod
+ * database for OMAP3, definition of "core" voltage domain is necessary.
+ * Else, changes in hwmod data structures grow spirally.
+ *
+ * As a workaround, "core" voltage domain is defined below. The definition
+ * doesn't lead to any side-effects.
+ */
+static struct omap_vdd_info am3517_vdd1_info = {
+	.vp_enabled     = false,
+
+	.voltdm = {
+		.name = "mpu",
+	},
+};
+
+static struct omap_vdd_info am3517_vdd2_info = {
+	.vp_enabled     = false,
+
+	.voltdm = {
+		.name = "core",
+	},
+};
+
+static struct omap_vdd_info *am3517_vdd_info[] = {
+	&am3517_vdd1_info,
+	&am3517_vdd2_info,
+};
+
 /* OMAP3 specific voltage init functions */
 static int __init omap3xxx_voltage_early_init(void)
 {
@@ -80,7 +112,13 @@ static int __init omap3xxx_voltage_early_init(void)
 	 * XXX Will depend on the process, validation, and binning
 	 * for the currently-running IC
 	 */
-	if (cpu_is_omap3630()) {
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		am3517_vdd1_info.volt_data = am35xx_vdd_volt_data;
+		am3517_vdd2_info.volt_data = am35xx_vdd_volt_data;
+		return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
+				       am3517_vdd_info,
+				       ARRAY_SIZE(am3517_vdd_info));
+	} else if (cpu_is_omap3630()) {
 		omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
 		omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
 	} else {
-- 
1.7.1


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

* [PATCH 1/3] AM35x: voltage: Basic initialization
@ 2011-08-19 11:49   ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: khilman, linux, sameo, tony, santosh.shilimkar, Abhilash K V,
	premi, david.woodhouse

From: Sanjeev Premi <premi@ti.com>

This patch adds the basic initialization of voltage layer
for AM35x. Since AM35x doesn't support voltage scaling,
Many functions have been defined to plug into existing
voltage layer.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/mach-omap2/omap_opp_data.h           |    1 +
 arch/arm/mach-omap2/opp3xxx_data.c            |   10 ++++++
 arch/arm/mach-omap2/pm.c                      |    3 +-
 arch/arm/mach-omap2/voltage.c                 |   18 +++++++++++
 arch/arm/mach-omap2/voltagedomains3xxx_data.c |   40 ++++++++++++++++++++++++-
 5 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h
index c784c12..c7cedf3 100644
--- a/arch/arm/mach-omap2/omap_opp_data.h
+++ b/arch/arm/mach-omap2/omap_opp_data.h
@@ -88,6 +88,7 @@ extern struct omap_volt_data omap34xx_vddmpu_volt_data[];
 extern struct omap_volt_data omap34xx_vddcore_volt_data[];
 extern struct omap_volt_data omap36xx_vddmpu_volt_data[];
 extern struct omap_volt_data omap36xx_vddcore_volt_data[];
+extern struct omap_volt_data am35xx_vdd_volt_data[];
 
 extern struct omap_volt_data omap44xx_vdd_mpu_volt_data[];
 extern struct omap_volt_data omap44xx_vdd_iva_volt_data[];
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index d95f3f9..2337d0f 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -150,6 +150,16 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
 	OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
 };
 
+/* AM35x
+ *
+ * Fields related to SmartReflex and Voltage Processor are set to 0.
+ */
+struct omap_volt_data am35xx_vdd_volt_data[] = {
+	VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, 0x0, 0x0, 0x0),
+	VOLT_DATA_DEFINE(0, 0, 0, 0),
+};
+
+
 /**
  * omap3_opp_init() - initialize omap3 opp table
  */
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 3feb359..e3e2d1e 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -227,7 +227,8 @@ static void __init omap3_init_voltages(void)
 {
 	if (!cpu_is_omap34xx())
 		return;
-
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return;
 	omap2_set_init_voltage("mpu", "dpll1_ck", mpu_dev);
 	omap2_set_init_voltage("core", "l3_ick", l3_dev);
 }
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index 9ef3789..3fa0652 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -60,6 +60,12 @@ static struct dentry *voltage_dir;
 static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
 					unsigned long target_volt);
 
+static int volt_scale_nop(struct omap_vdd_info *vdd,
+				unsigned long target_volt)
+{
+	return 0;
+}
+
 static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
 {
 	return omap2_prm_read_mod_reg(mod, offset);
@@ -114,6 +120,12 @@ static int __init _config_common_vdd_data(struct omap_vdd_info *vdd)
 	sys_clk_speed /= 1000;
 
 	/* Generic voltage parameters */
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		vdd->volt_scale = volt_scale_nop;
+		vdd->vp_enabled = false;
+		return 0;
+	}
+
 	vdd->volt_scale = vp_forceupdate_scale_voltage;
 	vdd->vp_enabled = false;
 
@@ -217,6 +229,9 @@ static void __init vp_init(struct omap_vdd_info *vdd)
 {
 	u32 vp_val;
 
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return ;
+
 	if (!vdd->read_reg || !vdd->write_reg) {
 		pr_err("%s: No read/write API for accessing vdd_%s regs\n",
 			__func__, vdd->voltdm.name);
@@ -598,6 +613,9 @@ static void __init omap_vc_init(struct omap_vdd_info *vdd)
 {
 	u32 vc_val;
 
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return ;
+
 	if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
 		pr_err("%s: PMIC info requried to configure vc for"
 			"vdd_%s not populated.Hence cannot initialize vc\n",
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index def230f..b45d145 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -67,6 +67,38 @@ static struct omap_vdd_info *omap3_vdd_info[] = {
 	&omap3_vdd2_info,
 };
 
+/*
+ * AM35x VDD structures
+ *
+ * In AM35x there neither scalable voltage domain nor any hook-up with
+ * voltage controller/processor. However, when trying to re-use the hwmod
+ * database for OMAP3, definition of "core" voltage domain is necessary.
+ * Else, changes in hwmod data structures grow spirally.
+ *
+ * As a workaround, "core" voltage domain is defined below. The definition
+ * doesn't lead to any side-effects.
+ */
+static struct omap_vdd_info am3517_vdd1_info = {
+	.vp_enabled     = false,
+
+	.voltdm = {
+		.name = "mpu",
+	},
+};
+
+static struct omap_vdd_info am3517_vdd2_info = {
+	.vp_enabled     = false,
+
+	.voltdm = {
+		.name = "core",
+	},
+};
+
+static struct omap_vdd_info *am3517_vdd_info[] = {
+	&am3517_vdd1_info,
+	&am3517_vdd2_info,
+};
+
 /* OMAP3 specific voltage init functions */
 static int __init omap3xxx_voltage_early_init(void)
 {
@@ -80,7 +112,13 @@ static int __init omap3xxx_voltage_early_init(void)
 	 * XXX Will depend on the process, validation, and binning
 	 * for the currently-running IC
 	 */
-	if (cpu_is_omap3630()) {
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		am3517_vdd1_info.volt_data = am35xx_vdd_volt_data;
+		am3517_vdd2_info.volt_data = am35xx_vdd_volt_data;
+		return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
+				       am3517_vdd_info,
+				       ARRAY_SIZE(am3517_vdd_info));
+	} else if (cpu_is_omap3630()) {
 		omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
 		omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
 	} else {
-- 
1.7.1

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

* [PATCH 1/3] AM35x: voltage: Basic initialization
@ 2011-08-19 11:49   ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Sanjeev Premi <premi@ti.com>

This patch adds the basic initialization of voltage layer
for AM35x. Since AM35x doesn't support voltage scaling,
Many functions have been defined to plug into existing
voltage layer.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/mach-omap2/omap_opp_data.h           |    1 +
 arch/arm/mach-omap2/opp3xxx_data.c            |   10 ++++++
 arch/arm/mach-omap2/pm.c                      |    3 +-
 arch/arm/mach-omap2/voltage.c                 |   18 +++++++++++
 arch/arm/mach-omap2/voltagedomains3xxx_data.c |   40 ++++++++++++++++++++++++-
 5 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h
index c784c12..c7cedf3 100644
--- a/arch/arm/mach-omap2/omap_opp_data.h
+++ b/arch/arm/mach-omap2/omap_opp_data.h
@@ -88,6 +88,7 @@ extern struct omap_volt_data omap34xx_vddmpu_volt_data[];
 extern struct omap_volt_data omap34xx_vddcore_volt_data[];
 extern struct omap_volt_data omap36xx_vddmpu_volt_data[];
 extern struct omap_volt_data omap36xx_vddcore_volt_data[];
+extern struct omap_volt_data am35xx_vdd_volt_data[];
 
 extern struct omap_volt_data omap44xx_vdd_mpu_volt_data[];
 extern struct omap_volt_data omap44xx_vdd_iva_volt_data[];
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index d95f3f9..2337d0f 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -150,6 +150,16 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
 	OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
 };
 
+/* AM35x
+ *
+ * Fields related to SmartReflex and Voltage Processor are set to 0.
+ */
+struct omap_volt_data am35xx_vdd_volt_data[] = {
+	VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, 0x0, 0x0, 0x0),
+	VOLT_DATA_DEFINE(0, 0, 0, 0),
+};
+
+
 /**
  * omap3_opp_init() - initialize omap3 opp table
  */
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 3feb359..e3e2d1e 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -227,7 +227,8 @@ static void __init omap3_init_voltages(void)
 {
 	if (!cpu_is_omap34xx())
 		return;
-
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return;
 	omap2_set_init_voltage("mpu", "dpll1_ck", mpu_dev);
 	omap2_set_init_voltage("core", "l3_ick", l3_dev);
 }
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index 9ef3789..3fa0652 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -60,6 +60,12 @@ static struct dentry *voltage_dir;
 static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
 					unsigned long target_volt);
 
+static int volt_scale_nop(struct omap_vdd_info *vdd,
+				unsigned long target_volt)
+{
+	return 0;
+}
+
 static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
 {
 	return omap2_prm_read_mod_reg(mod, offset);
@@ -114,6 +120,12 @@ static int __init _config_common_vdd_data(struct omap_vdd_info *vdd)
 	sys_clk_speed /= 1000;
 
 	/* Generic voltage parameters */
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		vdd->volt_scale = volt_scale_nop;
+		vdd->vp_enabled = false;
+		return 0;
+	}
+
 	vdd->volt_scale = vp_forceupdate_scale_voltage;
 	vdd->vp_enabled = false;
 
@@ -217,6 +229,9 @@ static void __init vp_init(struct omap_vdd_info *vdd)
 {
 	u32 vp_val;
 
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return ;
+
 	if (!vdd->read_reg || !vdd->write_reg) {
 		pr_err("%s: No read/write API for accessing vdd_%s regs\n",
 			__func__, vdd->voltdm.name);
@@ -598,6 +613,9 @@ static void __init omap_vc_init(struct omap_vdd_info *vdd)
 {
 	u32 vc_val;
 
+	if (cpu_is_omap3505() || cpu_is_omap3517())
+		return ;
+
 	if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
 		pr_err("%s: PMIC info requried to configure vc for"
 			"vdd_%s not populated.Hence cannot initialize vc\n",
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index def230f..b45d145 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -67,6 +67,38 @@ static struct omap_vdd_info *omap3_vdd_info[] = {
 	&omap3_vdd2_info,
 };
 
+/*
+ * AM35x VDD structures
+ *
+ * In AM35x there neither scalable voltage domain nor any hook-up with
+ * voltage controller/processor. However, when trying to re-use the hwmod
+ * database for OMAP3, definition of "core" voltage domain is necessary.
+ * Else, changes in hwmod data structures grow spirally.
+ *
+ * As a workaround, "core" voltage domain is defined below. The definition
+ * doesn't lead to any side-effects.
+ */
+static struct omap_vdd_info am3517_vdd1_info = {
+	.vp_enabled     = false,
+
+	.voltdm = {
+		.name = "mpu",
+	},
+};
+
+static struct omap_vdd_info am3517_vdd2_info = {
+	.vp_enabled     = false,
+
+	.voltdm = {
+		.name = "core",
+	},
+};
+
+static struct omap_vdd_info *am3517_vdd_info[] = {
+	&am3517_vdd1_info,
+	&am3517_vdd2_info,
+};
+
 /* OMAP3 specific voltage init functions */
 static int __init omap3xxx_voltage_early_init(void)
 {
@@ -80,7 +112,13 @@ static int __init omap3xxx_voltage_early_init(void)
 	 * XXX Will depend on the process, validation, and binning
 	 * for the currently-running IC
 	 */
-	if (cpu_is_omap3630()) {
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		am3517_vdd1_info.volt_data = am35xx_vdd_volt_data;
+		am3517_vdd2_info.volt_data = am35xx_vdd_volt_data;
+		return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
+				       am3517_vdd_info,
+				       ARRAY_SIZE(am3517_vdd_info));
+	} else if (cpu_is_omap3630()) {
 		omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
 		omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
 	} else {
-- 
1.7.1

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

* [PATCH 2/3] OMAP3: Add support for TPS65023 (AM35x only)
  2011-08-19 11:49   ` Abhilash K V
  (?)
@ 2011-08-19 11:49     ` Abhilash K V
  -1 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: tony, linux, khilman, sameo, santosh.shilimkar, premi,
	david.woodhouse, Abhilash K V

From: Sanjeev Premi <premi@ti.com>

This patch adds support for TPS65023 used with
OMAP3 devices. The PMIC is currently hooked to
AM35x devices, but can easily be extended for
other OMAP3 devices.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/mach-omap2/Makefile        |    3 +-
 arch/arm/mach-omap2/pm.c            |    1 +
 arch/arm/mach-omap2/pm.h            |    9 ++++
 arch/arm/mach-omap2/pmic_tps65023.c |   84 +++++++++++++++++++++++++++++++++++
 4 files changed, 96 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pmic_tps65023.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fb02937..46f5fbc 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -18,7 +18,8 @@ obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 
-obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
+obj-$(CONFIG_TWL4030_CORE)		+= omap_twl.o
+obj-$(CONFIG_REGULATOR_TPS65023)	+= pmic_tps65023.o
 
 # SMP support ONLY available for OMAP4
 obj-$(CONFIG_SMP)			+= omap-smp.o omap-headsmp.o
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index e3e2d1e..61ebd2f 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -257,6 +257,7 @@ static int __init omap2_common_pm_late_init(void)
 	/* Init the OMAP TWL parameters */
 	omap3_twl_init();
 	omap4_twl_init();
+	omap3_tps65023_init();
 
 	/* Init the voltage layer */
 	omap_voltage_late_init();
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index babac19..5c2bd2f 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -123,5 +123,14 @@ static inline int omap4_twl_init(void)
 	return -EINVAL;
 }
 #endif
+#ifdef CONFIG_REGULATOR_TPS65023
+extern int omap3_tps65023_init(void);
+#else
+static inline int omap3_tps65023_init(void)
+{
+	return -EINVAL;
+}
+#endif
+
 
 #endif
diff --git a/arch/arm/mach-omap2/pmic_tps65023.c b/arch/arm/mach-omap2/pmic_tps65023.c
new file mode 100644
index 0000000..3245929
--- /dev/null
+++ b/arch/arm/mach-omap2/pmic_tps65023.c
@@ -0,0 +1,84 @@
+/**
+ * Implements support for TPS65023
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/i2c/twl.h>
+
+#include "voltage.h"
+
+#include "pm.h"
+
+#define	TPS65023_VDCDC1_MIN		800000	/* 0.8V		*/
+#define	TPS65023_VDCDC1_STEP		25000	/* 0.025V	*/
+
+
+/*
+ * Get voltage corresponding to specified vsel value using this formula:
+ *	Vout = 0.8V + (25mV x Vsel)
+ */
+static unsigned long tps65023_vsel_to_uv(const u8 vsel)
+{
+	return TPS65023_VDCDC1_MIN + (TPS65023_VDCDC1_STEP * vsel);
+}
+
+/*
+ * Get vsel value corresponding to specified voltage using this formula:
+ *	Vsel = (Vout - 0.8V)/ 25mV
+ */
+static u8 tps65023_uv_to_vsel(unsigned long uv)
+{
+	return DIV_ROUND_UP(uv - TPS65023_VDCDC1_MIN, TPS65023_VDCDC1_STEP);
+}
+
+/*
+ * TPS65023 is currently supported only for AM35x devices.
+ * Therefore, implementation below is specific to this device pair.
+ */
+
+/**
+ * Voltage information related to the MPU voltage domain of the
+ * AM35x processors - in relation to the TPS65023.
+ */
+static struct omap_volt_pmic_info tps65023_am35xx_mpu_volt_info = {
+	.step_size		= 25000,
+	.on_volt                = 1200000,
+	.vsel_to_uv		= tps65023_vsel_to_uv,
+	.uv_to_vsel		= tps65023_uv_to_vsel,
+};
+
+int __init omap3_tps65023_init(void)
+{
+	struct voltagedomain *voltdm;
+
+	if (!cpu_is_omap34xx())
+		return -ENODEV;
+
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		voltdm = omap_voltage_domain_lookup("mpu");
+		omap_voltage_register_pmic(voltdm,
+					&tps65023_am35xx_mpu_volt_info);
+		voltdm = omap_voltage_domain_lookup("core");
+		omap_voltage_register_pmic(voltdm,
+					&tps65023_am35xx_mpu_volt_info);
+	} else {
+		/* TODO:
+		 * Support for other devices that support TPS65023
+		 */
+	}
+
+	return 0;
+}
-- 
1.7.1


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

* [PATCH 2/3] OMAP3: Add support for TPS65023 (AM35x only)
@ 2011-08-19 11:49     ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: tony, linux, khilman, sameo, santosh.shilimkar, premi,
	david.woodhouse, Abhilash K V

From: Sanjeev Premi <premi@ti.com>

This patch adds support for TPS65023 used with
OMAP3 devices. The PMIC is currently hooked to
AM35x devices, but can easily be extended for
other OMAP3 devices.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/mach-omap2/Makefile        |    3 +-
 arch/arm/mach-omap2/pm.c            |    1 +
 arch/arm/mach-omap2/pm.h            |    9 ++++
 arch/arm/mach-omap2/pmic_tps65023.c |   84 +++++++++++++++++++++++++++++++++++
 4 files changed, 96 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pmic_tps65023.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fb02937..46f5fbc 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -18,7 +18,8 @@ obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 
-obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
+obj-$(CONFIG_TWL4030_CORE)		+= omap_twl.o
+obj-$(CONFIG_REGULATOR_TPS65023)	+= pmic_tps65023.o
 
 # SMP support ONLY available for OMAP4
 obj-$(CONFIG_SMP)			+= omap-smp.o omap-headsmp.o
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index e3e2d1e..61ebd2f 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -257,6 +257,7 @@ static int __init omap2_common_pm_late_init(void)
 	/* Init the OMAP TWL parameters */
 	omap3_twl_init();
 	omap4_twl_init();
+	omap3_tps65023_init();
 
 	/* Init the voltage layer */
 	omap_voltage_late_init();
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index babac19..5c2bd2f 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -123,5 +123,14 @@ static inline int omap4_twl_init(void)
 	return -EINVAL;
 }
 #endif
+#ifdef CONFIG_REGULATOR_TPS65023
+extern int omap3_tps65023_init(void);
+#else
+static inline int omap3_tps65023_init(void)
+{
+	return -EINVAL;
+}
+#endif
+
 
 #endif
diff --git a/arch/arm/mach-omap2/pmic_tps65023.c b/arch/arm/mach-omap2/pmic_tps65023.c
new file mode 100644
index 0000000..3245929
--- /dev/null
+++ b/arch/arm/mach-omap2/pmic_tps65023.c
@@ -0,0 +1,84 @@
+/**
+ * Implements support for TPS65023
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/i2c/twl.h>
+
+#include "voltage.h"
+
+#include "pm.h"
+
+#define	TPS65023_VDCDC1_MIN		800000	/* 0.8V		*/
+#define	TPS65023_VDCDC1_STEP		25000	/* 0.025V	*/
+
+
+/*
+ * Get voltage corresponding to specified vsel value using this formula:
+ *	Vout = 0.8V + (25mV x Vsel)
+ */
+static unsigned long tps65023_vsel_to_uv(const u8 vsel)
+{
+	return TPS65023_VDCDC1_MIN + (TPS65023_VDCDC1_STEP * vsel);
+}
+
+/*
+ * Get vsel value corresponding to specified voltage using this formula:
+ *	Vsel = (Vout - 0.8V)/ 25mV
+ */
+static u8 tps65023_uv_to_vsel(unsigned long uv)
+{
+	return DIV_ROUND_UP(uv - TPS65023_VDCDC1_MIN, TPS65023_VDCDC1_STEP);
+}
+
+/*
+ * TPS65023 is currently supported only for AM35x devices.
+ * Therefore, implementation below is specific to this device pair.
+ */
+
+/**
+ * Voltage information related to the MPU voltage domain of the
+ * AM35x processors - in relation to the TPS65023.
+ */
+static struct omap_volt_pmic_info tps65023_am35xx_mpu_volt_info = {
+	.step_size		= 25000,
+	.on_volt                = 1200000,
+	.vsel_to_uv		= tps65023_vsel_to_uv,
+	.uv_to_vsel		= tps65023_uv_to_vsel,
+};
+
+int __init omap3_tps65023_init(void)
+{
+	struct voltagedomain *voltdm;
+
+	if (!cpu_is_omap34xx())
+		return -ENODEV;
+
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		voltdm = omap_voltage_domain_lookup("mpu");
+		omap_voltage_register_pmic(voltdm,
+					&tps65023_am35xx_mpu_volt_info);
+		voltdm = omap_voltage_domain_lookup("core");
+		omap_voltage_register_pmic(voltdm,
+					&tps65023_am35xx_mpu_volt_info);
+	} else {
+		/* TODO:
+		 * Support for other devices that support TPS65023
+		 */
+	}
+
+	return 0;
+}
-- 
1.7.1

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

* [PATCH 2/3] OMAP3: Add support for TPS65023 (AM35x only)
@ 2011-08-19 11:49     ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Sanjeev Premi <premi@ti.com>

This patch adds support for TPS65023 used with
OMAP3 devices. The PMIC is currently hooked to
AM35x devices, but can easily be extended for
other OMAP3 devices.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/mach-omap2/Makefile        |    3 +-
 arch/arm/mach-omap2/pm.c            |    1 +
 arch/arm/mach-omap2/pm.h            |    9 ++++
 arch/arm/mach-omap2/pmic_tps65023.c |   84 +++++++++++++++++++++++++++++++++++
 4 files changed, 96 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pmic_tps65023.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fb02937..46f5fbc 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -18,7 +18,8 @@ obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 
-obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
+obj-$(CONFIG_TWL4030_CORE)		+= omap_twl.o
+obj-$(CONFIG_REGULATOR_TPS65023)	+= pmic_tps65023.o
 
 # SMP support ONLY available for OMAP4
 obj-$(CONFIG_SMP)			+= omap-smp.o omap-headsmp.o
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index e3e2d1e..61ebd2f 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -257,6 +257,7 @@ static int __init omap2_common_pm_late_init(void)
 	/* Init the OMAP TWL parameters */
 	omap3_twl_init();
 	omap4_twl_init();
+	omap3_tps65023_init();
 
 	/* Init the voltage layer */
 	omap_voltage_late_init();
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index babac19..5c2bd2f 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -123,5 +123,14 @@ static inline int omap4_twl_init(void)
 	return -EINVAL;
 }
 #endif
+#ifdef CONFIG_REGULATOR_TPS65023
+extern int omap3_tps65023_init(void);
+#else
+static inline int omap3_tps65023_init(void)
+{
+	return -EINVAL;
+}
+#endif
+
 
 #endif
diff --git a/arch/arm/mach-omap2/pmic_tps65023.c b/arch/arm/mach-omap2/pmic_tps65023.c
new file mode 100644
index 0000000..3245929
--- /dev/null
+++ b/arch/arm/mach-omap2/pmic_tps65023.c
@@ -0,0 +1,84 @@
+/**
+ * Implements support for TPS65023
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/i2c/twl.h>
+
+#include "voltage.h"
+
+#include "pm.h"
+
+#define	TPS65023_VDCDC1_MIN		800000	/* 0.8V		*/
+#define	TPS65023_VDCDC1_STEP		25000	/* 0.025V	*/
+
+
+/*
+ * Get voltage corresponding to specified vsel value using this formula:
+ *	Vout = 0.8V + (25mV x Vsel)
+ */
+static unsigned long tps65023_vsel_to_uv(const u8 vsel)
+{
+	return TPS65023_VDCDC1_MIN + (TPS65023_VDCDC1_STEP * vsel);
+}
+
+/*
+ * Get vsel value corresponding to specified voltage using this formula:
+ *	Vsel = (Vout - 0.8V)/ 25mV
+ */
+static u8 tps65023_uv_to_vsel(unsigned long uv)
+{
+	return DIV_ROUND_UP(uv - TPS65023_VDCDC1_MIN, TPS65023_VDCDC1_STEP);
+}
+
+/*
+ * TPS65023 is currently supported only for AM35x devices.
+ * Therefore, implementation below is specific to this device pair.
+ */
+
+/**
+ * Voltage information related to the MPU voltage domain of the
+ * AM35x processors - in relation to the TPS65023.
+ */
+static struct omap_volt_pmic_info tps65023_am35xx_mpu_volt_info = {
+	.step_size		= 25000,
+	.on_volt                = 1200000,
+	.vsel_to_uv		= tps65023_vsel_to_uv,
+	.uv_to_vsel		= tps65023_uv_to_vsel,
+};
+
+int __init omap3_tps65023_init(void)
+{
+	struct voltagedomain *voltdm;
+
+	if (!cpu_is_omap34xx())
+		return -ENODEV;
+
+	if (cpu_is_omap3505() || cpu_is_omap3517()) {
+		voltdm = omap_voltage_domain_lookup("mpu");
+		omap_voltage_register_pmic(voltdm,
+					&tps65023_am35xx_mpu_volt_info);
+		voltdm = omap_voltage_domain_lookup("core");
+		omap_voltage_register_pmic(voltdm,
+					&tps65023_am35xx_mpu_volt_info);
+	} else {
+		/* TODO:
+		 * Support for other devices that support TPS65023
+		 */
+	}
+
+	return 0;
+}
-- 
1.7.1

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

* [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
  2011-08-19 11:49     ` Abhilash K V
  (?)
@ 2011-08-19 11:49       ` Abhilash K V
  -1 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: tony, linux, khilman, sameo, santosh.shilimkar, premi,
	david.woodhouse, Abhilash K V

The current implementation almost assumes that only
TWL4030/TWL5030/TWl6030 are (or can be) used with the
OMAP processors. This is, however, not true.

This patch removes the automatic selection of the PMIC
from Kconfig.
All currently used PMICs are now added to omap2plus_defconfig;
any new PMIC that gets supported in future could now be
enabled here rather than by changing Kconfig for
ARCH_OMAP2PLUS_TYPICAL

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/configs/omap2plus_defconfig |    3 +++
 arch/arm/mach-omap2/Kconfig          |    3 ---
 drivers/mfd/Kconfig                  |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index eb96dc3..7a79fbb 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -134,6 +134,9 @@ CONFIG_POWER_SUPPLY=y
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
+CONFIG_MENELAUS=y
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_POWER=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index d5e4b60..c5d4966 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -16,9 +16,6 @@ config ARCH_OMAP2PLUS_TYPICAL
 	select I2C
 	select I2C_OMAP
 	select MFD_SUPPORT
-	select MENELAUS if ARCH_OMAP2
-	select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
-	select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
 	help
 	  Compile a kernel suitable for booting most boards
 
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 37b83eb..08db166 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -183,7 +183,7 @@ config MENELAUS
 
 config TWL4030_CORE
 	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
-	depends on I2C=y && GENERIC_HARDIRQS
+	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
@@ -207,7 +207,7 @@ config TWL4030_MADC
 
 config TWL4030_POWER
 	bool "Support power resources on TWL4030 family chips"
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you want to use the power resources on the
 	  TWL4030 family chips.  Most of these resources are regulators,
-- 
1.7.1


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

* [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
@ 2011-08-19 11:49       ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: khilman, linux, sameo, tony, santosh.shilimkar, Abhilash K V,
	premi, david.woodhouse

The current implementation almost assumes that only
TWL4030/TWL5030/TWl6030 are (or can be) used with the
OMAP processors. This is, however, not true.

This patch removes the automatic selection of the PMIC
from Kconfig.
All currently used PMICs are now added to omap2plus_defconfig;
any new PMIC that gets supported in future could now be
enabled here rather than by changing Kconfig for
ARCH_OMAP2PLUS_TYPICAL

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/configs/omap2plus_defconfig |    3 +++
 arch/arm/mach-omap2/Kconfig          |    3 ---
 drivers/mfd/Kconfig                  |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index eb96dc3..7a79fbb 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -134,6 +134,9 @@ CONFIG_POWER_SUPPLY=y
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
+CONFIG_MENELAUS=y
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_POWER=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index d5e4b60..c5d4966 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -16,9 +16,6 @@ config ARCH_OMAP2PLUS_TYPICAL
 	select I2C
 	select I2C_OMAP
 	select MFD_SUPPORT
-	select MENELAUS if ARCH_OMAP2
-	select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
-	select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
 	help
 	  Compile a kernel suitable for booting most boards
 
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 37b83eb..08db166 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -183,7 +183,7 @@ config MENELAUS
 
 config TWL4030_CORE
 	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
-	depends on I2C=y && GENERIC_HARDIRQS
+	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
@@ -207,7 +207,7 @@ config TWL4030_MADC
 
 config TWL4030_POWER
 	bool "Support power resources on TWL4030 family chips"
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you want to use the power resources on the
 	  TWL4030 family chips.  Most of these resources are regulators,
-- 
1.7.1

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

* [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
@ 2011-08-19 11:49       ` Abhilash K V
  0 siblings, 0 replies; 20+ messages in thread
From: Abhilash K V @ 2011-08-19 11:49 UTC (permalink / raw)
  To: linux-arm-kernel

The current implementation almost assumes that only
TWL4030/TWL5030/TWl6030 are (or can be) used with the
OMAP processors. This is, however, not true.

This patch removes the automatic selection of the PMIC
from Kconfig.
All currently used PMICs are now added to omap2plus_defconfig;
any new PMIC that gets supported in future could now be
enabled here rather than by changing Kconfig for
ARCH_OMAP2PLUS_TYPICAL

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/configs/omap2plus_defconfig |    3 +++
 arch/arm/mach-omap2/Kconfig          |    3 ---
 drivers/mfd/Kconfig                  |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index eb96dc3..7a79fbb 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -134,6 +134,9 @@ CONFIG_POWER_SUPPLY=y
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
+CONFIG_MENELAUS=y
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_POWER=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index d5e4b60..c5d4966 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -16,9 +16,6 @@ config ARCH_OMAP2PLUS_TYPICAL
 	select I2C
 	select I2C_OMAP
 	select MFD_SUPPORT
-	select MENELAUS if ARCH_OMAP2
-	select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
-	select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
 	help
 	  Compile a kernel suitable for booting most boards
 
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 37b83eb..08db166 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -183,7 +183,7 @@ config MENELAUS
 
 config TWL4030_CORE
 	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
-	depends on I2C=y && GENERIC_HARDIRQS
+	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
@@ -207,7 +207,7 @@ config TWL4030_MADC
 
 config TWL4030_POWER
 	bool "Support power resources on TWL4030 family chips"
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you want to use the power resources on the
 	  TWL4030 family chips.  Most of these resources are regulators,
-- 
1.7.1

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

* Re: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
  2011-08-19 11:49       ` Abhilash K V
@ 2011-08-22 15:03         ` Samuel Ortiz
  -1 siblings, 0 replies; 20+ messages in thread
From: Samuel Ortiz @ 2011-08-22 15:03 UTC (permalink / raw)
  To: Abhilash K V
  Cc: linux-omap, linux-arm-kernel, linux-kernel, tony, linux, khilman,
	santosh.shilimkar, premi, david.woodhouse

Hi Anhilash,

On Fri, Aug 19, 2011 at 05:19:33PM +0530, Abhilash K V wrote:
> The current implementation almost assumes that only
> TWL4030/TWL5030/TWl6030 are (or can be) used with the
> OMAP processors. This is, however, not true.

I don't like the mfd/Kconfig change. Why would those drivers be only buildable
on OMAP processors ?
Unless there is a real reason for this, you should fix the drivers instead.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
@ 2011-08-22 15:03         ` Samuel Ortiz
  0 siblings, 0 replies; 20+ messages in thread
From: Samuel Ortiz @ 2011-08-22 15:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Anhilash,

On Fri, Aug 19, 2011 at 05:19:33PM +0530, Abhilash K V wrote:
> The current implementation almost assumes that only
> TWL4030/TWL5030/TWl6030 are (or can be) used with the
> OMAP processors. This is, however, not true.

I don't like the mfd/Kconfig change. Why would those drivers be only buildable
on OMAP processors ?
Unless there is a real reason for this, you should fix the drivers instead.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* RE: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
  2011-08-22 15:03         ` Samuel Ortiz
  (?)
@ 2011-08-22 15:59           ` Premi, Sanjeev
  -1 siblings, 0 replies; 20+ messages in thread
From: Premi, Sanjeev @ 2011-08-22 15:59 UTC (permalink / raw)
  To: Samuel Ortiz, Koyamangalath, Abhilash
  Cc: linux-omap, linux-arm-kernel, linux-kernel, tony, linux, Hilman,
	Kevin, Shilimkar, Santosh, david.woodhouse

> From: Samuel Ortiz [sameo@linux.intel.com]
> Sent: Monday, August 22, 2011 8:33 PM
> To: Koyamangalath, Abhilash
> Cc: linux-omap@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
>  tony@atomide.com; linux@arm.linux.org.uk; Hilman, Kevin; Shilimkar, Santosh; Premi, Sanjeev;
>  david.woodhouse@intel.com
> Subject: Re: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
> 
> Hi Anhilash,
> 
> On Fri, Aug 19, 2011 at 05:19:33PM +0530, Abhilash K V wrote:
> > The current implementation almost assumes that only
> > TWL4030/TWL5030/TWl6030 are (or can be) used with the
> > OMAP processors. This is, however, not true.
> 
> I don't like the mfd/Kconfig change. Why would those drivers be only buildable
> on OMAP processors ?
> Unless there is a real reason for this, you should fix the drivers instead.

You are right. The change for config item TWL4030_CORE should be removed.
> -	depends on I2C=y && GENERIC_HARDIRQS
> +	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)

In fact, change for TWL4030_POWER should be 
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE

This would allow these PMICs to be used with other processors as well. There may
be issues run-time issues; but they would most likely surface only when there is
a combination without any of the OMAPs. (We would try a dummy build for another
processor with TWL4030 selected.)

The original idea was to ensure that nothing else breaks when the auto selection
of the PMICs is removed.

~sanjeev

> 
> Cheers,
> Samuel.
> 
> --
> Intel Open Source Technology Centre
> http://oss.intel.com/

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

* RE: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
@ 2011-08-22 15:59           ` Premi, Sanjeev
  0 siblings, 0 replies; 20+ messages in thread
From: Premi, Sanjeev @ 2011-08-22 15:59 UTC (permalink / raw)
  To: Samuel Ortiz, Koyamangalath, Abhilash
  Cc: linux-omap, linux-arm-kernel, linux-kernel, tony, linux, Hilman,
	Kevin, Shilimkar, Santosh, david.woodhouse

> From: Samuel Ortiz [sameo@linux.intel.com]
> Sent: Monday, August 22, 2011 8:33 PM
> To: Koyamangalath, Abhilash
> Cc: linux-omap@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
>  tony@atomide.com; linux@arm.linux.org.uk; Hilman, Kevin; Shilimkar, Santosh; Premi, Sanjeev;
>  david.woodhouse@intel.com
> Subject: Re: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
> 
> Hi Anhilash,
> 
> On Fri, Aug 19, 2011 at 05:19:33PM +0530, Abhilash K V wrote:
> > The current implementation almost assumes that only
> > TWL4030/TWL5030/TWl6030 are (or can be) used with the
> > OMAP processors. This is, however, not true.
> 
> I don't like the mfd/Kconfig change. Why would those drivers be only buildable
> on OMAP processors ?
> Unless there is a real reason for this, you should fix the drivers instead.

You are right. The change for config item TWL4030_CORE should be removed.
> -	depends on I2C=y && GENERIC_HARDIRQS
> +	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)

In fact, change for TWL4030_POWER should be 
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE

This would allow these PMICs to be used with other processors as well. There may
be issues run-time issues; but they would most likely surface only when there is
a combination without any of the OMAPs. (We would try a dummy build for another
processor with TWL4030 selected.)

The original idea was to ensure that nothing else breaks when the auto selection
of the PMICs is removed.

~sanjeev

> 
> Cheers,
> Samuel.
> 
> --
> Intel Open Source Technology Centre
> http://oss.intel.com/

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

* [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
@ 2011-08-22 15:59           ` Premi, Sanjeev
  0 siblings, 0 replies; 20+ messages in thread
From: Premi, Sanjeev @ 2011-08-22 15:59 UTC (permalink / raw)
  To: linux-arm-kernel

> From: Samuel Ortiz [sameo at linux.intel.com]
> Sent: Monday, August 22, 2011 8:33 PM
> To: Koyamangalath, Abhilash
> Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org;
>  tony at atomide.com; linux at arm.linux.org.uk; Hilman, Kevin; Shilimkar, Santosh; Premi, Sanjeev;
>  david.woodhouse at intel.com
> Subject: Re: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
> 
> Hi Anhilash,
> 
> On Fri, Aug 19, 2011 at 05:19:33PM +0530, Abhilash K V wrote:
> > The current implementation almost assumes that only
> > TWL4030/TWL5030/TWl6030 are (or can be) used with the
> > OMAP processors. This is, however, not true.
> 
> I don't like the mfd/Kconfig change. Why would those drivers be only buildable
> on OMAP processors ?
> Unless there is a real reason for this, you should fix the drivers instead.

You are right. The change for config item TWL4030_CORE should be removed.
> -	depends on I2C=y && GENERIC_HARDIRQS
> +	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)

In fact, change for TWL4030_POWER should be 
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE

This would allow these PMICs to be used with other processors as well. There may
be issues run-time issues; but they would most likely surface only when there is
a combination without any of the OMAPs. (We would try a dummy build for another
processor with TWL4030 selected.)

The original idea was to ensure that nothing else breaks when the auto selection
of the PMICs is removed.

~sanjeev

> 
> Cheers,
> Samuel.
> 
> --
> Intel Open Source Technology Centre
> http://oss.intel.com/

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

* Re: [PATCH 1/3] AM35x: voltage: Basic initialization
  2011-08-19 11:49   ` Abhilash K V
  (?)
@ 2011-08-30 22:26     ` Kevin Hilman
  -1 siblings, 0 replies; 20+ messages in thread
From: Kevin Hilman @ 2011-08-30 22:26 UTC (permalink / raw)
  To: Abhilash K V
  Cc: linux-omap, linux-arm-kernel, linux-kernel, tony, linux, sameo,
	santosh.shilimkar, premi, david.woodhouse

Abhilash K V <abhilash.kv@ti.com> writes:

> From: Sanjeev Premi <premi@ti.com>
>
> This patch adds the basic initialization of voltage layer
> for AM35x. Since AM35x doesn't support voltage scaling,
> Many functions have been defined to plug into existing
> voltage layer.
>
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

[...]

> diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> index def230f..b45d145 100644
> --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> @@ -67,6 +67,38 @@ static struct omap_vdd_info *omap3_vdd_info[] = {
>  	&omap3_vdd2_info,
>  };
>  
> +/*
> + * AM35x VDD structures
> + *
> + * In AM35x there neither scalable voltage domain nor any hook-up with
> + * voltage controller/processor. However, when trying to re-use the hwmod
> + * database for OMAP3, definition of "core" voltage domain is necessary.
> + * Else, changes in hwmod data structures grow spirally.
> + *
> + * As a workaround, "core" voltage domain is defined below. The definition
> + * doesn't lead to any side-effects.

Except the side-effect of a bunch of unused data, and nop functions that
just clutter things up in a not-very-maintainable way.

For SoCs without scalable voltage domains, we need to fix the underlying
problems in the core code for how to cleanly re-use hwmods.

Fortunately, this core code cleanup is now in progress, so it shouldn't
be long now where we can do this cleanly.

Kevin

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

* Re: [PATCH 1/3] AM35x: voltage: Basic initialization
@ 2011-08-30 22:26     ` Kevin Hilman
  0 siblings, 0 replies; 20+ messages in thread
From: Kevin Hilman @ 2011-08-30 22:26 UTC (permalink / raw)
  To: Abhilash K V
  Cc: premi, linux, sameo, tony, linux-kernel, santosh.shilimkar,
	linux-omap, linux-arm-kernel, david.woodhouse

Abhilash K V <abhilash.kv@ti.com> writes:

> From: Sanjeev Premi <premi@ti.com>
>
> This patch adds the basic initialization of voltage layer
> for AM35x. Since AM35x doesn't support voltage scaling,
> Many functions have been defined to plug into existing
> voltage layer.
>
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

[...]

> diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> index def230f..b45d145 100644
> --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> @@ -67,6 +67,38 @@ static struct omap_vdd_info *omap3_vdd_info[] = {
>  	&omap3_vdd2_info,
>  };
>  
> +/*
> + * AM35x VDD structures
> + *
> + * In AM35x there neither scalable voltage domain nor any hook-up with
> + * voltage controller/processor. However, when trying to re-use the hwmod
> + * database for OMAP3, definition of "core" voltage domain is necessary.
> + * Else, changes in hwmod data structures grow spirally.
> + *
> + * As a workaround, "core" voltage domain is defined below. The definition
> + * doesn't lead to any side-effects.

Except the side-effect of a bunch of unused data, and nop functions that
just clutter things up in a not-very-maintainable way.

For SoCs without scalable voltage domains, we need to fix the underlying
problems in the core code for how to cleanly re-use hwmods.

Fortunately, this core code cleanup is now in progress, so it shouldn't
be long now where we can do this cleanly.

Kevin

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

* [PATCH 1/3] AM35x: voltage: Basic initialization
@ 2011-08-30 22:26     ` Kevin Hilman
  0 siblings, 0 replies; 20+ messages in thread
From: Kevin Hilman @ 2011-08-30 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

Abhilash K V <abhilash.kv@ti.com> writes:

> From: Sanjeev Premi <premi@ti.com>
>
> This patch adds the basic initialization of voltage layer
> for AM35x. Since AM35x doesn't support voltage scaling,
> Many functions have been defined to plug into existing
> voltage layer.
>
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

[...]

> diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> index def230f..b45d145 100644
> --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
> @@ -67,6 +67,38 @@ static struct omap_vdd_info *omap3_vdd_info[] = {
>  	&omap3_vdd2_info,
>  };
>  
> +/*
> + * AM35x VDD structures
> + *
> + * In AM35x there neither scalable voltage domain nor any hook-up with
> + * voltage controller/processor. However, when trying to re-use the hwmod
> + * database for OMAP3, definition of "core" voltage domain is necessary.
> + * Else, changes in hwmod data structures grow spirally.
> + *
> + * As a workaround, "core" voltage domain is defined below. The definition
> + * doesn't lead to any side-effects.

Except the side-effect of a bunch of unused data, and nop functions that
just clutter things up in a not-very-maintainable way.

For SoCs without scalable voltage domains, we need to fix the underlying
problems in the core code for how to cleanly re-use hwmods.

Fortunately, this core code cleanup is now in progress, so it shouldn't
be long now where we can do this cleanly.

Kevin

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

end of thread, other threads:[~2011-08-30 22:26 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-19 11:49 [PATCH 0/3] AM35x: Adding PM init Abhilash K V
2011-08-19 11:49 ` Abhilash K V
2011-08-19 11:49 ` Abhilash K V
2011-08-19 11:49 ` [PATCH 1/3] AM35x: voltage: Basic initialization Abhilash K V
2011-08-19 11:49   ` Abhilash K V
2011-08-19 11:49   ` Abhilash K V
2011-08-19 11:49   ` [PATCH 2/3] OMAP3: Add support for TPS65023 (AM35x only) Abhilash K V
2011-08-19 11:49     ` Abhilash K V
2011-08-19 11:49     ` Abhilash K V
2011-08-19 11:49     ` [PATCH 3/3] OMAP3: Remove auto-selection of PMICs Abhilash K V
2011-08-19 11:49       ` Abhilash K V
2011-08-19 11:49       ` Abhilash K V
2011-08-22 15:03       ` Samuel Ortiz
2011-08-22 15:03         ` Samuel Ortiz
2011-08-22 15:59         ` Premi, Sanjeev
2011-08-22 15:59           ` Premi, Sanjeev
2011-08-22 15:59           ` Premi, Sanjeev
2011-08-30 22:26   ` [PATCH 1/3] AM35x: voltage: Basic initialization Kevin Hilman
2011-08-30 22:26     ` Kevin Hilman
2011-08-30 22:26     ` Kevin Hilman

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.