Commit 606d3131 authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson

mmc: sdhci: Rename sdhci_set_power() to sdhci_set_power_noreg()

Unlike other cases, sdhci_set_power() does not reflect the default
implementation of the ->set_power() callback. Rename it and create
sdhci_set_power() that is the default implementation.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Cc: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent fc605f1d
...@@ -315,7 +315,7 @@ static void pxav3_set_power(struct sdhci_host *host, unsigned char mode, ...@@ -315,7 +315,7 @@ static void pxav3_set_power(struct sdhci_host *host, unsigned char mode,
struct mmc_host *mmc = host->mmc; struct mmc_host *mmc = host->mmc;
u8 pwr = host->pwr; u8 pwr = host->pwr;
sdhci_set_power(host, mode, vdd); sdhci_set_power_noreg(host, mode, vdd);
if (host->pwr == pwr) if (host->pwr == pwr)
return; return;
......
...@@ -1394,7 +1394,7 @@ static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, ...@@ -1394,7 +1394,7 @@ static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode,
sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
} }
void sdhci_set_power(struct sdhci_host *host, unsigned char mode, void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode,
unsigned short vdd) unsigned short vdd)
{ {
u8 pwr = 0; u8 pwr = 0;
...@@ -1459,20 +1459,17 @@ void sdhci_set_power(struct sdhci_host *host, unsigned char mode, ...@@ -1459,20 +1459,17 @@ void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
mdelay(10); mdelay(10);
} }
} }
EXPORT_SYMBOL_GPL(sdhci_set_power); EXPORT_SYMBOL_GPL(sdhci_set_power_noreg);
static void __sdhci_set_power(struct sdhci_host *host, unsigned char mode, void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
unsigned short vdd) unsigned short vdd)
{ {
struct mmc_host *mmc = host->mmc; if (IS_ERR(host->mmc->supply.vmmc))
sdhci_set_power_noreg(host, mode, vdd);
if (host->ops->set_power)
host->ops->set_power(host, mode, vdd);
else if (!IS_ERR(mmc->supply.vmmc))
sdhci_set_power_reg(host, mode, vdd);
else else
sdhci_set_power(host, mode, vdd); sdhci_set_power_reg(host, mode, vdd);
} }
EXPORT_SYMBOL_GPL(sdhci_set_power);
/*****************************************************************************\ /*****************************************************************************\
* * * *
...@@ -1613,7 +1610,10 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -1613,7 +1610,10 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
} }
} }
__sdhci_set_power(host, ios->power_mode, ios->vdd); if (host->ops->set_power)
host->ops->set_power(host, ios->power_mode, ios->vdd);
else
sdhci_set_power(host, ios->power_mode, ios->vdd);
if (host->ops->platform_send_init_74_clocks) if (host->ops->platform_send_init_74_clocks)
host->ops->platform_send_init_74_clocks(host, ios->power_mode); host->ops->platform_send_init_74_clocks(host, ios->power_mode);
......
...@@ -683,6 +683,8 @@ u16 sdhci_calc_clk(struct sdhci_host *host, unsigned int clock, ...@@ -683,6 +683,8 @@ u16 sdhci_calc_clk(struct sdhci_host *host, unsigned int clock,
void sdhci_set_clock(struct sdhci_host *host, unsigned int clock); void sdhci_set_clock(struct sdhci_host *host, unsigned int clock);
void sdhci_set_power(struct sdhci_host *host, unsigned char mode, void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
unsigned short vdd); unsigned short vdd);
void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode,
unsigned short vdd);
void sdhci_set_bus_width(struct sdhci_host *host, int width); void sdhci_set_bus_width(struct sdhci_host *host, int width);
void sdhci_reset(struct sdhci_host *host, u8 mask); void sdhci_reset(struct sdhci_host *host, u8 mask);
void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment