From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support Date: Mon, 12 Feb 2018 11:24:15 -0800 Message-ID: <20180212192415.GA22927@roeck-us.net> References: <1518457475-4480-1-git-send-email-fabrizio.castro@bp.renesas.com> <1518457475-4480-13-git-send-email-fabrizio.castro@bp.renesas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1518457475-4480-13-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org> Sender: linux-watchdog-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Fabrizio Castro Cc: Philipp Zabel , Rob Herring , Mark Rutland , Wim Van Sebroeck , Russell King , Catalin Marinas , Will Deacon , Michael Turquette , Stephen Boyd , Simon Horman , Magnus Damm , Geert Uytterhoeven , Wolfram Sang , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Chris Paterson , Biju Das List-Id: devicetree@vger.kernel.org On Mon, Feb 12, 2018 at 05:44:21PM +0000, Fabrizio Castro wrote: > Due to commits: > * "ARM: shmobile: Add watchdog support", > * "ARM: shmobile: rcar-gen2: Add watchdog support", and > * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2", > we now have everything we needed for the watchdog to work on Gen2 and > RZ/G1. > > This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car > Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be > always ON, when suspending to RAM we need to explicitly disable the > counting by clearing TME from RWTCSRA. > > Signed-off-by: Fabrizio Castro > Signed-off-by: Ramesh Shanmugasundaram Reviewed-by: Guenter Roeck > --- > v4->v5: > * various improvements suggested by Wolfram > > drivers/watchdog/renesas_wdt.c | 27 ++++++++++++++++++++++----- > 1 file changed, 22 insertions(+), 5 deletions(-) > > diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c > index 831ef83..e972b7b 100644 > --- a/drivers/watchdog/renesas_wdt.c > +++ b/drivers/watchdog/renesas_wdt.c > @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev) > return 0; > } > > -/* > - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP > - * to work there, one also needs a RESET (RST) driver which does not exist yet > - * due to HW issues. This needs to be solved before adding compatibles here. > - */ > +static int __maybe_unused rwdt_suspend(struct device *dev) > +{ > + struct rwdt_priv *priv = dev_get_drvdata(dev); > + > + if (watchdog_active(&priv->wdev)) > + rwdt_write(priv, priv->cks, RWTCSRA); > + return 0; > +} > + > +static int __maybe_unused rwdt_resume(struct device *dev) > +{ > + struct rwdt_priv *priv = dev_get_drvdata(dev); > + > + if (watchdog_active(&priv->wdev)) > + rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA); > + return 0; > +} > + > +static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume); > + > static const struct of_device_id rwdt_ids[] = { > { .compatible = "renesas,rcar-gen3-wdt", }, > + { .compatible = "renesas,rcar-gen2-wdt", }, > { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, rwdt_ids); > @@ -218,6 +234,7 @@ static struct platform_driver rwdt_driver = { > .driver = { > .name = "renesas_wdt", > .of_match_table = rwdt_ids, > + .pm = &rwdt_pm_ops, > }, > .probe = rwdt_probe, > .remove = rwdt_remove, > -- > 2.7.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html