Skip to content

Commit cf5ae40

Browse files
tmlindcjb
authored andcommitted
mmc: omap_hsmmc: Fix the DT pbias workaround for MMC controllers 2 to 5
Otherwise SDIO cards won't necessarily work when booted with device tree as we will never power down the SDIO cards. This means the SDIO card reset does not happen which at least some WLAN controllers expect to happen with ifconfig wlan0 down. The PBIAS voltage is only available for the first controller instance, so let's limit the PBIAS workaround to the first controller only. Signed-off-by: Tony Lindgren <tony@atomide.com> Tested-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
1 parent 728ef3d commit cf5ae40

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/mmc/host/omap_hsmmc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ struct omap_hsmmc_host {
161161
*/
162162
structregulator*vcc;
163163
structregulator*vcc_aux;
164+
intpbias_disable;
164165
void__iomem*base;
165166
resource_size_tmapbase;
166167
spinlock_tirq_lock; /* Prevent races with irq handler */
@@ -255,11 +256,11 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
255256
if (!host->vcc)
256257
return 0;
257258
/*
258-
* With DT, never turn OFF the regulator. This is because
259+
* With DT, never turn OFF the regulator for MMC1. This is because
259260
* the pbias cell programming support is still missing when
260261
* booting with Device tree
261262
*/
262-
if (dev->of_node && !vdd)
263+
if (host->pbias_disable && !vdd)
263264
return 0;
264265

265266
if (mmc_slot(host).before_set_reg)
@@ -1520,10 +1521,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
15201521
(ios->vdd == DUAL_VOLT_OCR_BIT) &&
15211522
/*
15221523
* With pbias cell programming missing, this
1523-
* can't be allowed when booting with device
1524+
* can't be allowed on MMC1 when booting with device
15241525
* tree.
15251526
*/
1526-
!host->dev->of_node) {
1527+
!host->pbias_disable) {
15271528
/*
15281529
* The mmc_select_voltage fn of the core does
15291530
* not seem to set the power_mode to
@@ -1871,6 +1872,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
18711872

18721873
omap_hsmmc_context_save(host);
18731874

1875+
/* This can be removed once we support PBIAS with DT */
1876+
if (host->dev->of_node && host->mapbase == 0x4809c000)
1877+
host->pbias_disable = 1;
1878+
18741879
host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
18751880
/*
18761881
* MMC can still work without debounce clock.

0 commit comments

Comments
 (0)