From patchwork Wed Jun 24 09:23: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: 32117 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 n5O9XJht003843 for ; Wed, 24 Jun 2009 09:33:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757542AbZFXJcv (ORCPT ); Wed, 24 Jun 2009 05:32:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757551AbZFXJcu (ORCPT ); Wed, 24 Jun 2009 05:32:50 -0400 Received: from mail-px0-f190.google.com ([209.85.216.190]:43378 "EHLO mail-px0-f190.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757341AbZFXJcs (ORCPT ); Wed, 24 Jun 2009 05:32:48 -0400 Received: by pxi28 with SMTP id 28so268081pxi.33 for ; Wed, 24 Jun 2009 02:32:51 -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=M5lxf/BJ0yRBdSCeLVh5hJ7wuSvw9Hfg9eUqAto9qoM=; b=OewakyEl4CY0Lebfyv0MLb6bCIRydpq4L7nUjVJD2D6vKBSRzInmnSzOS67KSLRIpM H4On/ezNMZc+FAZmBu2pSafzDYVv4mkpMe/u7rdNKXM6VZx/KZamOrdTXsv9iAzTVZi+ G+X6inhWMamv3vaikvMMyr943eflN14QFOV7s= 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=IsRKLDanttsbut0Z/2arCr3jkhcS4CJGeEbrOvOVMHwfsKeRZ+6jnWXdQzuk2TPytk 4rbxfLXANT634kUYOxPVSOExsU3oql+PD6g1AF6lGpR84BrIABZXICKJTuxHheKAsuq9 oPDo+rIXX36PaSNDqAxCXeda9DWpPPvVD8NRI= Received: by 10.114.52.16 with SMTP id z16mr1646711waz.220.1245835620489; Wed, 24 Jun 2009 02:27:00 -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 c26sm1460516waa.15.2009.06.24.02.26.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Jun 2009 02:26:59 -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, Magnus Damm , rjw@sisk.pl, stern@rowland.harvard.edu, ben-linux@fluff.org, linux-pm@lists.linux-foundation.org, linux-omap@vger.kernel.org, akpm@linux-foundation.org, felipe.balbi@nokia.com Date: Wed, 24 Jun 2009 18:23:24 +0900 Message-Id: <20090624092324.14276.5263.sendpatchset@rx1.opensource.se> In-Reply-To: <20090624092306.14276.127.sendpatchset@rx1.opensource.se> References: <20090624092306.14276.127.sendpatchset@rx1.opensource.se> Subject: [PATCH 02/07] dma: rework dw_dmac 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 dw_dmac from legacy late/early callbacks to dev_pm_ops. The callbacks are converted for CONFIG_SUSPEND like this: suspend_late() -> suspend_noirq() resume_early() -> resume_noirq() Signed-off-by: Magnus Damm --- Untested and not test compiled due to lack of cross compiler. drivers/dma/dw_dmac.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 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/dma/dw_dmac.c +++ work/drivers/dma/dw_dmac.c 2009-06-01 16:31:34.000000000 +0900 @@ -1399,8 +1399,9 @@ static void dw_shutdown(struct platform_ clk_disable(dw->clk); } -static int dw_suspend_late(struct platform_device *pdev, pm_message_t mesg) +static int dw_suspend_noirq(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct dw_dma *dw = platform_get_drvdata(pdev); dw_dma_off(platform_get_drvdata(pdev)); @@ -1408,23 +1409,27 @@ static int dw_suspend_late(struct platfo return 0; } -static int dw_resume_early(struct platform_device *pdev) +static int dw_resume_noirq(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct dw_dma *dw = platform_get_drvdata(pdev); clk_enable(dw->clk); dma_writel(dw, CFG, DW_CFG_DMA_EN); return 0; - } +static struct dev_pm_ops dw_dev_pm_ops = { + .suspend_noirq = dw_suspend_noirq, + .resume_noirq = dw_resume_noirq, +}; + static struct platform_driver dw_driver = { .remove = __exit_p(dw_remove), .shutdown = dw_shutdown, - .suspend_late = dw_suspend_late, - .resume_early = dw_resume_early, .driver = { .name = "dw_dmac", + .pm = &dw_dev_pm_ops, }, };