From: Viresh Kumar <viresh.kumar@st.com> To: <wim@iguana.be> Cc: <linux-watchdog@vger.kernel.org>, <spear-devel@list.st.com>, <viresh.linux@gmail.com>, <linux-arm-kernel@lists.infradead.org>, <srinidhi.kasagar@stericsson.com>, <linus.walleij@stericsson.com>, <alan@lxorguk.ukuu.org.uk>, <w.sang@pengutronix.de>, <sshtylyov@mvista.com>, Viresh Kumar <viresh.kumar@st.com> Subject: [PATCH V2 12/22] watchdog/mpcore_wdt: Add support for dev_pm_ops interface Date: Mon, 12 Mar 2012 09:52:07 +0530 [thread overview] Message-ID: <70350419aeda6aa96081b6d81407efeb17b2d87c.1331524811.git.viresh.kumar@st.com> (raw) In-Reply-To: <cover.1331524811.git.viresh.kumar@st.com> This patch adds dev_pm_ops support for standby/slepp/hibernate. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> --- drivers/watchdog/mpcore_wdt.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index 6902580..3f47b7e 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c @@ -23,6 +23,7 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/platform_device.h> +#include <linux/pm.h> #include <linux/reboot.h> #include <linux/slab.h> #include <linux/types.h> @@ -256,40 +257,39 @@ static int __devexit mpcore_wdt_remove(struct platform_device *pdev) } #ifdef CONFIG_PM -static int mpcore_wdt_suspend(struct platform_device *pdev, pm_message_t msg) +static int mpcore_wdt_suspend(struct device *dev) { - struct mpcore_wdt *wdt = platform_get_drvdata(pdev); + struct mpcore_wdt *wdt = dev_get_drvdata(dev); mpcore_wdt_stop(&wdt->wdd); /* Turn the WDT off */ return 0; } -static int mpcore_wdt_resume(struct platform_device *pdev) +static int mpcore_wdt_resume(struct device *dev) { - struct mpcore_wdt *wdt = platform_get_drvdata(pdev); + struct mpcore_wdt *wdt = dev_get_drvdata(dev); if (is_wdd_active(&wdt->wdd)) mpcore_wdt_start(&wdt->wdd); return 0; } -#else -#define mpcore_wdt_suspend NULL -#define mpcore_wdt_resume NULL #endif +static SIMPLE_DEV_PM_OPS(mpcore_wdt_dev_pm_ops, mpcore_wdt_suspend, + mpcore_wdt_resume); + /* work with hotplug and coldplug */ MODULE_ALIAS("platform:mpcore_wdt"); static struct platform_driver mpcore_wdt_driver = { .probe = mpcore_wdt_probe, .remove = __devexit_p(mpcore_wdt_remove), - .suspend = mpcore_wdt_suspend, - .resume = mpcore_wdt_resume, .shutdown = mpcore_wdt_shutdown, .driver = { .owner = THIS_MODULE, .name = "mpcore_wdt", + .pm = &mpcore_wdt_dev_pm_ops, }, }; -- 1.7.8.110.g4cb5d
WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@st.com (Viresh Kumar) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 12/22] watchdog/mpcore_wdt: Add support for dev_pm_ops interface Date: Mon, 12 Mar 2012 09:52:07 +0530 [thread overview] Message-ID: <70350419aeda6aa96081b6d81407efeb17b2d87c.1331524811.git.viresh.kumar@st.com> (raw) In-Reply-To: <cover.1331524811.git.viresh.kumar@st.com> This patch adds dev_pm_ops support for standby/slepp/hibernate. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> --- drivers/watchdog/mpcore_wdt.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index 6902580..3f47b7e 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c @@ -23,6 +23,7 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/platform_device.h> +#include <linux/pm.h> #include <linux/reboot.h> #include <linux/slab.h> #include <linux/types.h> @@ -256,40 +257,39 @@ static int __devexit mpcore_wdt_remove(struct platform_device *pdev) } #ifdef CONFIG_PM -static int mpcore_wdt_suspend(struct platform_device *pdev, pm_message_t msg) +static int mpcore_wdt_suspend(struct device *dev) { - struct mpcore_wdt *wdt = platform_get_drvdata(pdev); + struct mpcore_wdt *wdt = dev_get_drvdata(dev); mpcore_wdt_stop(&wdt->wdd); /* Turn the WDT off */ return 0; } -static int mpcore_wdt_resume(struct platform_device *pdev) +static int mpcore_wdt_resume(struct device *dev) { - struct mpcore_wdt *wdt = platform_get_drvdata(pdev); + struct mpcore_wdt *wdt = dev_get_drvdata(dev); if (is_wdd_active(&wdt->wdd)) mpcore_wdt_start(&wdt->wdd); return 0; } -#else -#define mpcore_wdt_suspend NULL -#define mpcore_wdt_resume NULL #endif +static SIMPLE_DEV_PM_OPS(mpcore_wdt_dev_pm_ops, mpcore_wdt_suspend, + mpcore_wdt_resume); + /* work with hotplug and coldplug */ MODULE_ALIAS("platform:mpcore_wdt"); static struct platform_driver mpcore_wdt_driver = { .probe = mpcore_wdt_probe, .remove = __devexit_p(mpcore_wdt_remove), - .suspend = mpcore_wdt_suspend, - .resume = mpcore_wdt_resume, .shutdown = mpcore_wdt_shutdown, .driver = { .owner = THIS_MODULE, .name = "mpcore_wdt", + .pm = &mpcore_wdt_dev_pm_ops, }, }; -- 1.7.8.110.g4cb5d
next prev parent reply other threads:[~2012-03-12 4:23 UTC|newest] Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-03-12 4:21 [PATCH V2 00/22] watchdog: ARM watchdogs: sp805 & mpcore updates & fixes Viresh Kumar 2012-03-12 4:21 ` Viresh Kumar 2012-03-12 4:21 ` [PATCH V2 01/22] watchdog: Add is_wdt_active() routine Viresh Kumar 2012-03-12 4:21 ` Viresh Kumar 2012-03-12 4:21 ` [PATCH V2 02/22] watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core Viresh Kumar 2012-03-12 4:21 ` Viresh Kumar 2012-03-12 4:21 ` [PATCH V2 03/22] watchdog/mpcore_wdt: Rename dev to pdev for pointing to struct platform_device Viresh Kumar 2012-03-12 4:21 ` Viresh Kumar 2012-03-12 4:21 ` [PATCH V2 04/22] watchdog/mpcore_wdt: Use devm routines Viresh Kumar 2012-03-12 4:21 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 05/22] watchdog/mpcore_wdt: Allow platform_get_irq() to fail Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 06/22] watchdog/mpcore_wdt: convert to watchdog core Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 07/22] watchdog/mpcore_wdt: Fix multiline comments Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 08/22] watchdog/mpcore_wdt: Arrange #includes in alphabetical order Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 09/22] watchdog/mpcore_wdt: Set default heartbeat in probe instead of init Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 10/22] watchdog/mpcore_wdt: Use dev_(crit, err, info) instead of dev_printk Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 11/22] watchdog/mpcore_wdt: convert to use module_platform_driver() Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar [this message] 2012-03-12 4:22 ` [PATCH V2 12/22] watchdog/mpcore_wdt: Add support for dev_pm_ops interface Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 13/22] watchdog/mpcore_wdt: disable wdt in suspend only if it is busy Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 14/22] watchdog/mpcore_wdt: replace (__raw_)readl/writel with lighter *_relaxed variants Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 15/22] watchdog/mpcore_wdt: Add support for WDIOC_GETBOOTSTATUS IOCTL Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 16/22] watchdog/mpcore_wdt: Add clock framework support Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 17/22] watchdog/mpcore_wdt: use correct clk_rate to program timeout Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-04-24 10:42 ` Viresh Kumar 2012-04-24 10:42 ` Viresh Kumar 2012-04-24 19:34 ` Wim Van Sebroeck 2012-03-12 4:22 ` [PATCH V2 18/22] watchdog/sp805: Fix documentation style comment Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 19/22] watchdog/sp805: replace readl/writel with lighter _relaxed variants Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 20/22] watchdog/sp805: Use devm routines Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 21/22] watchdog/sp805: convert to watchdog core Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-03-12 4:22 ` [PATCH V2 22/22] watchdog/sp805: Add clk_{un}prepare support Viresh Kumar 2012-03-12 4:22 ` Viresh Kumar 2012-04-10 9:35 ` [PATCH V2 00/22] watchdog: ARM watchdogs: sp805 & mpcore updates & fixes Viresh Kumar 2012-04-10 9:35 ` Viresh Kumar 2012-04-18 5:08 ` Viresh Kumar 2012-04-18 5:08 ` Viresh Kumar 2012-06-13 9:06 ` viresh kumar 2012-06-13 9:06 ` viresh kumar 2012-06-26 19:08 ` Wim Van Sebroeck
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=70350419aeda6aa96081b6d81407efeb17b2d87c.1331524811.git.viresh.kumar@st.com \ --to=viresh.kumar@st.com \ --cc=alan@lxorguk.ukuu.org.uk \ --cc=linus.walleij@stericsson.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-watchdog@vger.kernel.org \ --cc=spear-devel@list.st.com \ --cc=srinidhi.kasagar@stericsson.com \ --cc=sshtylyov@mvista.com \ --cc=viresh.linux@gmail.com \ --cc=w.sang@pengutronix.de \ --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: linkBe 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.