From patchwork Tue Jun 18 15:20:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2744601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67F9CC0AB1 for ; Tue, 18 Jun 2013 18:24:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F8C22045A for ; Tue, 18 Jun 2013 18:24:56 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 227EC20443 for ; Tue, 18 Jun 2013 18:24:55 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uoxl7-0003YW-Ee; Tue, 18 Jun 2013 15:23:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoxkG-0003Kj-Ji; Tue, 18 Jun 2013 15:22:56 +0000 Received: from mail-pd0-f175.google.com ([209.85.192.175]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoxjR-0003DA-7w for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2013 15:22:06 +0000 Received: by mail-pd0-f175.google.com with SMTP id 4so4024234pdd.34 for ; Tue, 18 Jun 2013 08:21:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=A5QSkRBC4M9gBbbrx4aobNUFADCclYgksd1BQ0j5seM=; b=iggcLHWTVZs/ARrUEufkGIbZr/AorJrV2Wf0IbKeyDyP6nI1Mp4aH/Q3KnrORZ9XNr BxatdYaTmD78QBt9LaM+GZIjZr1wsedlJ7NZmHx95yONWku7GCDsQtJhnl/3yFdYOlKI 3MCSl4y5iwf6lOSS77VrChKiOySoe8NNDIWDSQyQAJax9JFSddrVcQvFMovJHHB0mz7C jZpXhEQS3Lj0E7BwYhZuGXBAhlMT31StxIogUxlwqNrkHkboTxHi8SqERMpvyFiqR/Ga MUEaS6W4nDPOw64PLFT4HsMdwQwWxZErA7G5I9hJ3qmYj2pI7voOZQwYONKpSimDIDsh mkgw== X-Received: by 10.66.141.80 with SMTP id rm16mr2625287pab.90.1371568903532; Tue, 18 Jun 2013 08:21:43 -0700 (PDT) Received: from localhost ([122.167.240.191]) by mx.google.com with ESMTPSA id qe10sm18735555pbb.2.2013.06.18.08.21.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Jun 2013 08:21:42 -0700 (PDT) From: Viresh Kumar To: wim@iguana.be Subject: [PATCH V3 07/14] watchdog/mpcore_wdt: Add support for dev_pm_ops interface Date: Tue, 18 Jun 2013 20:50:31 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmBM32MLeOxbWevEq045lQO3yJU+aPGp/u+3iMupfky1V845kyKa0HYC56FxOGQeqzwv8Xn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130618_112205_419417_A58C71F4 X-CRM114-Status: GOOD ( 14.21 ) X-Spam-Score: -1.9 (-) Cc: marc.zyngier@arm.com, Viresh Kumar , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds dev_pm_ops support for standby/slepp/hibernate. Signed-off-by: Viresh Kumar --- drivers/watchdog/mpcore_wdt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index 5955757..b4d06f1 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -257,40 +258,39 @@ static int 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 (watchdog_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 = 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, }, };