Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1195773
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 02/11] mmc: host: omap_hsmmc: separate setting voltage capabilities from bus power |
| Date | 2015-07-30 09:50 +0200 |
| Message-ID | <pRQLh-gS-33@gated-at.bofh.it> (permalink) |
| References | <pRQLg-gS-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Added 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>
---
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 09e949f..2dfef11 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1812,25 +1812,34 @@ err:
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);
}
@@ -2133,6 +2142,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);
if (!pdev->dev.of_node) {
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/11] omap_hsmmc: voltage switching and tuning Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 09:50 +0200 [PATCH 07/11] mmc: host: omap_hsmmc: add tuning support Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 09:50 +0200 [PATCH 11/11] mmc: host: omap_hsmmc: add software timer when timeout greater than hardware capablility Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 09:50 +0200 [PATCH 02/11] mmc: host: omap_hsmmc: separate setting voltage capabilities from bus power Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 09:50 +0200 [PATCH 09/11] mmc: host: omap_hsmmc: Allow io voltage switch even for fixed vdd Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 09:50 +0200 [PATCH 06/11] mmc: host: omap_hsmmc: set timing in the UHSMS field Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 09:50 +0200 [PATCH 10/11] mmc: host: omap_hsmmc: remove incorrect voltage switch sequence Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 09:50 +0200 [PATCH 01/11] mmc: host: omap_hsmmc: Support vmmc_aux to switch to 1.8v Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 10:00 +0200 [PATCH 05/11] mmc: host: omap_hsmmc: set clk rate to the max frequency Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 10:00 +0200 [PATCH 03/11] mmc: host: omap_hsmmc: program HCTL based on signal_voltage set by mmc core Kishon Vijay Abraham I <kishon@ti.com> - 2015-07-30 10:00 +0200
csiph-web