[v2,1/6] ARM: OMAP4: PRM: Remove hardcoding of PRM_IO_PMCTRL_OFFSET register
diff mbox

Message ID 1436334148-9309-2-git-send-email-j-keerthy@ti.com
State New
Headers show

Commit Message

Keerthy July 8, 2015, 5:42 a.m. UTC
PRM_IO_PMCTRL_OFFSET need not be same for all SOCs hence
remove hardcoding and use the value provided by the omap_prcm_irq_setup
structure.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/mach-omap2/prcm-common.h |  1 +
 arch/arm/mach-omap2/prm44xx.c     | 11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

Comments

Paul Walmsley July 16, 2015, 1:54 a.m. UTC | #1
Hi

a few minor comments

On Wed, 8 Jul 2015, Keerthy wrote:

> PRM_IO_PMCTRL_OFFSET need not be same for all SOCs hence
> remove hardcoding and use the value provided by the omap_prcm_irq_setup
> structure.

Please mention here that the reason why you're making this change is to 
support AM437x. 

> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  arch/arm/mach-omap2/prcm-common.h |  1 +
>  arch/arm/mach-omap2/prm44xx.c     | 11 ++++++-----
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
> index 6ae0b3a..2e60406 100644
> --- a/arch/arm/mach-omap2/prcm-common.h
> +++ b/arch/arm/mach-omap2/prcm-common.h
> @@ -494,6 +494,7 @@ struct omap_prcm_irq {
>  struct omap_prcm_irq_setup {
>  	u16 ack;
>  	u16 mask;
> +	u16 pm_ctrl;

Please add a kerneldoc structure documentation line for this new field, to 
match the existing documentation here.

>  	u8 nr_regs;
>  	u8 nr_irqs;
>  	const struct omap_prcm_irq *irqs;
> diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
> index 4541700..8149e5a 100644
> --- a/arch/arm/mach-omap2/prm44xx.c
> +++ b/arch/arm/mach-omap2/prm44xx.c
> @@ -45,6 +45,7 @@ static const struct omap_prcm_irq omap4_prcm_irqs[] = {
>  static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
>  	.ack			= OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
>  	.mask			= OMAP4_PRM_IRQENABLE_MPU_OFFSET,
> +	.pm_ctrl		= OMAP4_PRM_IO_PMCTRL_OFFSET,
>  	.nr_regs		= 2,
>  	.irqs			= omap4_prcm_irqs,
>  	.nr_irqs		= ARRAY_SIZE(omap4_prcm_irqs),
> @@ -306,10 +307,10 @@ static void omap44xx_prm_reconfigure_io_chain(void)
>  	omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK,
>  				    OMAP4430_WUCLK_CTRL_MASK,
>  				    inst,
> -				    OMAP4_PRM_IO_PMCTRL_OFFSET);
> +				    omap4_prcm_irq_setup.pm_ctrl);
>  	omap_test_timeout(
>  		(((omap4_prm_read_inst_reg(inst,
> -					   OMAP4_PRM_IO_PMCTRL_OFFSET) &
> +					   omap4_prcm_irq_setup.pm_ctrl) &
>  		   OMAP4430_WUCLK_STATUS_MASK) >>
>  		  OMAP4430_WUCLK_STATUS_SHIFT) == 1),
>  		MAX_IOPAD_LATCH_TIME, i);
> @@ -319,10 +320,10 @@ static void omap44xx_prm_reconfigure_io_chain(void)
>  	/* Trigger WUCLKIN disable */
>  	omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0,
>  				    inst,
> -				    OMAP4_PRM_IO_PMCTRL_OFFSET);
> +				    omap4_prcm_irq_setup.pm_ctrl);
>  	omap_test_timeout(
>  		(((omap4_prm_read_inst_reg(inst,
> -					   OMAP4_PRM_IO_PMCTRL_OFFSET) &
> +					   omap4_prcm_irq_setup.pm_ctrl) &
>  		   OMAP4430_WUCLK_STATUS_MASK) >>
>  		  OMAP4430_WUCLK_STATUS_SHIFT) == 0),
>  		MAX_IOPAD_LATCH_TIME, i);
> @@ -350,7 +351,7 @@ static void __init omap44xx_prm_enable_io_wakeup(void)
>  	omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
>  				    OMAP4430_GLOBAL_WUEN_MASK,
>  				    inst,
> -				    OMAP4_PRM_IO_PMCTRL_OFFSET);
> +				    omap4_prcm_irq_setup.pm_ctrl);
>  }
>  
>  /**
> -- 
> 1.9.1
> 


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keerthy July 16, 2015, 5:16 a.m. UTC | #2
Paul,

Thanks for the review!

On Thursday 16 July 2015 07:24 AM, Paul Walmsley wrote:
> Hi
>
> a few minor comments
>
> On Wed, 8 Jul 2015, Keerthy wrote:
>
>> PRM_IO_PMCTRL_OFFSET need not be same for all SOCs hence
>> remove hardcoding and use the value provided by the omap_prcm_irq_setup
>> structure.
>
> Please mention here that the reason why you're making this change is to
> support AM437x.

Sure. I will do that.

>
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>   arch/arm/mach-omap2/prcm-common.h |  1 +
>>   arch/arm/mach-omap2/prm44xx.c     | 11 ++++++-----
>>   2 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
>> index 6ae0b3a..2e60406 100644
>> --- a/arch/arm/mach-omap2/prcm-common.h
>> +++ b/arch/arm/mach-omap2/prcm-common.h
>> @@ -494,6 +494,7 @@ struct omap_prcm_irq {
>>   struct omap_prcm_irq_setup {
>>   	u16 ack;
>>   	u16 mask;
>> +	u16 pm_ctrl;
>
> Please add a kerneldoc structure documentation line for this new field, to
> match the existing documentation here.

Okay.

>
>>   	u8 nr_regs;
>>   	u8 nr_irqs;
>>   	const struct omap_prcm_irq *irqs;
>> diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
>> index 4541700..8149e5a 100644
>> --- a/arch/arm/mach-omap2/prm44xx.c
>> +++ b/arch/arm/mach-omap2/prm44xx.c
>> @@ -45,6 +45,7 @@ static const struct omap_prcm_irq omap4_prcm_irqs[] = {
>>   static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
>>   	.ack			= OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
>>   	.mask			= OMAP4_PRM_IRQENABLE_MPU_OFFSET,
>> +	.pm_ctrl		= OMAP4_PRM_IO_PMCTRL_OFFSET,
>>   	.nr_regs		= 2,
>>   	.irqs			= omap4_prcm_irqs,
>>   	.nr_irqs		= ARRAY_SIZE(omap4_prcm_irqs),
>> @@ -306,10 +307,10 @@ static void omap44xx_prm_reconfigure_io_chain(void)
>>   	omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK,
>>   				    OMAP4430_WUCLK_CTRL_MASK,
>>   				    inst,
>> -				    OMAP4_PRM_IO_PMCTRL_OFFSET);
>> +				    omap4_prcm_irq_setup.pm_ctrl);
>>   	omap_test_timeout(
>>   		(((omap4_prm_read_inst_reg(inst,
>> -					   OMAP4_PRM_IO_PMCTRL_OFFSET) &
>> +					   omap4_prcm_irq_setup.pm_ctrl) &
>>   		   OMAP4430_WUCLK_STATUS_MASK) >>
>>   		  OMAP4430_WUCLK_STATUS_SHIFT) == 1),
>>   		MAX_IOPAD_LATCH_TIME, i);
>> @@ -319,10 +320,10 @@ static void omap44xx_prm_reconfigure_io_chain(void)
>>   	/* Trigger WUCLKIN disable */
>>   	omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0,
>>   				    inst,
>> -				    OMAP4_PRM_IO_PMCTRL_OFFSET);
>> +				    omap4_prcm_irq_setup.pm_ctrl);
>>   	omap_test_timeout(
>>   		(((omap4_prm_read_inst_reg(inst,
>> -					   OMAP4_PRM_IO_PMCTRL_OFFSET) &
>> +					   omap4_prcm_irq_setup.pm_ctrl) &
>>   		   OMAP4430_WUCLK_STATUS_MASK) >>
>>   		  OMAP4430_WUCLK_STATUS_SHIFT) == 0),
>>   		MAX_IOPAD_LATCH_TIME, i);
>> @@ -350,7 +351,7 @@ static void __init omap44xx_prm_enable_io_wakeup(void)
>>   	omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
>>   				    OMAP4430_GLOBAL_WUEN_MASK,
>>   				    inst,
>> -				    OMAP4_PRM_IO_PMCTRL_OFFSET);
>> +				    omap4_prcm_irq_setup.pm_ctrl);
>>   }
>>
>>   /**
>> --
>> 1.9.1
>>
>
>
> - Paul
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 6ae0b3a..2e60406 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -494,6 +494,7 @@  struct omap_prcm_irq {
 struct omap_prcm_irq_setup {
 	u16 ack;
 	u16 mask;
+	u16 pm_ctrl;
 	u8 nr_regs;
 	u8 nr_irqs;
 	const struct omap_prcm_irq *irqs;
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 4541700..8149e5a 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -45,6 +45,7 @@  static const struct omap_prcm_irq omap4_prcm_irqs[] = {
 static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
 	.ack			= OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
 	.mask			= OMAP4_PRM_IRQENABLE_MPU_OFFSET,
+	.pm_ctrl		= OMAP4_PRM_IO_PMCTRL_OFFSET,
 	.nr_regs		= 2,
 	.irqs			= omap4_prcm_irqs,
 	.nr_irqs		= ARRAY_SIZE(omap4_prcm_irqs),
@@ -306,10 +307,10 @@  static void omap44xx_prm_reconfigure_io_chain(void)
 	omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK,
 				    OMAP4430_WUCLK_CTRL_MASK,
 				    inst,
-				    OMAP4_PRM_IO_PMCTRL_OFFSET);
+				    omap4_prcm_irq_setup.pm_ctrl);
 	omap_test_timeout(
 		(((omap4_prm_read_inst_reg(inst,
-					   OMAP4_PRM_IO_PMCTRL_OFFSET) &
+					   omap4_prcm_irq_setup.pm_ctrl) &
 		   OMAP4430_WUCLK_STATUS_MASK) >>
 		  OMAP4430_WUCLK_STATUS_SHIFT) == 1),
 		MAX_IOPAD_LATCH_TIME, i);
@@ -319,10 +320,10 @@  static void omap44xx_prm_reconfigure_io_chain(void)
 	/* Trigger WUCLKIN disable */
 	omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0,
 				    inst,
-				    OMAP4_PRM_IO_PMCTRL_OFFSET);
+				    omap4_prcm_irq_setup.pm_ctrl);
 	omap_test_timeout(
 		(((omap4_prm_read_inst_reg(inst,
-					   OMAP4_PRM_IO_PMCTRL_OFFSET) &
+					   omap4_prcm_irq_setup.pm_ctrl) &
 		   OMAP4430_WUCLK_STATUS_MASK) >>
 		  OMAP4430_WUCLK_STATUS_SHIFT) == 0),
 		MAX_IOPAD_LATCH_TIME, i);
@@ -350,7 +351,7 @@  static void __init omap44xx_prm_enable_io_wakeup(void)
 	omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
 				    OMAP4430_GLOBAL_WUEN_MASK,
 				    inst,
-				    OMAP4_PRM_IO_PMCTRL_OFFSET);
+				    omap4_prcm_irq_setup.pm_ctrl);
 }
 
 /**