Skip to content

Commit 99c14fc

Browse files
Zhoujie Wustorulf
authored andcommitted
mmc: sdhci-xenon: add set_power callback
Xenon sdh controller requests proper SD bus voltage select bits programmed even with vmmc power supply. Any reserved value(100b-000b) programmed in this field will lead to controller ignore SD bus power bit and keep its value at zero. Add set_power callback to handle this. Signed-off-by: Zhoujie Wu <[email protected]> Acked-by: Adrian Hunter <[email protected]> Tested-by: Gregory CLEMENT <[email protected]> Fixes: 3a3748d ("mmc: sdhci-xenon: Add Marvell Xenon SDHC core functionality") Cc: <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent a7c17d8 commit 99c14fc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/mmc/host/sdhci-xenon.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,27 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
210210
sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
211211
}
212212

213+
static void xenon_set_power(struct sdhci_host *host, unsigned char mode,
214+
unsigned short vdd)
215+
{
216+
struct mmc_host *mmc = host->mmc;
217+
u8 pwr = host->pwr;
218+
219+
sdhci_set_power_noreg(host, mode, vdd);
220+
221+
if (host->pwr == pwr)
222+
return;
223+
224+
if (host->pwr == 0)
225+
vdd = 0;
226+
227+
if (!IS_ERR(mmc->supply.vmmc))
228+
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
229+
}
230+
213231
static const struct sdhci_ops sdhci_xenon_ops = {
214232
.set_clock = sdhci_set_clock,
233+
.set_power = xenon_set_power,
215234
.set_bus_width = sdhci_set_bus_width,
216235
.reset = xenon_reset,
217236
.set_uhs_signaling = xenon_set_uhs_signaling,

0 commit comments

Comments
 (0)