From patchwork Mon Jun 6 07:30:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 850952 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p567NAM2024033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 6 Jun 2011 07:23:31 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QTU9S-0007B8-Kw; Mon, 06 Jun 2011 07:23:06 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QTU9S-0004j0-75; Mon, 06 Jun 2011 07:23:06 +0000 Received: from mail-pw0-f49.google.com ([209.85.160.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QTU9P-0004ig-Mj for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2011 07:23:04 +0000 Received: by pwi8 with SMTP id 8so2792907pwi.36 for ; Mon, 06 Jun 2011 00:23:01 -0700 (PDT) Received: by 10.68.32.232 with SMTP id m8mr1529721pbi.99.1307344981768; Mon, 06 Jun 2011 00:23:01 -0700 (PDT) Received: from localhost.localdomain ([114.216.154.92]) by mx.google.com with ESMTPS id w2sm3488934pbg.37.2011.06.06.00.22.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2011 00:23:01 -0700 (PDT) From: Shawn Guo To: linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] mmc: mxs-mmc: call dmaengine API to set mmc->max_segs Date: Mon, 6 Jun 2011 15:30:14 +0800 Message-Id: <1307345414-26872-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1307345414-26872-1-git-send-email-shawn.guo@linaro.org> References: <1307345414-26872-1-git-send-email-shawn.guo@linaro.org> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110606_032303_959323_E60D2923 X-CRM114-Status: GOOD ( 12.08 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] Cc: Shawn Guo , patches@linaro.org, vinod.koul@intel.com, linux-mmc@vger.kernel.org, dan.j.williams@intel.com, cjb@laptop.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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, 06 Jun 2011 07:23:31 +0000 (UTC) With dmaengine API dma_get_max_seg_number added, we now can call the API to get and number and then set mmc->max_segs instead of hard-coding it. Signed-off-by: Shawn Guo --- drivers/mmc/host/mxs-mmc.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 99d39a6..d783af3 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -745,11 +745,15 @@ static int mxs_mmc_probe(struct platform_device *pdev) mmc->f_max = 288000000; mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; - mmc->max_segs = 52; mmc->max_blk_size = 1 << 0xf; mmc->max_blk_count = (ssp_is_old()) ? 0xff : 0xffffff; mmc->max_req_size = (ssp_is_old()) ? 0xffff : 0xffffffff; mmc->max_seg_size = dma_get_max_seg_size(host->dmach->device->dev); + /* + * Reserve one segment for carrying on pio words to get dma engine + * program mmc controller registers + */ + mmc->max_segs = dma_get_max_seg_number(host->dmach->device->dev) - 1; platform_set_drvdata(pdev, mmc);