From patchwork Wed Jun 24 09:24:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 32113 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 n5O9Rv3S003003 for ; Wed, 24 Jun 2009 09:27:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756739AbZFXJ1f (ORCPT ); Wed, 24 Jun 2009 05:27:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756588AbZFXJ1e (ORCPT ); Wed, 24 Jun 2009 05:27:34 -0400 Received: from wa-out-1112.google.com ([209.85.146.182]:4082 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbZFXJ1d (ORCPT ); Wed, 24 Jun 2009 05:27:33 -0400 Received: by wa-out-1112.google.com with SMTP id j5so133914wah.21 for ; Wed, 24 Jun 2009 02:27:36 -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=gdtc03vHMlsoNyRUwDvVfja0bsvH4rl/jhydHYo4Ans=; b=ZTMKqYnV01ifmXVbOaBcQCNC9KQgY3/64zv6j60DnuxH/Q7qJ3EdtRVtKqFHmdq+j7 vEZExdzVkRQ9cVlBinFbjqVAtg4+uBjOZkHAXh6V5l3Gb/i1zzAJsPg3fdOM8z7d7Het Ogl/C+mchbVaYSvtBKgKy4kTOIOO/yWthZ970= 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=gndPnaVjUpouztR0cbwhwYBSX29CgkXlTWU1+rpEghVmtxcCIIUpN/IsAQG+6blIIy rb3sHej9rlluBQg4X8VgWvGjyZSQfF5sO+zqF4Si+RY3RuzRcqxdgwSPWhEv3pS/NMmu xFRinDDHYHqz+zobeBEH55S/76sRSP8QNTO/U= Received: by 10.114.185.12 with SMTP id i12mr1716658waf.16.1245835656470; Wed, 24 Jun 2009 02:27:36 -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 k35sm1440216waf.53.2009.06.24.02.27.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Jun 2009 02:27:35 -0700 (PDT) From: Magnus Damm To: linux-kernel@vger.kernel.org Cc: gregkh@suse.de, pavel@ucw.cz, hskinnemoen@atmel.com, anemo@mba.ocn.ne.jp, linux-usb@vger.kernel.org, akpm@linux-foundation.org, rjw@sisk.pl, stern@rowland.harvard.edu, ben-linux@fluff.org, Magnus Damm , linux-omap@vger.kernel.org, linux-pm@lists.linux-foundation.org, felipe.balbi@nokia.com Date: Wed, 24 Jun 2009 18:24:00 +0900 Message-Id: <20090624092400.14276.94490.sendpatchset@rx1.opensource.se> In-Reply-To: <20090624092306.14276.127.sendpatchset@rx1.opensource.se> References: <20090624092306.14276.127.sendpatchset@rx1.opensource.se> Subject: [PATCH 06/07] usb: rework musb suspend()/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 musb from legacy callbacks to dev_pm_ops. The callbacks are converted for CONFIG_SUSPEND like this: suspend() -> suspend() resume_early() -> resume_noirq() Signed-off-by: Magnus Damm --- Untested but compiles fine. drivers/i2c/busses/i2c-pxa.c | 25 +++++++++++++++++-------- 1 file 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/drivers/usb/musb/musb_core.c +++ work/drivers/usb/musb/musb_core.c 2009-06-01 15:27:12.000000000 +0900 @@ -2168,8 +2168,9 @@ static int __devexit musb_remove(struct #ifdef CONFIG_PM -static int musb_suspend(struct platform_device *pdev, pm_message_t message) +static int musb_suspend(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); unsigned long flags; struct musb *musb = dev_to_musb(&pdev->dev); @@ -2196,8 +2197,9 @@ static int musb_suspend(struct platform_ return 0; } -static int musb_resume_early(struct platform_device *pdev) +static int musb_resume_noirq(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct musb *musb = dev_to_musb(&pdev->dev); if (!musb->clock) @@ -2215,9 +2217,14 @@ static int musb_resume_early(struct plat return 0; } +static struct dev_pm_ops musb_dev_pm_ops = { + .suspend = musb_suspend, + .resume_noirq = musb_resume_noirq, +}; + +#define MUSB_DEV_PM_OPS (&musb_dev_pm_ops) #else -#define musb_suspend NULL -#define musb_resume_early NULL +#define MUSB_DEV_PM_OPS NULL #endif static struct platform_driver musb_driver = { @@ -2225,11 +2232,10 @@ static struct platform_driver musb_drive .name = (char *)musb_driver_name, .bus = &platform_bus_type, .owner = THIS_MODULE, + .pm = MUSB_DEV_PM_OPS, }, .remove = __devexit_p(musb_remove), .shutdown = musb_shutdown, - .suspend = musb_suspend, - .resume_early = musb_resume_early, }; /*-------------------------------------------------------------------------*/