All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Michal Simek <michal.simek@xilinx.com>
Cc: linux-kernel@vger.kernel.org, monstr@monstr.eu,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	linux-watchdog@vger.kernel.org,
	"Wim Van Sebroeck" <wim@iguana.be>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [2/2] watchdog: of_xilinx_wdt: Add suspend/resume support
Date: Mon, 14 Aug 2017 18:51:55 -0700	[thread overview]
Message-ID: <20170815015155.GA32016@roeck-us.net> (raw)
In-Reply-To: <1e1307808bd32591ea4f03ec3d70d0eadb38b91e.1502105061.git.michal.simek@xilinx.com>

On Mon, Aug 07, 2017 at 01:24:23PM +0200, Michal Simek wrote:
> Add suspend/resume support to driver.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

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

> ---
> 
>  drivers/watchdog/of_xilinx_wdt.c | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c
> index 41edeb93a327..1cf286945b7a 100644
> --- a/drivers/watchdog/of_xilinx_wdt.c
> +++ b/drivers/watchdog/of_xilinx_wdt.c
> @@ -264,6 +264,43 @@ static int xwdt_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +/**
> + * xwdt_suspend - Suspend the device.
> + *
> + * @dev: handle to the device structure.
> + * Return: 0 always.
> + */
> +static int __maybe_unused xwdt_suspend(struct device *dev)
> +{
> +	struct platform_device *pdev = to_platform_device(dev);
> +	struct xwdt_device *xdev = platform_get_drvdata(pdev);
> +
> +	if (watchdog_active(&xdev->xilinx_wdt_wdd))
> +		xilinx_wdt_stop(&xdev->xilinx_wdt_wdd);
> +
> +	return 0;
> +}
> +
> +/**
> + * xwdt_resume - Resume the device.
> + *
> + * @dev: handle to the device structure.
> + * Return: 0 on success, errno otherwise.
> + */
> +static int __maybe_unused xwdt_resume(struct device *dev)
> +{
> +	struct platform_device *pdev = to_platform_device(dev);
> +	struct xwdt_device *xdev = platform_get_drvdata(pdev);
> +	int ret = 0;
> +
> +	if (watchdog_active(&xdev->xilinx_wdt_wdd))
> +		ret = xilinx_wdt_start(&xdev->xilinx_wdt_wdd);
> +
> +	return ret;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(xwdt_pm_ops, xwdt_suspend, xwdt_resume);
> +
>  /* Match table for of_platform binding */
>  static const struct of_device_id xwdt_of_match[] = {
>  	{ .compatible = "xlnx,xps-timebase-wdt-1.00.a", },
> @@ -278,6 +315,7 @@ static int xwdt_remove(struct platform_device *pdev)
>  	.driver = {
>  		.name  = WATCHDOG_NAME,
>  		.of_match_table = xwdt_of_match,
> +		.pm = &xwdt_pm_ops,
>  	},
>  };
>  

WARNING: multiple messages have this Message-ID (diff)
From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [2/2] watchdog: of_xilinx_wdt: Add suspend/resume support
Date: Mon, 14 Aug 2017 18:51:55 -0700	[thread overview]
Message-ID: <20170815015155.GA32016@roeck-us.net> (raw)
In-Reply-To: <1e1307808bd32591ea4f03ec3d70d0eadb38b91e.1502105061.git.michal.simek@xilinx.com>

On Mon, Aug 07, 2017 at 01:24:23PM +0200, Michal Simek wrote:
> Add suspend/resume support to driver.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

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

> ---
> 
>  drivers/watchdog/of_xilinx_wdt.c | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c
> index 41edeb93a327..1cf286945b7a 100644
> --- a/drivers/watchdog/of_xilinx_wdt.c
> +++ b/drivers/watchdog/of_xilinx_wdt.c
> @@ -264,6 +264,43 @@ static int xwdt_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +/**
> + * xwdt_suspend - Suspend the device.
> + *
> + * @dev: handle to the device structure.
> + * Return: 0 always.
> + */
> +static int __maybe_unused xwdt_suspend(struct device *dev)
> +{
> +	struct platform_device *pdev = to_platform_device(dev);
> +	struct xwdt_device *xdev = platform_get_drvdata(pdev);
> +
> +	if (watchdog_active(&xdev->xilinx_wdt_wdd))
> +		xilinx_wdt_stop(&xdev->xilinx_wdt_wdd);
> +
> +	return 0;
> +}
> +
> +/**
> + * xwdt_resume - Resume the device.
> + *
> + * @dev: handle to the device structure.
> + * Return: 0 on success, errno otherwise.
> + */
> +static int __maybe_unused xwdt_resume(struct device *dev)
> +{
> +	struct platform_device *pdev = to_platform_device(dev);
> +	struct xwdt_device *xdev = platform_get_drvdata(pdev);
> +	int ret = 0;
> +
> +	if (watchdog_active(&xdev->xilinx_wdt_wdd))
> +		ret = xilinx_wdt_start(&xdev->xilinx_wdt_wdd);
> +
> +	return ret;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(xwdt_pm_ops, xwdt_suspend, xwdt_resume);
> +
>  /* Match table for of_platform binding */
>  static const struct of_device_id xwdt_of_match[] = {
>  	{ .compatible = "xlnx,xps-timebase-wdt-1.00.a", },
> @@ -278,6 +315,7 @@ static int xwdt_remove(struct platform_device *pdev)
>  	.driver = {
>  		.name  = WATCHDOG_NAME,
>  		.of_match_table = xwdt_of_match,
> +		.pm = &xwdt_pm_ops,
>  	},
>  };
>  

  reply	other threads:[~2017-08-15  1:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 11:24 [PATCH 1/2] watchdog: of_xilinx_wdt: Add support for reading freq via CCF Michal Simek
2017-08-07 11:24 ` Michal Simek
2017-08-07 11:24 ` [PATCH 2/2] watchdog: of_xilinx_wdt: Add suspend/resume support Michal Simek
2017-08-07 11:24   ` Michal Simek
2017-08-15  1:51   ` Guenter Roeck [this message]
2017-08-15  1:51     ` [2/2] " Guenter Roeck
2017-08-15  1:49 ` [1/2] watchdog: of_xilinx_wdt: Add support for reading freq via CCF Guenter Roeck
2017-08-15  1:49   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170815015155.GA32016@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=soren.brinkmann@xilinx.com \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.