From patchwork Fri Jun 5 07:55:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 28086 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n557xHAL024897 for ; Fri, 5 Jun 2009 07:59:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753807AbZFEH6m (ORCPT ); Fri, 5 Jun 2009 03:58:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754311AbZFEH6m (ORCPT ); Fri, 5 Jun 2009 03:58:42 -0400 Received: from rv-out-0506.google.com ([209.85.198.239]:33932 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753731AbZFEH6l (ORCPT ); Fri, 5 Jun 2009 03:58:41 -0400 Received: by rv-out-0506.google.com with SMTP id f9so604462rvb.1 for ; Fri, 05 Jun 2009 00:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=Atitstu6TIPK1qr7SDQJd8FKpaa48mIW41Sj9PENuWk=; b=TPQsR2GCWoWBGsREYOmnMQo6Vzpsqn688KuBiRSlx69LFzSnvdJRY0cc2FCQ9w9UVA j/qS58CeDo2Mygb4myB9TVMifglfAviD+5fNvSSUFSEMVIzMvLgP3EZ6TYqH5IKNfea+ COb9DaG2elVlf8NXRxE4RBcWC+fWWPsvAfQFU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=soDyCDSuhbBeWTgX1uUK4Jm9tMYq2GLdJ+HTZb/Th3doVHJw1kWGBHk10DVm/LVgPR req3V3XUghuknr7yLj19G5DxDCTmvy1ECKHi/mUoymZ10jElqbno1nRC7Btlds+l5QGX cM+rkIjBhSAoyV2n4A3NqlcnB6o7zp0KIxec4= Received: by 10.141.155.15 with SMTP id h15mr2825568rvo.220.1244188724026; Fri, 05 Jun 2009 00:58:44 -0700 (PDT) Received: from rx1.opensource.se (mailhost.igel.co.jp [219.106.231.130]) by mx.google.com with ESMTPS id k41sm30821514rvb.7.2009.06.05.00.58.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Jun 2009 00:58:43 -0700 (PDT) From: Magnus Damm To: linux-pm@lists.linux-foundation.org Cc: ben-linux@fluff.org, hskinnemoen@atmel.com, anemo@mba.ocn.ne.jp, gregkh@suse.de, rjw@sisk.pl, stern@rowland.harvard.edu, pavel@ucw.cz, felipe.balbi@nokia.com, linux-omap@vger.kernel.org, Magnus Damm Date: Fri, 05 Jun 2009 16:55:24 +0900 Message-Id: <20090605075524.14756.96881.sendpatchset@rx1.opensource.se> In-Reply-To: <20090605075436.14756.80501.sendpatchset@rx1.opensource.se> References: <20090605075436.14756.80501.sendpatchset@rx1.opensource.se> Subject: [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Magnus Damm This patch reworks platform driver power management code for i2c-s3c2410 from legacy callbacks to dev_pm_ops. The callbacks are converted for CONFIG_SUSPEND like this: suspend_late() -> suspend_noirq() resume() -> resume() Signed-off-by: Magnus Damm --- Untested but compiles fine. drivers/i2c/busses/i2c-s3c2410.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/i2c/busses/i2c-s3c2410.c +++ work/drivers/i2c/busses/i2c-s3c2410.c 2009-06-01 15:26:38.000000000 +0900 @@ -944,17 +944,20 @@ static int s3c24xx_i2c_remove(struct pla } #ifdef CONFIG_PM -static int s3c24xx_i2c_suspend_late(struct platform_device *dev, - pm_message_t msg) +static int s3c24xx_i2c_suspend_noirq(struct device *dev) { - struct s3c24xx_i2c *i2c = platform_get_drvdata(dev); + struct platform_device *pdev = to_platform_device(dev); + struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); + i2c->suspended = 1; + return 0; } -static int s3c24xx_i2c_resume(struct platform_device *dev) +static int s3c24xx_i2c_resume(struct device *dev) { - struct s3c24xx_i2c *i2c = platform_get_drvdata(dev); + struct platform_device *pdev = to_platform_device(dev); + struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); i2c->suspended = 0; s3c24xx_i2c_init(i2c); @@ -962,9 +965,14 @@ static int s3c24xx_i2c_resume(struct pla return 0; } +static struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = { + .suspend_noirq = s3c24xx_i2c_suspend_noirq, + .resume = s3c24xx_i2c_resume, +}; + +#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops) #else -#define s3c24xx_i2c_suspend_late NULL -#define s3c24xx_i2c_resume NULL +#define S3C24XX_DEV_PM_OPS NULL #endif /* device driver for platform bus bits */ @@ -972,22 +980,20 @@ static int s3c24xx_i2c_resume(struct pla static struct platform_driver s3c2410_i2c_driver = { .probe = s3c24xx_i2c_probe, .remove = s3c24xx_i2c_remove, - .suspend_late = s3c24xx_i2c_suspend_late, - .resume = s3c24xx_i2c_resume, .driver = { .owner = THIS_MODULE, .name = "s3c2410-i2c", + .pm = S3C24XX_DEV_PM_OPS, }, }; static struct platform_driver s3c2440_i2c_driver = { .probe = s3c24xx_i2c_probe, .remove = s3c24xx_i2c_remove, - .suspend_late = s3c24xx_i2c_suspend_late, - .resume = s3c24xx_i2c_resume, .driver = { .owner = THIS_MODULE, .name = "s3c2440-i2c", + .pm = S3C24XX_DEV_PM_OPS, }, };