Skip to contentSkip to conversation

OMAP3+: SR Layer Cleanup

PATCH Superseded Shweta Gulati 5 participants 11 messages May 11, 2011 – May 12, 2011

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

To set sr ntarget values for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

---
V3:
Changed the Subject and Rephrased Commit log as reviewed by Nishanth Menon.
V2:
Rebased on latest 'pm-wip/voltdm_a' branch.

 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c   |   17 +++++++++++++----
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c   |   19 ++++++++++++++++---
 arch/arm/mach-omap2/smartreflex.h            |   10 ++++++++++
 arch/arm/mach-omap2/sr_device.c              |   11 +++++++----
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 -
 5 files changed, 46 insertions(+), 12 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +13 -4
index 3cd91ac..6a704bd 100644
@@ -29,6 +29,7 @@
 
 #include "omap_hwmod_common_data.h"
 
+#include "smartreflex.h"
 #include "prm-regbits-34xx.h"
 #include "cm-regbits-34xx.h"
 #include "wd_timer.h"
@@ -2904,6 +2905,10 @@ static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
 };
 
 /* SR1 */
+static struct omap_sr_dev_attr sr1_dev_attr = {
+	.voltdm_name   = "mpu_iva",
+};
+
 static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = {
 	&omap3_l4_core__sr1,
 };
@@ -2912,7 +2917,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 	.name		= "sr1_hwmod",
 	.class		= &omap34xx_smartreflex_hwmod_class,
 	.main_clk	= "sr1_fck",
-	.vdd_name	= "mpu_iva",
 	.prcm		= {
 		.omap2 = {
 			.prcm_reg_id = 1,
@@ -2924,6 +2928,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 	},
 	.slaves		= omap3_sr1_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3_sr1_slaves),
+	.dev_attr       = &sr1_dev_attr,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
 					CHIP_IS_OMAP3430ES3_0 |
 					CHIP_IS_OMAP3430ES3_1),
@@ -2934,7 +2939,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 	.name		= "sr1_hwmod",
 	.class		= &omap36xx_smartreflex_hwmod_class,
 	.main_clk	= "sr1_fck",
-	.vdd_name	= "mpu_iva",
 	.prcm		= {
 		.omap2 = {
 			.prcm_reg_id = 1,
@@ -2946,10 +2950,15 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 	},
 	.slaves		= omap3_sr1_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3_sr1_slaves),
+	.dev_attr       = &sr1_dev_attr,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 };
 
 /* SR2 */
+static struct omap_sr_dev_attr sr2_dev_attr = {
+	.voltdm_name    = "core",
+};
+
 static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = {
 	&omap3_l4_core__sr2,
 };
@@ -2958,7 +2967,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 	.name		= "sr2_hwmod",
 	.class		= &omap34xx_smartreflex_hwmod_class,
 	.main_clk	= "sr2_fck",
-	.vdd_name	= "core",
 	.prcm		= {
 		.omap2 = {
 			.prcm_reg_id = 1,
@@ -2970,6 +2978,7 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 	},
 	.slaves		= omap3_sr2_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3_sr2_slaves),
+	.dev_attr       = &sr2_dev_attr,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
 					CHIP_IS_OMAP3430ES3_0 |
 					CHIP_IS_OMAP3430ES3_1),
@@ -2980,7 +2989,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 	.name		= "sr2_hwmod",
 	.class		= &omap36xx_smartreflex_hwmod_class,
 	.main_clk	= "sr2_fck",
-	.vdd_name	= "core",
 	.prcm		= {
 		.omap2 = {
 			.prcm_reg_id = 1,
@@ -2992,6 +3000,7 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 	},
 	.slaves		= omap3_sr2_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3_sr2_slaves),
+	.dev_attr       = &sr2_dev_attr,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 };
 
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +16 -3
index 3e88dd3..1331b39 100644
@@ -30,6 +30,7 @@
 
 #include "omap_hwmod_common_data.h"
 
+#include "smartreflex.h"
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
 #include "prm44xx.h"
@@ -3775,6 +3776,10 @@ static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
 };
 
 /* smartreflex_core */
+static struct omap_sr_dev_attr sr_core_dev_attr = {
+	.voltdm_name   = "core",
+};
+
 static struct omap_hwmod omap44xx_smartreflex_core_hwmod;
 static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = {
 	{ .irq = 19 + OMAP44XX_IRQ_GIC_START },
@@ -3809,7 +3814,6 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
 	.mpu_irqs	= omap44xx_smartreflex_core_irqs,
 	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_smartreflex_core_irqs),
 	.main_clk	= "smartreflex_core_fck",
-	.vdd_name	= "core",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
@@ -3817,10 +3821,15 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
 	},
 	.slaves		= omap44xx_smartreflex_core_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
+	.dev_attr       = &sr_core_dev_attr,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
 /* smartreflex_iva */
+static struct omap_sr_dev_attr sr_iva_dev_attr = {
+	.voltdm_name   = "iva",
+};
+
 static struct omap_hwmod omap44xx_smartreflex_iva_hwmod;
 static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = {
 	{ .irq = 102 + OMAP44XX_IRQ_GIC_START },
@@ -3855,7 +3864,6 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
 	.mpu_irqs	= omap44xx_smartreflex_iva_irqs,
 	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_smartreflex_iva_irqs),
 	.main_clk	= "smartreflex_iva_fck",
-	.vdd_name	= "iva",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
@@ -3863,10 +3871,15 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
 	},
 	.slaves		= omap44xx_smartreflex_iva_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
+	.dev_attr       = &sr_iva_dev_attr,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
 /* smartreflex_mpu */
+static struct omap_sr_dev_attr sr_mpu_dev_attr = {
+	.voltdm_name   = "mpu",
+};
+
 static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod;
 static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = {
 	{ .irq = 18 + OMAP44XX_IRQ_GIC_START },
@@ -3901,7 +3914,6 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
 	.mpu_irqs	= omap44xx_smartreflex_mpu_irqs,
 	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_smartreflex_mpu_irqs),
 	.main_clk	= "smartreflex_mpu_fck",
-	.vdd_name	= "mpu",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
@@ -3909,6 +3921,7 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
 	},
 	.slaves		= omap44xx_smartreflex_mpu_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
+	.dev_attr       = &sr_mpu_dev_attr,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
arch/arm/mach-omap2/smartreflex.h +10 -0
index 5f35b9e..9a7f770 100644
@@ -197,6 +197,16 @@ struct omap_sr_nvalue_table {
 };
 
 /**
+ * struct omap_sr_dev_attr - Smartreflex Device attribute.
+ *
+ * @voltdm_name:       Name of voltdomain of SR instance
+ */
+
+struct omap_sr_dev_attr {
+	const char      *voltdm_name;
+};
+
+/**
  * struct omap_sr_data - Smartreflex platform data.
  *
  * @ip_type:		Smartreflex IP type.
arch/arm/mach-omap2/sr_device.c +7 -4
index 2782d3f..65b2aae 100644
@@ -82,6 +82,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 	struct omap_sr_data *sr_data;
 	struct omap_device *od;
 	struct omap_volt_data *volt_data;
+	struct omap_sr_dev_attr *sr_dev_attr;
 	char *name = "smartreflex";
 	static int i;
 
@@ -92,9 +93,11 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 		return -ENOMEM;
 	}
 
-	if (!oh->vdd_name) {
+	sr_dev_attr = (struct omap_sr_dev_attr *)oh->dev_attr;
+	if (!sr_dev_attr->voltdm_name) {
 		pr_err("%s: No voltage domain specified for %s."
-			"Cannot initialize\n", __func__, oh->name);
+				"Cannot initialize\n", __func__,
+					sr_dev_attr->voltdm_name);
 		goto exit;
 	}
 
@@ -102,10 +105,10 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 	sr_data->senn_mod = 0x1;
 	sr_data->senp_mod = 0x1;
 
-	sr_data->voltdm = voltdm_lookup(oh->vdd_name);
+	sr_data->voltdm = voltdm_lookup(sr_dev_attr->voltdm_name);
 	if (IS_ERR(sr_data->voltdm)) {
 		pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
-			__func__, oh->vdd_name);
+			__func__, sr_dev_attr->voltdm_name);
 		goto exit;
 	}
 
arch/arm/plat-omap/include/plat/omap_hwmod.h +0 -1
index a5fa7c1..39d809a 100644
@@ -519,7 +519,6 @@ struct omap_hwmod {
 	const char			*main_clk;
 	struct clk			*_clk;
 	struct omap_hwmod_opt_clk	*opt_clks;
-	char				*vdd_name;
 	struct omap_hwmod_ocp_if	**masters; /* connect to *_IA */
 	struct omap_hwmod_ocp_if	**slaves;  /* connect to *_TA */
 	void				*dev_attr;
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

Quoted 10 lines · Shweta Gulati

To set sr ntarget values ?for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

Quoted 8 lines

---
V3:
? Changed the Subject and Rephrased Commit log as reviewed ? by Nishanth Menon.
?V2:
? Rebased on latest 'pm-wip/voltdm_a' branch.

thanks.. actually it applies on voltdm_c branch as well :) might be good if kevin where to roll it up

Regards,
Nishanth Menon

Quoted 266 lines
?arch/arm/mach-omap2/omap_hwmod_3xxx_data.c ? | ? 17 +++++++++++++----
?arch/arm/mach-omap2/omap_hwmod_44xx_data.c ? | ? 19 ++++++++++++++++---
?arch/arm/mach-omap2/smartreflex.h ? ? ? ? ? ?| ? 10 ++++++++++
?arch/arm/mach-omap2/sr_device.c ? ? ? ? ? ? ?| ? 11 +++++++----
?arch/arm/plat-omap/include/plat/omap_hwmod.h | ? ?1 -

?5 files changed, 46 insertions(+), 12 deletions(-)

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -0
index 3cd91ac..6a704bd 100644
@@ -29,6 +29,7 @@
 

?#include "omap_hwmod_common_data.h"

+#include "smartreflex.h"
?#include "prm-regbits-34xx.h"
?#include "cm-regbits-34xx.h"
?#include "wd_timer.h"

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -0
@@ -2904,6 +2905,10 @@ static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
 ?};
 

?/* SR1 */

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -0
+static struct omap_sr_dev_attr sr1_dev_attr = {
+ ? ? ? .voltdm_name ? = "mpu_iva",
+};
+

?static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = { ? ? ? ?&omap3_l4_core__sr1,
?};

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2912,7 +2917,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 ? ? ? ?.name ? ? ? ? ? = "sr1_hwmod",
 ? ? ? ?.class ? ? ? ? ?= &omap34xx_smartreflex_hwmod_class,
 ? ? ? ?.main_clk ? ? ? = "sr1_fck",
- ? ? ? .vdd_name ? ? ? = "mpu_iva",
 ? ? ? ?.prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ?.omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ?.prcm_reg_id = 1,
@@ -2924,6 +2928,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 ? ? ? ?},
 ? ? ? ?.slaves ? ? ? ? = omap3_sr1_slaves,
 ? ? ? ?.slaves_cnt ? ? = ARRAY_SIZE(omap3_sr1_slaves),
+ ? ? ? .dev_attr ? ? ? = &sr1_dev_attr,

? ? ? ?.omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CHIP_IS_OMAP3430ES3_0 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CHIP_IS_OMAP3430ES3_1),

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2934,7 +2939,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 ? ? ? ?.name ? ? ? ? ? = "sr1_hwmod",
 ? ? ? ?.class ? ? ? ? ?= &omap36xx_smartreflex_hwmod_class,
 ? ? ? ?.main_clk ? ? ? = "sr1_fck",
- ? ? ? .vdd_name ? ? ? = "mpu_iva",
 ? ? ? ?.prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ?.omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ?.prcm_reg_id = 1,
@@ -2946,10 +2950,15 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 ? ? ? ?},
 ? ? ? ?.slaves ? ? ? ? = omap3_sr1_slaves,
 ? ? ? ?.slaves_cnt ? ? = ARRAY_SIZE(omap3_sr1_slaves),
+ ? ? ? .dev_attr ? ? ? = &sr1_dev_attr,
 ? ? ? ?.omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 ?};
 

?/* SR2 */

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -0
+static struct omap_sr_dev_attr sr2_dev_attr = {
+ ? ? ? .voltdm_name ? ?= "core",
+};
+

?static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = { ? ? ? ?&omap3_l4_core__sr2,
?};

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2958,7 +2967,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 ? ? ? ?.name ? ? ? ? ? = "sr2_hwmod",
 ? ? ? ?.class ? ? ? ? ?= &omap34xx_smartreflex_hwmod_class,
 ? ? ? ?.main_clk ? ? ? = "sr2_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ?.prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ?.omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ?.prcm_reg_id = 1,
@@ -2970,6 +2978,7 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 ? ? ? ?},
 ? ? ? ?.slaves ? ? ? ? = omap3_sr2_slaves,
 ? ? ? ?.slaves_cnt ? ? = ARRAY_SIZE(omap3_sr2_slaves),
+ ? ? ? .dev_attr ? ? ? = &sr2_dev_attr,

? ? ? ?.omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CHIP_IS_OMAP3430ES3_0 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CHIP_IS_OMAP3430ES3_1),

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2980,7 +2989,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 ? ? ? ?.name ? ? ? ? ? = "sr2_hwmod",
 ? ? ? ?.class ? ? ? ? ?= &omap36xx_smartreflex_hwmod_class,
 ? ? ? ?.main_clk ? ? ? = "sr2_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ?.prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ?.omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ?.prcm_reg_id = 1,
@@ -2992,6 +3000,7 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 ? ? ? ?},
 ? ? ? ?.slaves ? ? ? ? = omap3_sr2_slaves,
 ? ? ? ?.slaves_cnt ? ? = ARRAY_SIZE(omap3_sr2_slaves),
+ ? ? ? .dev_attr ? ? ? = &sr2_dev_attr,
 ? ? ? ?.omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 ?};
 
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 3e88dd3..1331b39 100644
@@ -30,6 +30,7 @@
 

?#include "omap_hwmod_common_data.h"

+#include "smartreflex.h"
?#include "cm1_44xx.h"
?#include "cm2_44xx.h"
?#include "prm44xx.h"

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
@@ -3775,6 +3776,10 @@ static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
 ?};
 

?/* smartreflex_core */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +4 -0
+static struct omap_sr_dev_attr sr_core_dev_attr = {
+ ? ? ? .voltdm_name ? = "core",
+};
+

?static struct omap_hwmod omap44xx_smartreflex_core_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = { ? ? ? ?{ .irq = 19 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -1
@@ -3809,7 +3814,6 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
 ? ? ? ?.mpu_irqs ? ? ? = omap44xx_smartreflex_core_irqs,
 ? ? ? ?.mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_core_irqs),
 ? ? ? ?.main_clk ? ? ? = "smartreflex_core_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ?.prcm = {
 ? ? ? ? ? ? ? ?.omap4 = {
 ? ? ? ? ? ? ? ? ? ? ? ?.clkctrl_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
@@ -3817,10 +3821,15 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
 ? ? ? ?},
 ? ? ? ?.slaves ? ? ? ? = omap44xx_smartreflex_core_slaves,
 ? ? ? ?.slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
+ ? ? ? .dev_attr ? ? ? = &sr_core_dev_attr,
 ? ? ? ?.omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
 

?/* smartreflex_iva */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +4 -0
+static struct omap_sr_dev_attr sr_iva_dev_attr = {
+ ? ? ? .voltdm_name ? = "iva",
+};
+

?static struct omap_hwmod omap44xx_smartreflex_iva_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = { ? ? ? ?{ .irq = 102 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -1
@@ -3855,7 +3864,6 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
 ? ? ? ?.mpu_irqs ? ? ? = omap44xx_smartreflex_iva_irqs,
 ? ? ? ?.mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_iva_irqs),
 ? ? ? ?.main_clk ? ? ? = "smartreflex_iva_fck",
- ? ? ? .vdd_name ? ? ? = "iva",
 ? ? ? ?.prcm = {
 ? ? ? ? ? ? ? ?.omap4 = {
 ? ? ? ? ? ? ? ? ? ? ? ?.clkctrl_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
@@ -3863,10 +3871,15 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
 ? ? ? ?},
 ? ? ? ?.slaves ? ? ? ? = omap44xx_smartreflex_iva_slaves,
 ? ? ? ?.slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
+ ? ? ? .dev_attr ? ? ? = &sr_iva_dev_attr,
 ? ? ? ?.omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
 

?/* smartreflex_mpu */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +4 -0
+static struct omap_sr_dev_attr sr_mpu_dev_attr = {
+ ? ? ? .voltdm_name ? = "mpu",
+};
+

?static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = { ? ? ? ?{ .irq = 18 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -1
@@ -3901,7 +3914,6 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
 ? ? ? ?.mpu_irqs ? ? ? = omap44xx_smartreflex_mpu_irqs,
 ? ? ? ?.mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_mpu_irqs),
 ? ? ? ?.main_clk ? ? ? = "smartreflex_mpu_fck",
- ? ? ? .vdd_name ? ? ? = "mpu",
 ? ? ? ?.prcm = {
 ? ? ? ? ? ? ? ?.omap4 = {
 ? ? ? ? ? ? ? ? ? ? ? ?.clkctrl_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
@@ -3909,6 +3921,7 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
 ? ? ? ?},
 ? ? ? ?.slaves ? ? ? ? = omap44xx_smartreflex_mpu_slaves,
 ? ? ? ?.slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
+ ? ? ? .dev_attr ? ? ? = &sr_mpu_dev_attr,
 ? ? ? ?.omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
 
arch/arm/mach-omap2/smartreflex.h +0 -0
index 5f35b9e..9a7f770 100644
@@ -197,6 +197,16 @@ struct omap_sr_nvalue_table {
 ?};
 

?/**
+ * struct omap_sr_dev_attr - Smartreflex Device attribute.
+ *
+ * @voltdm_name: ? ? ? Name of voltdomain of SR instance
+ */

arch/arm/mach-omap2/smartreflex.h +6 -0
+
+struct omap_sr_dev_attr {
+ ? ? ? const char ? ? ?*voltdm_name;
+};
+
+/**

?* struct omap_sr_data - Smartreflex platform data. ?*
?* @ip_type: ? ? ? ? ? Smartreflex IP type.

arch/arm/mach-omap2/sr_device.c +3 -1
index 2782d3f..65b2aae 100644
@@ -82,6 +82,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 ? ? ? ?struct omap_sr_data *sr_data;
 ? ? ? ?struct omap_device *od;
 ? ? ? ?struct omap_volt_data *volt_data;
+ ? ? ? struct omap_sr_dev_attr *sr_dev_attr;
 ? ? ? ?char *name = "smartreflex";
 ? ? ? ?static int i;
 
@@ -92,9 +93,11 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 ? ? ? ? ? ? ? ?return -ENOMEM;
 ? ? ? ?}
 
- ? ? ? if (!oh->vdd_name) {
+ ? ? ? sr_dev_attr = (struct omap_sr_dev_attr *)oh->dev_attr;
+ ? ? ? if (!sr_dev_attr->voltdm_name) {

? ? ? ? ? ? ? ?pr_err("%s: No voltage domain specified for %s."
- ? ? ? ? ? ? ? ? ? ? ? "Cannot initialize\n", __func__, oh->name);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Cannot initialize\n", __func__,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sr_dev_attr->voltdm_name); ? ? ? ? ? ? ? ?goto exit;
? ? ? ?}

arch/arm/mach-omap2/sr_device.c +2 -2
@@ -102,10 +105,10 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 ? ? ? ?sr_data->senn_mod = 0x1;
 ? ? ? ?sr_data->senp_mod = 0x1;
 
- ? ? ? sr_data->voltdm = voltdm_lookup(oh->vdd_name);
+ ? ? ? sr_data->voltdm = voltdm_lookup(sr_dev_attr->voltdm_name);
 ? ? ? ?if (IS_ERR(sr_data->voltdm)) {
 ? ? ? ? ? ? ? ?pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
- ? ? ? ? ? ? ? ? ? ? ? __func__, oh->vdd_name);
+ ? ? ? ? ? ? ? ? ? ? ? __func__, sr_dev_attr->voltdm_name);
 ? ? ? ? ? ? ? ?goto exit;
 ? ? ? ?}
 
arch/arm/plat-omap/include/plat/omap_hwmod.h +0 -1
index a5fa7c1..39d809a 100644
@@ -519,7 +519,6 @@ struct omap_hwmod {
 ? ? ? ?const char ? ? ? ? ? ? ? ? ? ? ?*main_clk;
 ? ? ? ?struct clk ? ? ? ? ? ? ? ? ? ? ?*_clk;
 ? ? ? ?struct omap_hwmod_opt_clk ? ? ? *opt_clks;
- ? ? ? char ? ? ? ? ? ? ? ? ? ? ? ? ? ?*vdd_name;

? ? ? ?struct omap_hwmod_ocp_if ? ? ? ?**masters; /* connect to *_IA */ ? ? ? ?struct omap_hwmod_ocp_if ? ? ? ?**slaves; ?/* connect to *_TA */ ? ? ? ?void ? ? ? ? ? ? ? ? ? ? ? ? ? ?*dev_attr;
--
1.7.0.4

#2 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

Quoted 19 lines · Nishanth
Quoted 10 lines · Shweta Gulati

To set sr ntarget values ?for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

Quoted 8 lines

---
V3:
? Changed the Subject and Rephrased Commit log as reviewed ? by Nishanth Menon.
?V2:
? Rebased on latest 'pm-wip/voltdm_a' branch.

Quoted 1 line

thanks.. actually it applies on voltdm_c branch as well :)

Can this be taken as an Ack? if so, Shweta please add an Acked-by from Nishanth in your updated patch. Thanks.

Quoted 2 lines

might be
good if kevin where to roll it up

Yes, I'll pick this one up (after Todd's comments are addressed.)

Kevin

#3 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

Kevin,

Quoted 23 lines · Kevin Hilman
Quoted 19 lines · Nishanth
Quoted 10 lines · Shweta Gulati

To set sr ntarget values ?for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

Quoted 8 lines

---
V3:
? Changed the Subject and Rephrased Commit log as reviewed ? by Nishanth Menon.
?V2:
? Rebased on latest 'pm-wip/voltdm_a' branch.

Quoted 1 line

thanks.. actually it applies on voltdm_c branch as well :)

Quoted 7 lines

Can this be taken as an Ack? ?if so, Shweta please add an Acked-by from Nishanth in your updated patch. ?Thanks.

Quoted 2 lines

might be
good if kevin where to roll it up

Yes, I'll pick this one up (after Todd's comments are addressed.)

I would address all the comments and post updated version soon, thanks.

Quoted 3 lines

Kevin

Signature · 3 lines
Thanks,
Regards,
Shweta
#4 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

In reply to Kevin Hilman
Quoted 21 lines · Kevin Hilman
Quoted 19 lines · Nishanth
Quoted 18 lines · Shweta Gulati

To set sr ntarget values ?for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

---
V3:
? Changed the Subject and Rephrased Commit log as reviewed ? by Nishanth Menon.
?V2:
? Rebased on latest 'pm-wip/voltdm_a' branch.

Quoted 4 lines
Quoted 1 line

thanks.. actually it applies on voltdm_c branch as well :)

Can this be taken as an Ack? ?if so, Shweta please add an Acked-by from Nishanth in your updated patch. ?Thanks.

yep - will merge the next rev and do a dry run as well..

Regards,
Nishanth Menon

#5 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

In reply to Shweta Gulati

On Wed, May 11, 2011 at 2:12 AM, Shweta Gulati <[email protected]> wrote:
...

Quoted 14 lines
arch/arm/mach-omap2/sr_device.c +1 -0
index 2782d3f..65b2aae 100644
@@ -82,6 +82,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
       struct omap_sr_data *sr_data;
       struct omap_device *od;
       struct omap_volt_data *volt_data;
+       struct omap_sr_dev_attr *sr_dev_attr;
       char *name = "smartreflex";
       static int i;
 

arch/arm/mach-omap2/sr_device.c static int sr_dev_init(struct omap_hwmod *oh, void · line 100

Quoted 9 lines
arch/arm/mach-omap2/sr_device.c +2 -1
@@ -92,9 +93,11 @@ static int sr_dev_init(struct omap_hwmod *oh, void
 *user)
               return -ENOMEM;
       }
 
-       if (!oh->vdd_name) {
+       sr_dev_attr = (struct omap_sr_dev_attr *)oh->dev_attr;
+       if (!sr_dev_attr->voltdm_name) {
               pr_err("%s: No voltage domain specified for %s."
 

Suggest if (!sr_dev_attr || !sr_dev_attr->voltdm_name) to catch this error.

arch/arm/mach-omap2/sr_device.c static int sr_dev_init(struct omap_hwmod *oh, void *user) · line 103

Quoted 4 lines
arch/arm/mach-omap2/sr_device.c +2 -1
-                       "Cannot initialize\n", __func__, oh->name);
+                               "Cannot initialize\n", __func__,
+                                       sr_dev_attr->voltdm_name);
 

Should leave the hwmod's oh->name as the pr_err param, sr_dev_attr->voltdm_name has just been verified bogus.

Todd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110511/561cf08c/attachment-0001.html>

#6 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

[Another try with a different email client, sorry for any dups.]
...

Quoted 14 lines
arch/arm/mach-omap2/sr_device.c +1 -0
index 2782d3f..65b2aae 100644
@@ -82,6 +82,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
       struct omap_sr_data *sr_data;
       struct omap_device *od;
       struct omap_volt_data *volt_data;
+       struct omap_sr_dev_attr *sr_dev_attr;
       char *name = "smartreflex";
       static int i;
 

arch/arm/mach-omap2/sr_device.c static int sr_dev_init(struct omap_hwmod *oh, void · line 100

Quoted 9 lines
arch/arm/mach-omap2/sr_device.c +2 -1
@@ -92,9 +93,11 @@ static int sr_dev_init(struct omap_hwmod *oh, void
 *user)
               return -ENOMEM;
       }
 
-       if (!oh->vdd_name) {
+       sr_dev_attr = (struct omap_sr_dev_attr *)oh->dev_attr;
+       if (!sr_dev_attr->voltdm_name) {
               pr_err("%s: No voltage domain specified for %s."
 

Suggest if (!sr_dev_attr || !sr_dev_attr->voltdm_name) to catch this error.

arch/arm/mach-omap2/sr_device.c static int sr_dev_init(struct omap_hwmod *oh, void *user) · line 103

Quoted 4 lines
arch/arm/mach-omap2/sr_device.c +2 -1
-                       "Cannot initialize\n", __func__, oh->name);
+                               "Cannot initialize\n", __func__,
+                                       sr_dev_attr->voltdm_name);
 

Should leave the hwmod's oh->name as the pr_err param, sr_dev_attr->voltdm_name has just been verified bogus.

Todd

#7 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

In reply to Todd Poynor

Hi,

Quoted 22 lines · Todd Poynor

On Wed, May 11, 2011 at 2:12 AM, Shweta Gulati <[email protected]> wrote:
...

Quoted 20 lines
arch/arm/mach-omap2/sr_device.c +1 -0
index 2782d3f..65b2aae 100644
@@ -82,6 +82,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void
 *user)
 ? ? ? ?struct omap_sr_data *sr_data;
 ? ? ? ?struct omap_device *od;
 ? ? ? ?struct omap_volt_data *volt_data;
+ ? ? ? struct omap_sr_dev_attr *sr_dev_attr;
 ? ? ? ?char *name = "smartreflex";
 ? ? ? ?static int i;
@@ -92,9 +93,11 @@ static int sr_dev_init(struct omap_hwmod *oh, void
 *user)
 ? ? ? ? ? ? ? ?return -ENOMEM;
 ? ? ? ?}
 
Quoted 6 lines
Quoted 4 lines
arch/arm/mach-omap2/sr_device.c +2 -1
- ? ? ? if (!oh->vdd_name) {
+ ? ? ? sr_dev_attr = (struct omap_sr_dev_attr *)oh->dev_attr;
+ ? ? ? if (!sr_dev_attr->voltdm_name) {

? ? ? ? ? ? ? ?pr_err("%s: No voltage domain specified for %s."

Suggest if (!sr_dev_attr ||?!sr_dev_attr->voltdm_name) to catch this error.

Fair enough, Thanks for catching
NULL pointer shouldn't be deferenced.

Quoted 8 lines
Quoted 5 lines

- ? ? ? ? ? ? ? ? ? ? ? "Cannot initialize\n", __func__, oh->name);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Cannot initialize\n", __func__,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sr_dev_attr->voltdm_name);

Should leave the hwmod's oh->name as the pr_err param,?sr_dev_attr->voltdm_name has just been verified bogus.

Fair, will do.

Quoted 3 lines

Todd

Thanks for reviewing.

Signature · 3 lines
Thanks,
Regards,
Shweta
#8 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

In reply to Shweta Gulati

Hi Shweta,

Quoted 19 lines · Shweta

To set sr ntarget values for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

---
V3:
Changed the Subject and Rephrased Commit log as reviewed by Nishanth Menon.
V2:
Rebased on latest 'pm-wip/voltdm_a' branch.

Quoted 2 lines
  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c   |   17 +++++++++++++----
  arch/arm/mach-omap2/omap_hwmod_44xx_data.c   |   19 ++++++++++++++++---

Since this patch is touching some hwmod files, it will be good to Cc Paul and me. It is far from obvious from the subject that hwmod data are involved in this patch.

Quoted 113 lines
  arch/arm/mach-omap2/smartreflex.h            |   10 ++++++++++
  arch/arm/mach-omap2/sr_device.c              |   11 +++++++----
  arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 -
  5 files changed, 46 insertions(+), 12 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +13 -4
index 3cd91ac..6a704bd 100644
@@ -29,6 +29,7 @@
 
  #include "omap_hwmod_common_data.h"
 
+#include "smartreflex.h"
  #include "prm-regbits-34xx.h"
  #include "cm-regbits-34xx.h"
  #include "wd_timer.h"
@@ -2904,6 +2905,10 @@ static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
  };
 
  /* SR1 */
+static struct omap_sr_dev_attr sr1_dev_attr = {
+       .voltdm_name   = "mpu_iva",
+};
+
  static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = {
         &omap3_l4_core__sr1,
  };
@@ -2912,7 +2917,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
         .name           = "sr1_hwmod",
         .class          =&omap34xx_smartreflex_hwmod_class,
         .main_clk       = "sr1_fck",
-       .vdd_name       = "mpu_iva",
         .prcm           = {
                 .omap2 = {
                         .prcm_reg_id = 1,
@@ -2924,6 +2928,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
         },
         .slaves         = omap3_sr1_slaves,
         .slaves_cnt     = ARRAY_SIZE(omap3_sr1_slaves),
+       .dev_attr       =&sr1_dev_attr,
         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
                                         CHIP_IS_OMAP3430ES3_0 |
                                         CHIP_IS_OMAP3430ES3_1),
@@ -2934,7 +2939,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
         .name           = "sr1_hwmod",
         .class          =&omap36xx_smartreflex_hwmod_class,
         .main_clk       = "sr1_fck",
-       .vdd_name       = "mpu_iva",
         .prcm           = {
                 .omap2 = {
                         .prcm_reg_id = 1,
@@ -2946,10 +2950,15 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
         },
         .slaves         = omap3_sr1_slaves,
         .slaves_cnt     = ARRAY_SIZE(omap3_sr1_slaves),
+       .dev_attr       =&sr1_dev_attr,
         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
  };
 
  /* SR2 */
+static struct omap_sr_dev_attr sr2_dev_attr = {
+       .voltdm_name    = "core",
+};
+
  static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = {
         &omap3_l4_core__sr2,
  };
@@ -2958,7 +2967,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
         .name           = "sr2_hwmod",
         .class          =&omap34xx_smartreflex_hwmod_class,
         .main_clk       = "sr2_fck",
-       .vdd_name       = "core",
         .prcm           = {
                 .omap2 = {
                         .prcm_reg_id = 1,
@@ -2970,6 +2978,7 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
         },
         .slaves         = omap3_sr2_slaves,
         .slaves_cnt     = ARRAY_SIZE(omap3_sr2_slaves),
+       .dev_attr       =&sr2_dev_attr,
         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
                                         CHIP_IS_OMAP3430ES3_0 |
                                         CHIP_IS_OMAP3430ES3_1),
@@ -2980,7 +2989,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
         .name           = "sr2_hwmod",
         .class          =&omap36xx_smartreflex_hwmod_class,
         .main_clk       = "sr2_fck",
-       .vdd_name       = "core",
         .prcm           = {
                 .omap2 = {
                         .prcm_reg_id = 1,
@@ -2992,6 +3000,7 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
         },
         .slaves         = omap3_sr2_slaves,
         .slaves_cnt     = ARRAY_SIZE(omap3_sr2_slaves),
+       .dev_attr       =&sr2_dev_attr,
         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
  };
 
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
index 3e88dd3..1331b39 100644
@@ -30,6 +30,7 @@
 
  #include "omap_hwmod_common_data.h"
 
+#include "smartreflex.h"
  #include "cm1_44xx.h"
  #include "cm2_44xx.h"
  #include "prm44xx.h"

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { · line 3779

Quoted 4 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3775,6 +3776,10 @@ static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
  };
 
  /* smartreflex_core */
+static struct omap_sr_dev_attr sr_core_dev_attr = {

In order to stick to the convention used so far for the other dev_attr, please use the following :
+/* smartreflex_core dev_attr */
+static struct omap_smartreflex_dev_attr smartreflex_core_dev_attr = {

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { · line 3781

Quoted 2 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +2 -0
+       .voltdm_name   = "core",
+};

And you should move it on top of the omap44xx_smartreflex_XXX_hwmod structure.

Quoted 13 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -1
+
  static struct omap_hwmod omap44xx_smartreflex_core_hwmod;
  static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = {
         { .irq = 19 + OMAP44XX_IRQ_GIC_START },
@@ -3809,7 +3814,6 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
         .mpu_irqs       = omap44xx_smartreflex_core_irqs,
         .mpu_irqs_cnt   = ARRAY_SIZE(omap44xx_smartreflex_core_irqs),
         .main_clk       = "smartreflex_core_fck",
-       .vdd_name       = "core",
         .prcm = {
                 .omap4 = {
                         .clkctrl_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { · line 3824

Quoted 4 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3817,10 +3821,15 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
         },
         .slaves         = omap44xx_smartreflex_core_slaves,
         .slaves_cnt     = ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
+       .dev_attr       =&sr_core_dev_attr,

Move .dev_attr before the .slaves.

The two last points are applicable for every SR instances.

Quoted 56 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +10 -2
         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
  };
 
  /* smartreflex_iva */
+static struct omap_sr_dev_attr sr_iva_dev_attr = {
+       .voltdm_name   = "iva",
+};
+
  static struct omap_hwmod omap44xx_smartreflex_iva_hwmod;
  static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = {
         { .irq = 102 + OMAP44XX_IRQ_GIC_START },
@@ -3855,7 +3864,6 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
         .mpu_irqs       = omap44xx_smartreflex_iva_irqs,
         .mpu_irqs_cnt   = ARRAY_SIZE(omap44xx_smartreflex_iva_irqs),
         .main_clk       = "smartreflex_iva_fck",
-       .vdd_name       = "iva",
         .prcm = {
                 .omap4 = {
                         .clkctrl_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
@@ -3863,10 +3871,15 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
         },
         .slaves         = omap44xx_smartreflex_iva_slaves,
         .slaves_cnt     = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
+       .dev_attr       =&sr_iva_dev_attr,
         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
  };
 
  /* smartreflex_mpu */
+static struct omap_sr_dev_attr sr_mpu_dev_attr = {
+       .voltdm_name   = "mpu",
+};
+
  static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod;
  static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = {
         { .irq = 18 + OMAP44XX_IRQ_GIC_START },
@@ -3901,7 +3914,6 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
         .mpu_irqs       = omap44xx_smartreflex_mpu_irqs,
         .mpu_irqs_cnt   = ARRAY_SIZE(omap44xx_smartreflex_mpu_irqs),
         .main_clk       = "smartreflex_mpu_fck",
-       .vdd_name       = "mpu",
         .prcm = {
                 .omap4 = {
                         .clkctrl_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
@@ -3909,6 +3921,7 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
         },
         .slaves         = omap44xx_smartreflex_mpu_slaves,
         .slaves_cnt     = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
+       .dev_attr       =&sr_mpu_dev_attr,
         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
  };
 
arch/arm/mach-omap2/smartreflex.h +0 -0
index 5f35b9e..9a7f770 100644

arch/arm/mach-omap2/smartreflex.h struct omap_sr_nvalue_table { · line 202

Quoted 6 lines
arch/arm/mach-omap2/smartreflex.h +3 -0
@@ -197,6 +197,16 @@ struct omap_sr_nvalue_table {
  };
 
  /**
+ * struct omap_sr_dev_attr - Smartreflex Device attribute.
+ *
+ * @voltdm_name:       Name of voltdomain of SR instance

You should be more specific. This is the name of the SR sensor voltage domain.
The Smartreflex controller IPs are all inside the CORE voltage domain.

Regards,
Benoit

#9 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

Hi,

Quoted 23 lines · Benoit

Hi Shweta,

Quoted 20 lines · Shweta

To set sr ntarget values ?for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

---
V3:
? ?Changed the Subject and Rephrased Commit log as reviewed ? ?by Nishanth Menon.
?V2:
? ?Rebased on latest 'pm-wip/voltdm_a' branch.

Quoted 6 lines
Quoted 2 lines

?arch/arm/mach-omap2/omap_hwmod_3xxx_data.c ? | ? 17 +++++++++++++---- ?arch/arm/mach-omap2/omap_hwmod_44xx_data.c ? | ? 19 ++++++++++++++++---

Since this patch is touching some hwmod files, it will be good to Cc Paul and me. It is far from obvious from the subject that hwmod data are involved in this patch.

Will do

Quoted 127 lines
Quoted 119 lines
?arch/arm/mach-omap2/smartreflex.h ? ? ? ? ? ?| ? 10 ++++++++++
?arch/arm/mach-omap2/sr_device.c ? ? ? ? ? ? ?| ? 11 +++++++----
?arch/arm/plat-omap/include/plat/omap_hwmod.h | ? ?1 -

?5 files changed, 46 insertions(+), 12 deletions(-)

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -0
index 3cd91ac..6a704bd 100644
@@ -29,6 +29,7 @@
 

?#include "omap_hwmod_common_data.h"

+#include "smartreflex.h"
?#include "prm-regbits-34xx.h"
?#include "cm-regbits-34xx.h"
?#include "wd_timer.h"

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -0
@@ -2904,6 +2905,10 @@ static struct omap_hwmod_class
 omap36xx_smartreflex_hwmod_class = {
 ?};
 

?/* SR1 */

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -0
+static struct omap_sr_dev_attr sr1_dev_attr = {
+ ? ? ? .voltdm_name ? = "mpu_iva",
+};
+

?static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = { ? ? ? ? &omap3_l4_core__sr1,
?};

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2912,7 +2917,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr1_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap34xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr1_fck",
- ? ? ? .vdd_name ? ? ? = "mpu_iva",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2924,6 +2928,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr1_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr1_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr1_dev_attr,

? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_0 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_1),

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2934,7 +2939,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr1_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap36xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr1_fck",
- ? ? ? .vdd_name ? ? ? = "mpu_iva",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2946,10 +2950,15 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr1_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr1_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr1_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 ?};
 

?/* SR2 */

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -0
+static struct omap_sr_dev_attr sr2_dev_attr = {
+ ? ? ? .voltdm_name ? ?= "core",
+};
+

?static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = { ? ? ? ? &omap3_l4_core__sr2,
?};

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2958,7 +2967,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr2_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap34xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr2_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2970,6 +2978,7 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr2_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr2_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr2_dev_attr,

? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_0 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_1),

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2980,7 +2989,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr2_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap36xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr2_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2992,6 +3000,7 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr2_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr2_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr2_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 ?};
 
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 3e88dd3..1331b39 100644
@@ -30,6 +30,7 @@
 

?#include "omap_hwmod_common_data.h"

+#include "smartreflex.h"
?#include "cm1_44xx.h"
?#include "cm2_44xx.h"
?#include "prm44xx.h"

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
@@ -3775,6 +3776,10 @@ static struct omap_hwmod_class
 omap44xx_smartreflex_hwmod_class = {
 ?};
 
Quoted 2 lines

?/* smartreflex_core */
+static struct omap_sr_dev_attr sr_core_dev_attr = {

In order to stick to the convention used so far for the other dev_attr, please use the following :

(quoted diff) +2 -0
+/* smartreflex_core dev_attr */
+static struct omap_smartreflex_dev_attr smartreflex_core_dev_attr = {
Quoted 5 lines
Quoted 2 lines

+ ? ? ? .voltdm_name ? = "core",
+};

And you should move it on top of the omap44xx_smartreflex_XXX_hwmod structure.

Will do.

Quoted 22 lines
Quoted 14 lines

+
?static struct omap_hwmod omap44xx_smartreflex_core_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = { ? ? ? ? { .irq = 19 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -1
@@ -3809,7 +3814,6 @@ static struct omap_hwmod
 omap44xx_smartreflex_core_hwmod = {
 ? ? ? ? .mpu_irqs ? ? ? = omap44xx_smartreflex_core_irqs,
 ? ? ? ? .mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_core_irqs),
 ? ? ? ? .main_clk ? ? ? = "smartreflex_core_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ? .prcm = {
 ? ? ? ? ? ? ? ? .omap4 = {

? ? ? ? ? ? ? ? ? ? ? ? .clkctrl_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod · line 3825

Quoted 5 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3817,10 +3821,15 @@ static struct omap_hwmod
 omap44xx_smartreflex_core_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap44xx_smartreflex_core_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr_core_dev_attr,

Move .dev_attr before the .slaves.

Quoted 1 line

The two last points are applicable for every SR instances.

Ok.

Quoted 63 lines
Quoted 63 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
 

?/* smartreflex_iva */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +4 -0
+static struct omap_sr_dev_attr sr_iva_dev_attr = {
+ ? ? ? .voltdm_name ? = "iva",
+};
+

?static struct omap_hwmod omap44xx_smartreflex_iva_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = { ? ? ? ? { .irq = 102 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -1
@@ -3855,7 +3864,6 @@ static struct omap_hwmod
 omap44xx_smartreflex_iva_hwmod = {
 ? ? ? ? .mpu_irqs ? ? ? = omap44xx_smartreflex_iva_irqs,
 ? ? ? ? .mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_iva_irqs),
 ? ? ? ? .main_clk ? ? ? = "smartreflex_iva_fck",
- ? ? ? .vdd_name ? ? ? = "iva",
 ? ? ? ? .prcm = {
 ? ? ? ? ? ? ? ? .omap4 = {

? ? ? ? ? ? ? ? ? ? ? ? .clkctrl_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3863,10 +3871,15 @@ static struct omap_hwmod
 omap44xx_smartreflex_iva_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap44xx_smartreflex_iva_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr_iva_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
 

?/* smartreflex_mpu */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +4 -0
+static struct omap_sr_dev_attr sr_mpu_dev_attr = {
+ ? ? ? .voltdm_name ? = "mpu",
+};
+

?static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = { ? ? ? ? { .irq = 18 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -1
@@ -3901,7 +3914,6 @@ static struct omap_hwmod
 omap44xx_smartreflex_mpu_hwmod = {
 ? ? ? ? .mpu_irqs ? ? ? = omap44xx_smartreflex_mpu_irqs,
 ? ? ? ? .mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_mpu_irqs),
 ? ? ? ? .main_clk ? ? ? = "smartreflex_mpu_fck",
- ? ? ? .vdd_name ? ? ? = "mpu",
 ? ? ? ? .prcm = {
 ? ? ? ? ? ? ? ? .omap4 = {

? ? ? ? ? ? ? ? ? ? ? ? .clkctrl_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3909,6 +3921,7 @@ static struct omap_hwmod
 omap44xx_smartreflex_mpu_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap44xx_smartreflex_mpu_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr_mpu_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
arch/arm/mach-omap2/smartreflex.h +0 -0
index 5f35b9e..9a7f770 100644
@@ -197,6 +197,16 @@ struct omap_sr_nvalue_table {
 ?};
 
Quoted 8 lines
Quoted 4 lines

?/**
+ * struct omap_sr_dev_attr - Smartreflex Device attribute.
+ *
+ * @voltdm_name: ? ? ? Name of voltdomain of SR instance

You should be more specific. This is the name of the SR sensor voltage domain.
The Smartreflex controller IPs are all inside the CORE voltage domain.

Ok.

Quoted 3 lines

Regards,
Benoit

Signature · 3 lines
Thanks,
Regards,
Shweta
#10 lore raw

PATCH v3 1/1 OMAP3+: SR Layer Cleanup

Hi,

Quoted 160 lines · Shweta

Hi,

Quoted 23 lines · Benoit

Hi Shweta,

Quoted 20 lines · Shweta

To set sr ntarget values ?for all volt_domain, volt_table is retrieved by doing a look_up of 'vdd_name' field from omap_hwmod but voltage domain pointer does not belong to omap_hwmod and is not used anywhere else. As a part of voltage layer and SR Layer clean up volt pointer is removed from omap_hwmod and added in dev attributes of SR.

Tested on OMAP3630 SDP and OMAP4430 SDP Board

---
V3:
? ?Changed the Subject and Rephrased Commit log as reviewed ? ?by Nishanth Menon.
?V2:
? ?Rebased on latest 'pm-wip/voltdm_a' branch.

Quoted 6 lines
Quoted 2 lines

?arch/arm/mach-omap2/omap_hwmod_3xxx_data.c ? | ? 17 +++++++++++++---- ?arch/arm/mach-omap2/omap_hwmod_44xx_data.c ? | ? 19 ++++++++++++++++---

Since this patch is touching some hwmod files, it will be good to Cc Paul and me. It is far from obvious from the subject that hwmod data are involved in this patch.

Will do

Quoted 127 lines
Quoted 119 lines
?arch/arm/mach-omap2/smartreflex.h ? ? ? ? ? ?| ? 10 ++++++++++
?arch/arm/mach-omap2/sr_device.c ? ? ? ? ? ? ?| ? 11 +++++++----
?arch/arm/plat-omap/include/plat/omap_hwmod.h | ? ?1 -

?5 files changed, 46 insertions(+), 12 deletions(-)

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -0
index 3cd91ac..6a704bd 100644
@@ -29,6 +29,7 @@
 

?#include "omap_hwmod_common_data.h"

+#include "smartreflex.h"
?#include "prm-regbits-34xx.h"
?#include "cm-regbits-34xx.h"
?#include "wd_timer.h"

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -0
@@ -2904,6 +2905,10 @@ static struct omap_hwmod_class
 omap36xx_smartreflex_hwmod_class = {
 ?};
 

?/* SR1 */

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -0
+static struct omap_sr_dev_attr sr1_dev_attr = {
+ ? ? ? .voltdm_name ? = "mpu_iva",
+};
+

?static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = { ? ? ? ? &omap3_l4_core__sr1,
?};

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2912,7 +2917,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr1_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap34xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr1_fck",
- ? ? ? .vdd_name ? ? ? = "mpu_iva",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2924,6 +2928,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr1_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr1_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr1_dev_attr,

? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_0 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_1),

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2934,7 +2939,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr1_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap36xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr1_fck",
- ? ? ? .vdd_name ? ? ? = "mpu_iva",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2946,10 +2950,15 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr1_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr1_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr1_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 ?};
 

?/* SR2 */

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -0
+static struct omap_sr_dev_attr sr2_dev_attr = {
+ ? ? ? .voltdm_name ? ?= "core",
+};
+

?static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = { ? ? ? ? &omap3_l4_core__sr2,
?};

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2958,7 +2967,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr2_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap34xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr2_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2970,6 +2978,7 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr2_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr2_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr2_dev_attr,

? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_0 | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CHIP_IS_OMAP3430ES3_1),

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -2980,7 +2989,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 ? ? ? ? .name ? ? ? ? ? = "sr2_hwmod",
 ? ? ? ? .class ? ? ? ? ?=&omap36xx_smartreflex_hwmod_class,
 ? ? ? ? .main_clk ? ? ? = "sr2_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ? .prcm ? ? ? ? ? = {
 ? ? ? ? ? ? ? ? .omap2 = {
 ? ? ? ? ? ? ? ? ? ? ? ? .prcm_reg_id = 1,
@@ -2992,6 +3000,7 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap3_sr2_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap3_sr2_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr2_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
 ?};
 
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 3e88dd3..1331b39 100644
@@ -30,6 +30,7 @@
 

?#include "omap_hwmod_common_data.h"

+#include "smartreflex.h"
?#include "cm1_44xx.h"
?#include "cm2_44xx.h"
?#include "prm44xx.h"

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
@@ -3775,6 +3776,10 @@ static struct omap_hwmod_class
 omap44xx_smartreflex_hwmod_class = {
 ?};
 
Quoted 2 lines

?/* smartreflex_core */
+static struct omap_sr_dev_attr sr_core_dev_attr = {

In order to stick to the convention used so far for the other dev_attr, please use the following :

(quoted diff) +2 -0
+/* smartreflex_core dev_attr */
+static struct omap_smartreflex_dev_attr smartreflex_core_dev_attr = {
Quoted 27 lines
Quoted 5 lines
Quoted 2 lines

+ ? ? ? .voltdm_name ? = "core",
+};

And you should move it on top of the omap44xx_smartreflex_XXX_hwmod structure.

Will do.

Quoted 21 lines
Quoted 14 lines

+
?static struct omap_hwmod omap44xx_smartreflex_core_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = { ? ? ? ? { .irq = 19 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -1
@@ -3809,7 +3814,6 @@ static struct omap_hwmod
 omap44xx_smartreflex_core_hwmod = {
 ? ? ? ? .mpu_irqs ? ? ? = omap44xx_smartreflex_core_irqs,
 ? ? ? ? .mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_core_irqs),
 ? ? ? ? .main_clk ? ? ? = "smartreflex_core_fck",
- ? ? ? .vdd_name ? ? ? = "core",
 ? ? ? ? .prcm = {
 ? ? ? ? ? ? ? ? .omap4 = {

? ? ? ? ? ? ? ? ? ? ? ? .clkctrl_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod · line 3825

Quoted 5 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3817,10 +3821,15 @@ static struct omap_hwmod
 omap44xx_smartreflex_core_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap44xx_smartreflex_core_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr_core_dev_attr,

Move .dev_attr before the .slaves.

Following the convention used with other dev_attr, all dev_attr are defined after slaves.

Quoted 85 lines
Quoted 1 line

The two last points are applicable for every SR instances.

Ok.

Quoted 63 lines
Quoted 63 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
 

?/* smartreflex_iva */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +4 -0
+static struct omap_sr_dev_attr sr_iva_dev_attr = {
+ ? ? ? .voltdm_name ? = "iva",
+};
+

?static struct omap_hwmod omap44xx_smartreflex_iva_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = { ? ? ? ? { .irq = 102 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -1
@@ -3855,7 +3864,6 @@ static struct omap_hwmod
 omap44xx_smartreflex_iva_hwmod = {
 ? ? ? ? .mpu_irqs ? ? ? = omap44xx_smartreflex_iva_irqs,
 ? ? ? ? .mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_iva_irqs),
 ? ? ? ? .main_clk ? ? ? = "smartreflex_iva_fck",
- ? ? ? .vdd_name ? ? ? = "iva",
 ? ? ? ? .prcm = {
 ? ? ? ? ? ? ? ? .omap4 = {

? ? ? ? ? ? ? ? ? ? ? ? .clkctrl_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3863,10 +3871,15 @@ static struct omap_hwmod
 omap44xx_smartreflex_iva_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap44xx_smartreflex_iva_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr_iva_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
 

?/* smartreflex_mpu */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +4 -0
+static struct omap_sr_dev_attr sr_mpu_dev_attr = {
+ ? ? ? .voltdm_name ? = "mpu",
+};
+

?static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod; ?static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = { ? ? ? ? { .irq = 18 + OMAP44XX_IRQ_GIC_START },

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -1
@@ -3901,7 +3914,6 @@ static struct omap_hwmod
 omap44xx_smartreflex_mpu_hwmod = {
 ? ? ? ? .mpu_irqs ? ? ? = omap44xx_smartreflex_mpu_irqs,
 ? ? ? ? .mpu_irqs_cnt ? = ARRAY_SIZE(omap44xx_smartreflex_mpu_irqs),
 ? ? ? ? .main_clk ? ? ? = "smartreflex_mpu_fck",
- ? ? ? .vdd_name ? ? ? = "mpu",
 ? ? ? ? .prcm = {
 ? ? ? ? ? ? ? ? .omap4 = {

? ? ? ? ? ? ? ? ? ? ? ? .clkctrl_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,

arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -0
@@ -3909,6 +3921,7 @@ static struct omap_hwmod
 omap44xx_smartreflex_mpu_hwmod = {
 ? ? ? ? },
 ? ? ? ? .slaves ? ? ? ? = omap44xx_smartreflex_mpu_slaves,
 ? ? ? ? .slaves_cnt ? ? = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
+ ? ? ? .dev_attr ? ? ? =&sr_mpu_dev_attr,
 ? ? ? ? .omap_chip ? ? ?= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 ?};
arch/arm/mach-omap2/smartreflex.h +0 -0
index 5f35b9e..9a7f770 100644
@@ -197,6 +197,16 @@ struct omap_sr_nvalue_table {
 ?};
 
Quoted 8 lines
Quoted 4 lines

?/**
+ * struct omap_sr_dev_attr - Smartreflex Device attribute.
+ *
+ * @voltdm_name: ? ? ? Name of voltdomain of SR instance

You should be more specific. This is the name of the SR sensor voltage domain.
The Smartreflex controller IPs are all inside the CORE voltage domain.

Ok.

Quoted 3 lines

Regards,
Benoit

--
Thanks,
Regards,
Shweta

Signature · 3 lines
Thanks,
Regards,
Shweta