From patchwork Thu May 26 06:31:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 1639 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:53:44 -0000 Delivered-To: patches@linaro.org Received: by 10.52.181.230 with SMTP id dz6cs3553vdc; Wed, 25 May 2011 23:27:05 -0700 (PDT) Received: by 10.227.198.197 with SMTP id ep5mr444379wbb.33.1306391224509; Wed, 25 May 2011 23:27:04 -0700 (PDT) Received: from DB3EHSOBE006.bigfish.com (db3ehsobe006.messaging.microsoft.com [213.199.154.144]) by mx.google.com with ESMTPS id fm18si747585wbb.99.2011.05.25.23.27.04 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 23:27:04 -0700 (PDT) Received-SPF: neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=213.199.154.144; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: from mail105-db3-R.bigfish.com (10.3.81.248) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.22; Thu, 26 May 2011 06:27:03 +0000 Received: from mail105-db3 (localhost.localdomain [127.0.0.1]) by mail105-db3-R.bigfish.com (Postfix) with ESMTP id 817B6F487BE; Thu, 26 May 2011 06:27:03 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail105-db3 (localhost.localdomain [127.0.0.1]) by mail105-db3 (MessageSwitch) id 1306391223262344_9603; Thu, 26 May 2011 06:27:03 +0000 (UTC) Received: from DB3EHSMHS010.bigfish.com (unknown [10.3.81.242]) by mail105-db3.bigfish.com (Postfix) with ESMTP id 3B5771A20051; Thu, 26 May 2011 06:27:03 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS010.bigfish.com (10.3.87.110) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 26 May 2011 06:27:02 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.270.2; Thu, 26 May 2011 01:26:58 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p4Q6QpUQ026468; Thu, 26 May 2011 01:26:56 -0500 (CDT) From: Shawn Guo To: CC: , , , , Shawn Guo Subject: [PATCH 3/3] mmc: mxs-mmc: call dmaengine API to set mmc->max_segs Date: Thu, 26 May 2011 14:31:33 +0800 Message-ID: <1306391493-29425-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1306391493-29425-1-git-send-email-shawn.guo@linaro.org> References: <1306391493-29425-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com 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);