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: 5296661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D33B19F2F1 for ; Thu, 13 Nov 2014 12:59:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0184920176 for ; Thu, 13 Nov 2014 12:59:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2391320142 for ; Thu, 13 Nov 2014 12:59:00 +0000 (UTC) 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 (-----) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) {