From patchwork Tue Jan 31 17:56:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 6479 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B4B9723E0E for ; Tue, 31 Jan 2012 17:51:15 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id A32B6A18403 for ; Tue, 31 Jan 2012 17:51:15 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id r19so301166bka.11 for ; Tue, 31 Jan 2012 09:51:15 -0800 (PST) Received: by 10.204.9.198 with SMTP id m6mr4583728bkm.74.1328032275467; Tue, 31 Jan 2012 09:51:15 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.130.220 with SMTP id u28cs189017bks; Tue, 31 Jan 2012 09:51:15 -0800 (PST) Received: by 10.68.134.103 with SMTP id pj7mr32448475pbb.45.1328032274149; Tue, 31 Jan 2012 09:51:14 -0800 (PST) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id l7si16469419pbd.181.2012.01.31.09.51.13; Tue, 31 Jan 2012 09:51:14 -0800 (PST) Received-SPF: neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LYO005WXC933HR0@mailout1.samsung.com> for patches@linaro.org; Wed, 01 Feb 2012 02:51:12 +0900 (KST) X-AuditID: cbfee61a-b7cd2ae000004fa5-50-4f282a10f5f1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 8B.50.20389.01A282F4; Wed, 01 Feb 2012 02:51:12 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0LYO00JBQC8XW340@mmp2.samsung.com> for patches@linaro.org; Wed, 01 Feb 2012 02:51:12 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org, cjb@laptop.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, ben-linux@fluff.org, patches@linaro.org Subject: [PATCH v3 4/6] mmc: sdhci-s3c: derive transfer width host capability from max_width in platform data Date: Tue, 31 Jan 2012 23:26:14 +0530 Message-id: <1328032576-9269-5-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1328032576-9269-1-git-send-email-thomas.abraham@linaro.org> References: <1328032576-9269-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== max_width member in platform data can be used to derive the mmc bus transfer width that can be supported by the controller. Signed-off-by: Thomas Abraham --- drivers/mmc/host/sdhci-s3c.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index e1b685d..a57d7a0 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -562,6 +562,14 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT) host->mmc->caps = MMC_CAP_NONREMOVABLE; + switch (pdata->max_width) { + case 8: + host->mmc->caps |= MMC_CAP_8_BIT_DATA; + case 4: + host->mmc->caps |= MMC_CAP_4_BIT_DATA; + break; + } + if (pdata->host_caps) host->mmc->caps |= pdata->host_caps;