From patchwork Fri Jun 5 07:54:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 28083 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 n557vxTY024758 for ; Fri, 5 Jun 2009 07:58:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755343AbZFEH6O (ORCPT ); Fri, 5 Jun 2009 03:58:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754661AbZFEH6O (ORCPT ); Fri, 5 Jun 2009 03:58:14 -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 S1754759AbZFEH6N (ORCPT ); Fri, 5 Jun 2009 03:58:13 -0400 Received: by rv-out-0506.google.com with SMTP id f9so604462rvb.1 for ; Fri, 05 Jun 2009 00:58:15 -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=ZWibKljDlGyisC9+5tu0QOl76kQyKZa/GRR0qyNKOAwS0CX7hW/9sDhnUcPVX7l4U1 fd0wcucez3U5wUsiQo+EgSh094batXxECeuZxVvIkuOuIFG+PsrnwXseGsQEcslkYpdj RIlzQab4ikPAmKrKnvid/BucWwkWmCde1Mw/0= 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=Kk+ZTVEU+wF0SA1AKzcXVYh1S9xfCnqwW206NVMhSvOzNffLX3jEJ3zN7HXvLrIIUb 9qfVKvrI0WYOBVh2EIegmCVYapFbRy4pTTYoPo1eoZLKJbzQhVwWoQYRJSvQA61Bk5zL 6YqXaj8HuoO8AFcRmI4qWAREew/wzL3ClNu7Y= Received: by 10.141.19.3 with SMTP id w3mr2827037rvi.74.1244188695725; Fri, 05 Jun 2009 00:58:15 -0700 (PDT) Received: from rx1.opensource.se (mailhost.igel.co.jp [219.106.231.130]) by mx.google.com with ESMTPS id g14sm6434871rvb.42.2009.06.05.00.58.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Jun 2009 00:58:14 -0700 (PDT) From: Magnus Damm To: linux-pm@lists.linux-foundation.org Cc: pavel@ucw.cz, hskinnemoen@atmel.com, anemo@mba.ocn.ne.jp, gregkh@suse.de, rjw@sisk.pl, stern@rowland.harvard.edu, ben-linux@fluff.org, felipe.balbi@nokia.com, linux-omap@vger.kernel.org, Magnus Damm Date: Fri, 05 Jun 2009 16:54:55 +0900 Message-Id: <20090605075455.14756.13684.sendpatchset@rx1.opensource.se> In-Reply-To: <20090605075436.14756.80501.sendpatchset@rx1.opensource.se> References: <20090605075436.14756.80501.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, }, };