From patchwork Mon Nov 8 14:07:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjugk manjugk X-Patchwork-Id: 308472 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA8E8IMt008650 for ; Mon, 8 Nov 2010 14:08:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754327Ab0KHOIP (ORCPT ); Mon, 8 Nov 2010 09:08:15 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:57506 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754371Ab0KHOIO (ORCPT ); Mon, 8 Nov 2010 09:08:14 -0500 Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id oA8E8DX0012085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Nov 2010 08:08:13 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id oA8E89P8011473; Mon, 8 Nov 2010 08:08:09 -0600 (CST) Received: from localhost (glpp-machine.apr.dhcp.ti.com [172.24.137.105]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id oA8E87f13729; Mon, 8 Nov 2010 08:08:07 -0600 (CST) From: "G, Manjunath Kondaiah" To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Benoit Cousson , Kevin Hilman , Santosh Shilimkar Subject: [PATCH v4 13/13] OMAP: PM: DMA: Enable runtime pm Date: Mon, 8 Nov 2010 19:37:52 +0530 Message-Id: <1289225272-9767-14-git-send-email-manjugk@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1289225272-9767-1-git-send-email-manjugk@ti.com> References: <1289225272-9767-1-git-send-email-manjugk@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 08 Nov 2010 14:08:20 +0000 (UTC) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 51b6a71..6eb760c 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -330,6 +331,8 @@ int omap_request_dma(int dev_id, const char *dev_name, chan = dma_chan + free_ch; chan->dev_id = dev_id; + pm_runtime_get(&pd->dev); + if (d->dev_caps & IS_WORD_16) p->clear_lch_regs(free_ch); else @@ -415,6 +418,7 @@ void omap_free_dma(int lch) omap_clear_dma(lch); p->clear_dma_sglist_mode(lch); } + pm_runtime_put(&pd->dev); spin_lock_irqsave(&dma_chan_lock, flags); dma_chan[lch].dev_id = -1; dma_chan[lch].next_lch = -1; @@ -782,6 +786,11 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) dma_chan_count = d->chan_count; dma_chan = d->chan; + /* Enable run time PM */ + pm_runtime_enable(&pd->dev); + + /* Accessing hw registers, get clock */ + pm_runtime_get(&pd->dev); for (ch = 0; ch < dma_chan_count; ch++) { unsigned long flags; omap_clear_dma(ch); @@ -809,6 +818,10 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) dma_chan[0].dev_id = 0; dma_chan[1].dev_id = 1; } + + if (!omap_dma_reserve_channels) + pm_runtime_put(&pd->dev); + return 0; exit_release_region: