linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.
@ 2015-09-11 13:05 Henry Chen
  2015-09-23 13:45 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Henry Chen @ 2015-09-11 13:05 UTC (permalink / raw)
  To: linux-arm-kernel

The watchdog may not be initialized by the bootloader, even if the rest
of the pwrap is. Move the watchdog initialization out of pwrap_init() to
make sure the watchdog is always initialized and not only when the pwrap
is uninitialized.

Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
---
Chandes since v1:
Modify the commit log and code comments to make it easy to understand 
the issue and solution.
---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index f432291..1a49b09 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -725,10 +725,6 @@ static int pwrap_init(struct pmic_wrapper *wrp)
 	pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
 	pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
 	pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
-	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
-	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
-	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
-	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
 
 	if (pwrap_is_mt8135(wrp)) {
 		/* enable pwrap events and pwrap bridge in AP side */
@@ -896,6 +892,12 @@ static int pwrap_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	/* Initialize watchdog, may not be done by the bootloader */
+	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
+	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
+	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
+	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
+
 	irq = platform_get_irq(pdev, 0);
 	ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH,
 			"mt-pmic-pwrap", wrp);
-- 
1.8.1.1.dirty

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

* [PATCH v2] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.
  2015-09-11 13:05 [PATCH v2] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq Henry Chen
@ 2015-09-23 13:45 ` Sascha Hauer
  2015-09-27 11:56   ` Matthias Brugger
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2015-09-23 13:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Sep 11, 2015 at 09:05:20PM +0800, Henry Chen wrote:
> The watchdog may not be initialized by the bootloader, even if the rest
> of the pwrap is. Move the watchdog initialization out of pwrap_init() to
> make sure the watchdog is always initialized and not only when the pwrap
> is uninitialized.
> 
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>


> ---
> Chandes since v1:
> Modify the commit log and code comments to make it easy to understand 
> the issue and solution.
> ---
>  drivers/soc/mediatek/mtk-pmic-wrap.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index f432291..1a49b09 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -725,10 +725,6 @@ static int pwrap_init(struct pmic_wrapper *wrp)
>  	pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
>  	pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
>  	pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
> -	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
> -	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
> -	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
> -	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
>  
>  	if (pwrap_is_mt8135(wrp)) {
>  		/* enable pwrap events and pwrap bridge in AP side */
> @@ -896,6 +892,12 @@ static int pwrap_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  	}
>  
> +	/* Initialize watchdog, may not be done by the bootloader */
> +	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
> +	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
> +	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
> +	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
> +
>  	irq = platform_get_irq(pdev, 0);
>  	ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH,
>  			"mt-pmic-pwrap", wrp);
> -- 
> 1.8.1.1.dirty
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH v2] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.
  2015-09-23 13:45 ` Sascha Hauer
@ 2015-09-27 11:56   ` Matthias Brugger
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Brugger @ 2015-09-27 11:56 UTC (permalink / raw)
  To: linux-arm-kernel



On 23/09/15 15:45, Sascha Hauer wrote:
> On Fri, Sep 11, 2015 at 09:05:20PM +0800, Henry Chen wrote:
>> The watchdog may not be initialized by the bootloader, even if the rest
>> of the pwrap is. Move the watchdog initialization out of pwrap_init() to
>> make sure the watchdog is always initialized and not only when the pwrap
>> is uninitialized.
>>
>> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Applied, thanks.

>
>
>> ---
>> Chandes since v1:
>> Modify the commit log and code comments to make it easy to understand
>> the issue and solution.
>> ---
>>   drivers/soc/mediatek/mtk-pmic-wrap.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
>> index f432291..1a49b09 100644
>> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
>> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
>> @@ -725,10 +725,6 @@ static int pwrap_init(struct pmic_wrapper *wrp)
>>   	pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
>>   	pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
>>   	pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
>> -	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
>> -	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
>> -	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
>> -	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
>>
>>   	if (pwrap_is_mt8135(wrp)) {
>>   		/* enable pwrap events and pwrap bridge in AP side */
>> @@ -896,6 +892,12 @@ static int pwrap_probe(struct platform_device *pdev)
>>   		return -ENODEV;
>>   	}
>>
>> +	/* Initialize watchdog, may not be done by the bootloader */
>> +	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
>> +	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
>> +	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
>> +	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
>> +
>>   	irq = platform_get_irq(pdev, 0);
>>   	ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH,
>>   			"mt-pmic-pwrap", wrp);
>> --
>> 1.8.1.1.dirty
>>
>>
>

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

end of thread, other threads:[~2015-09-27 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 13:05 [PATCH v2] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq Henry Chen
2015-09-23 13:45 ` Sascha Hauer
2015-09-27 11:56   ` Matthias Brugger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).