From patchwork Wed May 18 08:45:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 68030 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2514039qge; Wed, 18 May 2016 01:46:53 -0700 (PDT) X-Received: by 10.66.65.133 with SMTP id x5mr9203507pas.108.1463561213418; Wed, 18 May 2016 01:46:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n17si10858942pfa.46.2016.05.18.01.46.53; Wed, 18 May 2016 01:46:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752969AbcERIqd (ORCPT + 3 others); Wed, 18 May 2016 04:46:33 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:45887 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782AbcERIqa (ORCPT ); Wed, 18 May 2016 04:46:30 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u4I8jfNF002419; Wed, 18 May 2016 03:45:41 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u4I8jfuv031127; Wed, 18 May 2016 03:45:41 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Wed, 18 May 2016 03:45:40 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u4I8jO56022363; Wed, 18 May 2016 03:45:33 -0500 From: Kishon Vijay Abraham I To: , , , , , , , CC: , , , , , , , , , Subject: [RFC PATCH 1/3] mmc: host: omap_hsmmc: remove *use_dma* member Date: Wed, 18 May 2016 14:15:13 +0530 Message-ID: <1463561115-31798-2-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1463561115-31798-1-git-send-email-kishon@ti.com> References: <1463561115-31798-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org omap_hsmmc doesn't support polled I/O. So remove *use_dma* which is always set to '1'. Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/omap_hsmmc.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) -- 1.7.9.5 -- 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 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index f9ac3bb..cc916d5 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -198,7 +198,7 @@ struct omap_hsmmc_host { u32 capa; int irq; int wake_irq; - int use_dma, dma_ch; + int dma_ch; struct dma_chan *tx_chan; struct dma_chan *rx_chan; int response_busy; @@ -582,8 +582,8 @@ static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host, u32 irq_mask = INT_EN_MASK; unsigned long flags; - if (host->use_dma) - irq_mask &= ~(BRR_EN | BWR_EN); + /* BRR and BWR need not be enabled for DMA */ + irq_mask &= ~(BRR_EN | BWR_EN); /* Disable timeout for erases */ if (cmd->opcode == MMC_ERASE) @@ -928,8 +928,7 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd, cmdreg &= ~(DDIR); } - if (host->use_dma) - cmdreg |= DMAE; + cmdreg |= DMAE; host->req_in_progress = 1; @@ -964,7 +963,7 @@ static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_req omap_hsmmc_disable_irq(host); /* Do not complete the request if DMA is still in progress */ - if (mrq->data && host->use_dma && dma_ch != -1) + if (mrq->data && dma_ch != -1) return; host->mrq = NULL; mmc_request_done(host->mmc, mrq); @@ -1053,7 +1052,7 @@ static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno) host->dma_ch = -1; spin_unlock_irqrestore(&host->irq_lock, flags); - if (host->use_dma && dma_ch != -1) { + if (dma_ch != -1) { struct dma_chan *chan = omap_hsmmc_get_dma_chan(host, host->data); dmaengine_terminate_all(chan); @@ -1548,12 +1547,10 @@ omap_hsmmc_prepare_data(struct omap_hsmmc_host *host, struct mmc_request *req) return 0; } - if (host->use_dma) { - ret = omap_hsmmc_setup_dma_transfer(host, req); - if (ret != 0) { - dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); - return ret; - } + ret = omap_hsmmc_setup_dma_transfer(host, req); + if (ret != 0) { + dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); + return ret; } return 0; } @@ -1564,7 +1561,7 @@ static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, struct omap_hsmmc_host *host = mmc_priv(mmc); struct mmc_data *data = mrq->data; - if (host->use_dma && data->host_cookie) { + if (data->host_cookie) { struct dma_chan *c = omap_hsmmc_get_dma_chan(host, data); dma_unmap_sg(c->device->dev, data->sg, data->sg_len, @@ -1583,13 +1580,11 @@ static void omap_hsmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, return ; } - if (host->use_dma) { - struct dma_chan *c = omap_hsmmc_get_dma_chan(host, mrq->data); + struct dma_chan *c = omap_hsmmc_get_dma_chan(host, mrq->data); - if (omap_hsmmc_pre_dma_transfer(host, mrq->data, - &host->next_data, c)) - mrq->data->host_cookie = 0; - } + if (omap_hsmmc_pre_dma_transfer(host, mrq->data, + &host->next_data, c)) + mrq->data->host_cookie = 0; } /* @@ -2052,7 +2047,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev) host->mmc = mmc; host->pdata = pdata; host->dev = &pdev->dev; - host->use_dma = 1; host->dma_ch = -1; host->irq = irq; host->mapbase = res->start + pdata->reg_offset;