aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorHenry Chen <henryc.chen@mediatek.com>2015-09-11 09:05:20 -0400
committerMatthias Brugger <matthias.bgg@gmail.com>2015-09-27 07:56:08 -0400
commitbbe379fc7ca5cae09b1bc44fe5ee4173ad883fbf (patch)
tree0c031885f126c12a976eb3f3dc401e43acd01fd8 /drivers/soc
parent1f93e4a96c9109378204c147b3eec0d0e8100fde (diff)
soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.
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> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/mediatek/mtk-pmic-wrap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index 8bc7b41b09fd..105597a885cb 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)
725 pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN); 725 pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
726 pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD); 726 pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
727 pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN); 727 pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
728 pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
729 pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
730 pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
731 pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
732 728
733 if (pwrap_is_mt8135(wrp)) { 729 if (pwrap_is_mt8135(wrp)) {
734 /* enable pwrap events and pwrap bridge in AP side */ 730 /* enable pwrap events and pwrap bridge in AP side */
@@ -896,6 +892,12 @@ static int pwrap_probe(struct platform_device *pdev)
896 return -ENODEV; 892 return -ENODEV;
897 } 893 }
898 894
895 /* Initialize watchdog, may not be done by the bootloader */
896 pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
897 pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
898 pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
899 pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
900
899 irq = platform_get_irq(pdev, 0); 901 irq = platform_get_irq(pdev, 0);
900 ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH, 902 ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH,
901 "mt-pmic-pwrap", wrp); 903 "mt-pmic-pwrap", wrp);