From patchwork Thu Nov 13 12:56:17 2014 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: 40758 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3D037240ED for ; Thu, 13 Nov 2014 12:58:33 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c41sf9385403eek.0 for ; Thu, 13 Nov 2014 04:58:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=o4pp5DlvndDrKtSDLPxLBW8Nogw5bz55s5xmd8tnewU=; b=K0P+NqZjvSaOO7LTibqI6gM/LgDyLk4/fhcFNMcrWrCuCVhoP8A8hbpf8+Log91k8h 62TAEbFspw4lu0LzgVUAj6LrGCaDaqnY1ffCzPEAwvZG7hJ30sWBRZ3bekVqB9Xl2USx wLMEQA5Tx7LRxNL84MdvOpSFF1Y+G9yp2U+pvlhDYAvNCsSsA96OIzKB3SJIDC589wDX zIES/vTTGWLC8zoYfEw9rwMUD6haQJM3u5KBIUMy05x1j06W3bItX2xpSB8w63Q2nHo8 4DgWULo2GSOBHORKDDyML/rNYmZ5ySalpumgSo6NJpJniQr7e8AU59lNHqZej4eX16yB qjug== X-Gm-Message-State: ALoCoQkjyyRYq15Wznpb81bk0OuCqxZnG4apCAS8Or7TcOUT44f++xqJ43CKiqiPouxBGm9SdSyb X-Received: by 10.181.13.80 with SMTP id ew16mr6153580wid.4.1415883512381; Thu, 13 Nov 2014 04:58:32 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.99 with SMTP id bf3ls115920lab.13.gmail; Thu, 13 Nov 2014 04:58:32 -0800 (PST) X-Received: by 10.152.204.70 with SMTP id kw6mr2255027lac.85.1415883512210; Thu, 13 Nov 2014 04:58:32 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id ce7si38354786lbc.71.2014.11.13.04.58.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 04:58:32 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id gf13so1235042lab.14 for ; Thu, 13 Nov 2014 04:58:32 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr2291020lal.29.1415883512125; Thu, 13 Nov 2014 04:58:32 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp584235lbc; Thu, 13 Nov 2014 04:58:31 -0800 (PST) X-Received: by 10.70.90.45 with SMTP id bt13mr2307948pdb.111.1415883509487; Thu, 13 Nov 2014 04:58:29 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id i17si25557897pdk.169.2014.11.13.04.58.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 04:58:29 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XotxZ-0005AN-OH; Thu, 13 Nov 2014 12:57:13 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XotxC-0004Q9-2s for linux-arm-kernel@lists.infradead.org; Thu, 13 Nov 2014 12:56:50 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id sADCuRES028312; Thu, 13 Nov 2014 06:56:27 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sADCuRS9017771; Thu, 13 Nov 2014 06:56:27 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Thu, 13 Nov 2014 06:56:28 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id sADCuKve027000; Thu, 13 Nov 2014 06:56:24 -0600 From: Kishon Vijay Abraham I To: , , Subject: [RFC PATCH 1/3] mmc: omap_hsmmc: set host capabilities by reading MMCHS_CAPA2 register Date: Thu, 13 Nov 2014 18:26:17 +0530 Message-ID: <1415883379-19654-2-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1415883379-19654-1-git-send-email-kishon@ti.com> References: <1415883379-19654-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141113_045650_310770_BEAB9977 X-CRM114-Status: UNSURE ( 8.35 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.6 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.94.94.41 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: devicetree@vger.kernel.org, nsekhar@ti.com, afenkart@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kishon@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Viswanath Puttagunta set SDR104, SDR50, DDR50 and HS200 capability flags to caps/caps2 by reading MMCHS_CAPA2 register. Signed-off-by: Viswanath Puttagunta Signed-off-by: Sourav Poddar Signed-off-by: Kishon Vijay Abraham I Suggested-by: Misael Lopez Cruz --- drivers/mmc/host/omap_hsmmc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index df27bb4..2e42ed3 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -64,6 +64,7 @@ #define OMAP_HSMMC_ISE 0x0138 #define OMAP_HSMMC_AC12 0x013C #define OMAP_HSMMC_CAPA 0x0140 +#define OMAP_HSMMC_CAPA2 0x0144 #define VS18 (1 << 26) #define VS30 (1 << 25) @@ -139,6 +140,10 @@ #define ACTO (1 << 1) #define ACNE (1 << 0) +#define SDR50 (1 << 0) +#define SDR104 (1 << 1) +#define DDR50 (1 << 2) + #define MMC_AUTOSUSPEND_DELAY 100 #define MMC_TIMEOUT_MS 20 /* 20 mSec */ #define MMC_TIMEOUT_US 20000 /* 20000 micro Sec */ @@ -2028,6 +2033,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) unsigned tx_req, rx_req; const struct omap_mmc_of_data *data; void __iomem *base; + u32 reg; match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev); if (match) { @@ -2153,6 +2159,19 @@ static int omap_hsmmc_probe(struct platform_device *pdev) mmc->pm_caps = mmc_slot(host).pm_caps; + reg = OMAP_HSMMC_READ(host->base, OMAP_HSMMC_CAPA2); + + if (reg & SDR50) + mmc->caps |= MMC_CAP_UHS_DDR50; + + if (reg & SDR104) { + mmc->caps |= MMC_CAP_UHS_SDR104; + mmc->caps2 |= MMC_CAP2_HS200; + } + + if (reg & DDR50) + mmc->caps |= MMC_CAP_UHS_DDR50; + omap_hsmmc_conf_bus_power(host); if (!pdev->dev.of_node) {