Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573778 > unrolled thread

Re: [PATCH 2/2] watchdog: sama5d4: Implement resume hook

Started byGuenter Roeck <linux@roeck-us.net>
First post2017-02-05 01:00 +0100
Last post2017-02-05 01:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/2] watchdog: sama5d4: Implement resume hook Guenter Roeck <linux@roeck-us.net> - 2017-02-05 01:00 +0100

#1573778 — Re: [PATCH 2/2] watchdog: sama5d4: Implement resume hook

FromGuenter Roeck <linux@roeck-us.net>
Date2017-02-05 01:00 +0100
SubjectRe: [PATCH 2/2] watchdog: sama5d4: Implement resume hook
Message-ID<t7ipj-7Vh-3@gated-at.bofh.it>
On 01/30/2017 09:18 AM, Alexandre Belloni wrote:
> When resuming for the deepest state on sama5d2, it is necessary to restore
> MR as the registers are lost.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  drivers/watchdog/sama5d4_wdt.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c
> index 6dd07bef515a..de8ff10a032e 100644
> --- a/drivers/watchdog/sama5d4_wdt.c
> +++ b/drivers/watchdog/sama5d4_wdt.c
> @@ -258,11 +258,28 @@ static const struct of_device_id sama5d4_wdt_of_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, sama5d4_wdt_of_match);
>
> +#ifdef CONFIG_PM_SLEEP
> +static int sama5d4_wdt_resume(struct device *dev)
> +{
> +	struct sama5d4_wdt *wdt = dev_get_drvdata(dev);
> +
> +	wdt_write(wdt, AT91_WDT_MR, wdt->mr & ~AT91_WDT_WDDIS);
> +	if (wdt->mr & AT91_WDT_WDDIS)
> +		wdt_write(wdt, AT91_WDT_MR, wdt->mr);
> +
> +	return 0;
> +}
> +#endif
> +

First time I ever see a system which doesn't need a matching suspend function.
I assume that isn't needed. With that,

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Thanks,
Guenter

> +static SIMPLE_DEV_PM_OPS(sama5d4_wdt_pm_ops, NULL,
> +			 sama5d4_wdt_resume);
> +
>  static struct platform_driver sama5d4_wdt_driver = {
>  	.probe		= sama5d4_wdt_probe,
>  	.remove		= sama5d4_wdt_remove,
>  	.driver		= {
>  		.name	= "sama5d4_wdt",
> +		.pm	= &sama5d4_wdt_pm_ops,
>  		.of_match_table = sama5d4_wdt_of_match,
>  	}
>  };
>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web