From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755200AbbIWNpd (ORCPT ); Wed, 23 Sep 2015 09:45:33 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:51071 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755153AbbIWNpc (ORCPT ); Wed, 23 Sep 2015 09:45:32 -0400 Date: Wed, 23 Sep 2015 15:45:06 +0200 From: Sascha Hauer To: Henry Chen Cc: Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq. Message-ID: <20150923134506.GA7825@pengutronix.de> References: <1441976720-43568-1-git-send-email-henryc.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441976720-43568-1-git-send-email-henryc.chen@mediatek.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:44:45 up 4 days, 3:14, 56 users, load average: 0.30, 0.15, 0.15 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Sascha Hauer > --- > 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 |