From patchwork Thu Nov 13 14:54:16 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: 40770 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A9F424493 for ; Thu, 13 Nov 2014 14:54:50 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id e51sf9515636eek.6 for ; Thu, 13 Nov 2014 06:54:49 -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:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=SU3jPI0Vk+zT1smtKvvgDNBF0khfaEEuvfKaNXgp3WA=; b=VEULIQSeLvCqxrCihiB7Y4c3vByl7zNFPCHaTBhoUTJZEpKkbDjfH1JrpG/+pICihB cELe+5E/n+gWj/Tog4A9MNZ7d477ChPHlhd4QA8Ag/jC0fXOwKIvgcw4913YfpFIQGCI Rta46WC9EoY2GxmgAGU3nX+aATJI+88//CNuJkPugeTK7rZX9lq7sTR/gL96TQWYyUXt axVOrdfXpWY+cdsKVwv1cwRrl9jgWuJ3YdTFJvF0hsGG4p+x0Up6DUHhWvzoEVTHYvu5 9h/QJg6JZUzSjUKU834SCoNhAPNkhg90owp/a0HRgWhDmdRXnI6TjtcvMJJZgNEgR0KG YXRQ== X-Gm-Message-State: ALoCoQk9R372fYl3IscFgkQaCGJV6NjVyvNgw8/JJxMYzML23nGjEA5wgin8zvemgrlqalFY6dNh X-Received: by 10.180.100.100 with SMTP id ex4mr8078388wib.2.1415890489569; Thu, 13 Nov 2014 06:54:49 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.227 with SMTP id v3ls874812lav.91.gmail; Thu, 13 Nov 2014 06:54:49 -0800 (PST) X-Received: by 10.152.25.226 with SMTP id f2mr2452690lag.98.1415890489308; Thu, 13 Nov 2014 06:54:49 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id f7si12545417laa.106.2014.11.13.06.54.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 06:54:49 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id pn19so13218752lab.4 for ; Thu, 13 Nov 2014 06:54:49 -0800 (PST) X-Received: by 10.152.37.69 with SMTP id w5mr2807477laj.67.1415890489207; Thu, 13 Nov 2014 06:54:49 -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 ew9csp600604lbc; Thu, 13 Nov 2014 06:54:48 -0800 (PST) X-Received: by 10.68.135.229 with SMTP id pv5mr3175529pbb.23.1415890487428; Thu, 13 Nov 2014 06:54:47 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot5si12142669pdb.93.2014.11.13.06.54.46 for ; Thu, 13 Nov 2014 06:54:47 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754054AbaKMOyi (ORCPT + 26 others); Thu, 13 Nov 2014 09:54:38 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:46453 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754027AbaKMOye (ORCPT ); Thu, 13 Nov 2014 09:54:34 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id sADEsQ5D007324; Thu, 13 Nov 2014 08:54:26 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sADEsPje008190; Thu, 13 Nov 2014 08:54:25 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Thu, 13 Nov 2014 08:54:25 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id sADEsIVE032157; Thu, 13 Nov 2014 08:54:23 -0600 From: Kishon Vijay Abraham I To: , , CC: , , , , , , Subject: [RFC PATCH 1/3] mmc: omap_hsmmc: set host capabilities by reading MMCHS_CAPA2 register Date: Thu, 13 Nov 2014 20:24:16 +0530 Message-ID: <1415890458-20436-2-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1415890458-20436-1-git-send-email-kishon@ti.com> References: <1415890458-20436-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.45 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) {