From: Kishon Vijay Abraham I <kishon@ti.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Tony Lindgren <tony@atomide.com>, <nsekhar@ti.com>
Cc: Russell King <linux@armlinux.org.uk>,
Ravikumar Kattekola <rk@ti.com>, <linux-mmc@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-omap@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <kishon@ti.com>
Subject: [PATCH 02/16] mmc: host: omap_hsmmc: Separate setting voltage capabilities from bus power
Date: Fri, 16 Jun 2017 18:15:30 +0530 [thread overview]
Message-ID: <20170616124544.15046-3-kishon@ti.com> (raw)
In-Reply-To: <20170616124544.15046-1-kishon@ti.com>
Add a separate function to set the voltage capabilities of the host
controller. Voltage capabilities should be set only once during
controller initialization but bus power can be changed every time there
is a voltage switch and whenever a different card is inserted.
This allows omap_hsmmc_conf_bus_power to be invoked every time there
is a voltage switch.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
drivers/mmc/host/omap_hsmmc.c | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 48bb06788d9f..c9ea41bb4e3a 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1799,25 +1799,34 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
return ret;
}
+static void omap_hsmmc_set_capabilities(struct omap_hsmmc_host *host)
+{
+ u32 val;
+
+ val = OMAP_HSMMC_READ(host->base, CAPA);
+
+ /* Only MMC1 supports 3.0V */
+ if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT)
+ val |= (VS30 | VS18);
+ else
+ val |= VS18;
+
+ OMAP_HSMMC_WRITE(host->base, CAPA, val);
+}
+
static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
{
- u32 hctl, capa, value;
+ u32 hctl, value;
/* Only MMC1 supports 3.0V */
- if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) {
+ if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT)
hctl = SDVS30;
- capa = VS30 | VS18;
- } else {
+ else
hctl = SDVS18;
- capa = VS18;
- }
value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl);
- value = OMAP_HSMMC_READ(host->base, CAPA);
- OMAP_HSMMC_WRITE(host->base, CAPA, value | capa);
-
/* Set SD bus power bit */
set_sd_bus_power(host);
}
@@ -2124,6 +2133,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
mmc->pm_caps |= mmc_pdata(host)->pm_caps;
+ omap_hsmmc_set_capabilities(host);
omap_hsmmc_conf_bus_power(host);
host->rx_chan = dma_request_chan(&pdev->dev, "rx");
--
2.11.0
next prev parent reply other threads:[~2017-06-16 12:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-16 12:45 [PATCH 00/16] omap_hsmmc: Add ADMA support and UHS/HS200/DDR support Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 01/16] mmc: host: omap_hsmmc: Support pbias and vmmc_aux to switch to 1.8v Kishon Vijay Abraham I
2017-06-16 12:45 ` Kishon Vijay Abraham I [this message]
2017-06-16 12:45 ` [PATCH 03/16] mmc: host: omap_hsmmc: Remove incorrect voltage switch sequence Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 04/16] mmc: host: omap_hsmmc: Add voltage switch support for UHS SD card Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 05/16] mmc: host: omap_hsmmc: Set clk rate to the max frequency Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 06/16] mmc: host: omap_hsmmc: Add tuning support Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 07/16] mmc: host: omap_hsmmc: Allow io voltage switch even for fixed vdd Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 08/16] mmc: host: omap_hsmmc: Add software timer when timeout greater than hardware capablility Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 09/16] mmc: host: omap_hsmmc: Prepare *set_timing() to be used for iodelay setting Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 10/16] mmc: host: omap_hsmmc: Add new compatible string to support dra7 Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 11/16] mmc: host: omap_hsmmc: Fix error path sequence Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 12/16] mmc: host: omap_hsmmc: Add support to set IODELAY values Kishon Vijay Abraham I
2017-06-19 6:02 ` Tony Lindgren
2017-06-19 6:36 ` Kishon Vijay Abraham I
2017-06-19 7:25 ` Tony Lindgren
2017-06-19 7:54 ` Kishon Vijay Abraham I
2017-06-19 14:33 ` Tony Lindgren
2017-06-23 18:52 ` Rob Herring
2017-06-16 12:45 ` [PATCH 13/16] mmc: host: omap_hsmmc: Remove *use_dma* member Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 14/16] mmc: host: omap_hsmmc: Enable ADMA2 Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 15/16] ARM: dts: dra7: Use new dra7-specific compatible string Kishon Vijay Abraham I
2017-06-16 12:45 ` [PATCH 16/16] ARM: dts: dra7: Add supported MMC/SD modes in MMC dt nodes Kishon Vijay Abraham I
2017-07-11 13:10 ` [PATCH 00/16] omap_hsmmc: Add ADMA support and UHS/HS200/DDR support Ulf Hansson
2017-07-11 13:57 ` Kishon Vijay Abraham I
2017-07-20 13:36 ` Kishon Vijay Abraham I
2017-08-03 10:40 ` Ulf Hansson
2017-08-03 10:55 ` Adrian Hunter
2017-08-03 11:22 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170616124544.15046-3-kishon@ti.com \
--to=kishon@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nsekhar@ti.com \
--cc=rk@ti.com \
--cc=robh+dt@kernel.org \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox