Skip to content

Commit 35ed78a

Browse files
committed
Merge branch 'omap_hsmmc' into next
2 parents 0b07194 + ddde0e7 commit 35ed78a

File tree

7 files changed

+668
-28
lines changed

7 files changed

+668
-28
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
* TI OMAP SDHCI Controller
2+
3+
Refer to mmc.txt for standard MMC bindings.
4+
5+
Required properties:
6+
- compatible: Should be "ti,dra7-sdhci" for DRA7 and DRA72 controllers
7+
- ti,hwmods: Must be "mmc<n>", <n> is controller instance starting 1
8+
9+
Example:
10+
mmc1: mmc@4809c000 {
11+
compatible = "ti,dra7-sdhci";
12+
reg = <0x4809c000 0x400>;
13+
ti,hwmods = "mmc1";
14+
bus-width = <4>;
15+
vmmc-supply = <&vmmc>; /* phandle to regulator node */
16+
};

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12049,6 +12049,12 @@ L: [email protected]
1204912049
S: Maintained
1205012050
F: drivers/mmc/host/sdhci-spear.c
1205112051

12052+
SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) TI OMAP DRIVER
12053+
M: Kishon Vijay Abraham I <[email protected]>
12054+
12055+
S: Maintained
12056+
F: drivers/mmc/host/sdhci-omap.c
12057+
1205212058
SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER
1205312059
M: Scott Bauer <[email protected]>
1205412060
M: Jonathan Derrick <[email protected]>

drivers/mmc/host/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,3 +899,15 @@ config MMC_SDHCI_XENON
899899
This selects Marvell Xenon eMMC/SD/SDIO SDHCI.
900900
If you have a controller with this interface, say Y or M here.
901901
If unsure, say N.
902+
903+
config MMC_SDHCI_OMAP
904+
tristate "TI SDHCI Controller Support"
905+
depends on MMC_SDHCI_PLTFM && OF
906+
help
907+
This selects the Secure Digital Host Controller Interface (SDHCI)
908+
support present in TI's DRA7 SOCs. The controller supports
909+
SD/MMC/SDIO devices.
910+
911+
If you have a controller with this interface, say Y or M here.
912+
913+
If unsure, say N.

drivers/mmc/host/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-msm.o
8989
obj-$(CONFIG_MMC_SDHCI_ST) += sdhci-st.o
9090
obj-$(CONFIG_MMC_SDHCI_MICROCHIP_PIC32) += sdhci-pic32.o
9191
obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o
92+
obj-$(CONFIG_MMC_SDHCI_OMAP) += sdhci-omap.o
9293

9394
ifeq ($(CONFIG_CB710_DEBUG),y)
9495
CFLAGS-cb710-mmc += -DDEBUG

drivers/mmc/host/omap_hsmmc.c

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@
147147
#define OMAP_MMC_MAX_CLOCK 52000000
148148
#define DRIVER_NAME "omap_hsmmc"
149149

150-
#define VDD_1V8 1800000 /* 180000 uV */
151-
#define VDD_3V0 3000000 /* 300000 uV */
152-
#define VDD_165_195 (ffs(MMC_VDD_165_195) - 1)
153-
154150
/*
155151
* One controller can have multiple slots, like on some omap boards using
156152
* omap.c controller driver. Luckily this is not currently done on any known
@@ -308,26 +304,14 @@ static int omap_hsmmc_disable_supply(struct mmc_host *mmc)
308304
return ret;
309305
}
310306

311-
static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
312-
int vdd)
307+
static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on)
313308
{
314309
int ret;
315310

316311
if (IS_ERR(host->pbias))
317312
return 0;
318313

319314
if (power_on) {
320-
if (vdd <= VDD_165_195)
321-
ret = regulator_set_voltage(host->pbias, VDD_1V8,
322-
VDD_1V8);
323-
else
324-
ret = regulator_set_voltage(host->pbias, VDD_3V0,
325-
VDD_3V0);
326-
if (ret < 0) {
327-
dev_err(host->dev, "pbias set voltage fail\n");
328-
return ret;
329-
}
330-
331315
if (host->pbias_enabled == 0) {
332316
ret = regulator_enable(host->pbias);
333317
if (ret) {
@@ -350,8 +334,7 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
350334
return 0;
351335
}
352336

353-
static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
354-
int vdd)
337+
static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on)
355338
{
356339
struct mmc_host *mmc = host->mmc;
357340
int ret = 0;
@@ -363,7 +346,7 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
363346
if (IS_ERR(mmc->supply.vmmc))
364347
return 0;
365348

366-
ret = omap_hsmmc_set_pbias(host, false, 0);
349+
ret = omap_hsmmc_set_pbias(host, false);
367350
if (ret)
368351
return ret;
369352

@@ -385,7 +368,7 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
385368
if (ret)
386369
return ret;
387370

388-
ret = omap_hsmmc_set_pbias(host, true, vdd);
371+
ret = omap_hsmmc_set_pbias(host, true);
389372
if (ret)
390373
goto err_set_voltage;
391374
} else {
@@ -1220,11 +1203,11 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
12201203
clk_disable_unprepare(host->dbclk);
12211204

12221205
/* Turn the power off */
1223-
ret = omap_hsmmc_set_power(host, 0, 0);
1206+
ret = omap_hsmmc_set_power(host, 0);
12241207

12251208
/* Turn the power ON with given VDD 1.8 or 3.0v */
12261209
if (!ret)
1227-
ret = omap_hsmmc_set_power(host, 1, vdd);
1210+
ret = omap_hsmmc_set_power(host, 1);
12281211
if (host->dbclk)
12291212
clk_prepare_enable(host->dbclk);
12301213

@@ -1621,10 +1604,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
16211604
if (ios->power_mode != host->power_mode) {
16221605
switch (ios->power_mode) {
16231606
case MMC_POWER_OFF:
1624-
omap_hsmmc_set_power(host, 0, 0);
1607+
omap_hsmmc_set_power(host, 0);
16251608
break;
16261609
case MMC_POWER_UP:
1627-
omap_hsmmc_set_power(host, 1, ios->vdd);
1610+
omap_hsmmc_set_power(host, 1);
16281611
break;
16291612
case MMC_POWER_ON:
16301613
do_send_init_stream = 1;

0 commit comments

Comments
 (0)