Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752545AbbLaOT0 (ORCPT ); Thu, 31 Dec 2015 09:19:26 -0500 Received: from mail-vk0-f47.google.com ([209.85.213.47]:34783 "EHLO mail-vk0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751183AbbLaOTY (ORCPT ); Thu, 31 Dec 2015 09:19:24 -0500 MIME-Version: 1.0 In-Reply-To: <1451478961-5668-1-git-send-email-henryc.chen@mediatek.com> References: <1451478961-5668-1-git-send-email-henryc.chen@mediatek.com> From: Daniel Kurtz Date: Thu, 31 Dec 2015 22:19:03 +0800 X-Google-Sender-Auth: SJf1DGPibyPwPMQ6oysxpofiCrk Message-ID: Subject: Re: [PATCH] soc: mediatek: PMIC wrap: Enable STAUPD_PRD before WDT_SRC_EN enabled. To: Henry Chen Cc: Matthias Brugger , Sascha Hauer , "linux-arm-kernel@lists.infradead.org" , "moderated list:ARM/Mediatek SoC support" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2170 Lines: 57 On Wed, Dec 30, 2015 at 8:36 PM, Henry Chen wrote: > > The STAUPD_TRIG will be enable when WDT_INT enable on probe function, if > doesn't enable STAUPD_PRD together, interrupt will be triggered because > STAUPD timeout. To avoid unexpected interrupt, enable periodic status > update which will be updated to PMIC every selected time period. Sorry, I don't really understand this. What exactly is triggering the unexpected watchdog interrupt (WDT_INT)? How does setting STAUPD_PRD disable this "unexpected interrupt"? >From the MT8173 Datasheet, I can see that the value written to STAUPD_PRD is the "periodic status update timing (period)". > Signed-off-by: Henry Chen > --- > drivers/soc/mediatek/mtk-pmic-wrap.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c > index a8cde17..6e5c20f 100644 > --- a/drivers/soc/mediatek/mtk-pmic-wrap.c > +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c > @@ -904,6 +904,11 @@ static int pwrap_probe(struct platform_device *pdev) > return -ENODEV; > } > > + /* > + * Enable periodic status update which will be updated to PMIC > + * every selected time period. > + */ > + pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD); nit: Perhaps use a define for 5, and specify the real period value. Something like this: #define PWRAP_STAUPD_98_5US 5 > /* Initialize watchdog, may not be done by the bootloader */ > pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT); > pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN); > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/