From patchwork Wed Jun 24 09:23:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 32116 X-Patchwork-Delegate: khilman@deeprootsystems.com 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 n5O9XJhs003843 for ; Wed, 24 Jun 2009 09:33:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757273AbZFXJcS (ORCPT ); Wed, 24 Jun 2009 05:32:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756245AbZFXJcR (ORCPT ); Wed, 24 Jun 2009 05:32:17 -0400 Received: from mail-px0-f190.google.com ([209.85.216.190]:50174 "EHLO mail-px0-f190.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756975AbZFXJcO (ORCPT ); Wed, 24 Jun 2009 05:32:14 -0400 X-Greylist: delayed 311 seconds by postgrey-1.27 at vger.kernel.org; Wed, 24 Jun 2009 05:31:50 EDT Received: by mail-px0-f190.google.com with SMTP id 28so267669pxi.33 for ; Wed, 24 Jun 2009 02:32:17 -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=q1gW5nNXXF1tNb0YgCW8jvptxJ5zaghWOkJCnj2bn+w=; b=Ij19zbZ8hDHqyOKtBQARep2ID+hJYa1sDWAoGj+4ExZ6ZoyuyoeOgzB+CZfY/1A5l6 nfWF7c4GHJIObFGupCumcQp7nxubYKjV6PEimZvTnh1SxLyQHfM3HNLVBsf+RkGxvtd6 CvuDYahfPEQ/5yTcfluZK3BlYjaESgyeH1Pg4= 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=JQyvBSYuaeE/W0ZIDlYrcPcMDaalagyMfEY3GZN9AeZOP3Jm7UBEwm2SV9eE8JhnUM FhsDqkaHnisY+DM9+FwSER/F7HJ2N2ouI3oCx/zWN1k02VuTRPOn0u0/s1xINTJtCZHS Rp1wvoYePZhVsj4kjvm+GsIQ7kqE5k/M6SNKs= Received: by 10.114.192.17 with SMTP id p17mr1644985waf.196.1245835611501; Wed, 24 Jun 2009 02:26:51 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id v9sm1430414wah.36.2009.06.24.02.26.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Jun 2009 02:26:50 -0700 (PDT) From: Magnus Damm To: linux-kernel@vger.kernel.org Cc: gregkh@suse.de, ben-linux@fluff.org, hskinnemoen@atmel.com, anemo@mba.ocn.ne.jp, linux-usb@vger.kernel.org, rjw@sisk.pl, stern@rowland.harvard.edu, pavel@ucw.cz, linux-pm@lists.linux-foundation.org, akpm@linux-foundation.org, linux-omap@vger.kernel.org, Magnus Damm , felipe.balbi@nokia.com Date: Wed, 24 Jun 2009 18:23:15 +0900 Message-Id: <20090624092315.14276.84763.sendpatchset@rx1.opensource.se> In-Reply-To: <20090624092306.14276.127.sendpatchset@rx1.opensource.se> References: <20090624092306.14276.127.sendpatchset@rx1.opensource.se> Subject: [PATCH 01/07] arm: rework omap suspend_late()/resume_early() 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 omap drivers using late/early legacy callbacks. The callbacks are converted for CONFIG_SUSPEND like this: suspend_late() -> suspend_noirq() resume_early() -> resume_noirq() Signed-off-by: Magnus Damm --- Untested but compiles just fine. arch/arm/plat-omap/debug-leds.c | 11 +++++++---- arch/arm/plat-omap/gpio.c | 14 ++++++++++---- 2 files changed, 17 insertions(+), 8 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/arch/arm/plat-omap/debug-leds.c +++ work/arch/arm/plat-omap/debug-leds.c 2009-06-01 15:50:21.000000000 +0900 @@ -281,24 +281,27 @@ static int /* __init */ fpga_probe(struc return 0; } -static int fpga_suspend_late(struct platform_device *pdev, pm_message_t mesg) +static int fpga_suspend_noirq(struct device *dev) { __raw_writew(~0, &fpga->leds); return 0; } -static int fpga_resume_early(struct platform_device *pdev) +static int fpga_resume_noirq(struct device *dev) { __raw_writew(~hw_led_state, &fpga->leds); return 0; } +static struct dev_pm_ops fpga_dev_pm_ops = { + .suspend_noirq = fpga_suspend_noirq, + .resume_noirq = fpga_resume_noirq, +}; static struct platform_driver led_driver = { .driver.name = "omap_dbg_led", + .driver.pm = &fpga_dev_pm_ops, .probe = fpga_probe, - .suspend_late = fpga_suspend_late, - .resume_early = fpga_resume_early, }; static int __init fpga_init(void) --- 0001/arch/arm/plat-omap/gpio.c +++ work/arch/arm/plat-omap/gpio.c 2009-06-01 16:30:56.000000000 +0900 @@ -1264,8 +1264,9 @@ static struct irq_chip mpuio_irq_chip = #include -static int omap_mpuio_suspend_late(struct platform_device *pdev, pm_message_t mesg) +static int omap_mpuio_suspend_noirq(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct gpio_bank *bank = platform_get_drvdata(pdev); void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT; unsigned long flags; @@ -1278,8 +1279,9 @@ static int omap_mpuio_suspend_late(struc return 0; } -static int omap_mpuio_resume_early(struct platform_device *pdev) +static int omap_mpuio_resume_noirq(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct gpio_bank *bank = platform_get_drvdata(pdev); void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT; unsigned long flags; @@ -1291,14 +1293,18 @@ static int omap_mpuio_resume_early(struc return 0; } +static struct dev_pm_ops omap_mpuio_dev_pm_ops = { + .suspend_noirq = omap_mpuio_suspend_noirq, + .resume_noirq = omap_mpuio_resume_noirq, +}; + /* use platform_driver for this, now that there's no longer any * point to sys_device (other than not disturbing old code). */ static struct platform_driver omap_mpuio_driver = { - .suspend_late = omap_mpuio_suspend_late, - .resume_early = omap_mpuio_resume_early, .driver = { .name = "mpuio", + .pm = &omap_mpuio_dev_pm_ops, }, };