From patchwork Mon May 2 12:40:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sahitya Tummala X-Patchwork-Id: 747202 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p42CeqG4021658 for ; Mon, 2 May 2011 12:40:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756509Ab1EBMkw (ORCPT ); Mon, 2 May 2011 08:40:52 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:43288 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754941Ab1EBMkv (ORCPT ); Mon, 2 May 2011 08:40:51 -0400 X-IronPort-AV: E=McAfee;i="5400,1158,6333"; a="88964691" Received: from pdmz-ns-mip.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.114.10]) by wolverine01.qualcomm.com with ESMTP/TLS/ADH-AES256-SHA; 02 May 2011 05:40:51 -0700 Received: from stummala-linux.in.qualcomm.com (pdmz-snip-v218.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id D4A2C10004A2; Mon, 2 May 2011 05:40:30 -0700 (PDT) From: Sahitya Tummala To: davidb@codeaurora.org, bryanh@codeaurora.org, dwalker@fifo99.com Cc: linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, san@google.com, Subhash Jadavani , Sahitya Tummala Subject: [PATCH V2 7/7] mmc: msm_sdcc: Handle dma resource not present case Date: Mon, 2 May 2011 18:10:40 +0530 Message-Id: <1304340040-9149-1-git-send-email-stummala@codeaurora.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1303796066-6784-7-git-send-email-stummala@codeaurora.org> References: <1303796066-6784-7-git-send-email-stummala@codeaurora.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 02 May 2011 12:40:53 +0000 (UTC) From: Subhash Jadavani If DMA resource is not available then SDCC driver should atleast work in PIO data transfer mode. Signed-off-by: Subhash Jadavani Signed-off-by: Sahitya Tummala --- drivers/mmc/host/msm_sdcc.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index 1fe4102..0a0d582 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c @@ -1233,9 +1233,13 @@ msmsdcc_probe(struct platform_device *pdev) /* * Setup DMA */ - ret = msmsdcc_init_dma(host); - if (ret) - goto ioremap_free; + if (host->dmares) { + ret = msmsdcc_init_dma(host); + if (ret) + goto ioremap_free; + } else { + host->dma.channel = -1; + } /* Get our clocks */ host->pclk = clk_get(&pdev->dev, "sdc_pclk"); @@ -1379,8 +1383,9 @@ msmsdcc_probe(struct platform_device *pdev) pclk_put: clk_put(host->pclk); dma_free: - dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata), - host->dma.nc, host->dma.nc_busaddr); + if (host->dmares) + dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata), + host->dma.nc, host->dma.nc_busaddr); ioremap_free: tasklet_kill(&host->dma_tlet); iounmap(host->base);