diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2016-10-05 05:11:22 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-10-10 08:20:41 -0400 |
commit | 606d313124094d87050896a10894200cdd2b0514 (patch) | |
tree | e3e2e02bafb734aede910cbcc8ecd42501a4cd35 | |
parent | fc605f1d8060133596bb6083fc4b7b306d1d5931 (diff) |
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: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/sdhci-pxav3.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 26 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.h | 2 |
3 files changed, 16 insertions, 14 deletions
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index dd1938d341f7..d0f5c05fbc19 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c | |||
@@ -315,7 +315,7 @@ static void pxav3_set_power(struct sdhci_host *host, unsigned char mode, | |||
315 | struct mmc_host *mmc = host->mmc; | 315 | struct mmc_host *mmc = host->mmc; |
316 | u8 pwr = host->pwr; | 316 | u8 pwr = host->pwr; |
317 | 317 | ||
318 | sdhci_set_power(host, mode, vdd); | 318 | sdhci_set_power_noreg(host, mode, vdd); |
319 | 319 | ||
320 | if (host->pwr == pwr) | 320 | if (host->pwr == pwr) |
321 | return; | 321 | return; |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3711813f5654..223a91e039dc 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1394,8 +1394,8 @@ static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, | |||
1394 | sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); | 1394 | sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); |
1395 | } | 1395 | } |
1396 | 1396 | ||
1397 | void sdhci_set_power(struct sdhci_host *host, unsigned char mode, | 1397 | void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, |
1398 | unsigned short vdd) | 1398 | unsigned short vdd) |
1399 | { | 1399 | { |
1400 | u8 pwr = 0; | 1400 | u8 pwr = 0; |
1401 | 1401 | ||
@@ -1459,20 +1459,17 @@ void sdhci_set_power(struct sdhci_host *host, unsigned char mode, | |||
1459 | mdelay(10); | 1459 | mdelay(10); |
1460 | } | 1460 | } |
1461 | } | 1461 | } |
1462 | EXPORT_SYMBOL_GPL(sdhci_set_power); | 1462 | EXPORT_SYMBOL_GPL(sdhci_set_power_noreg); |
1463 | 1463 | ||
1464 | static void __sdhci_set_power(struct sdhci_host *host, unsigned char mode, | 1464 | void sdhci_set_power(struct sdhci_host *host, unsigned char mode, |
1465 | unsigned short vdd) | 1465 | unsigned short vdd) |
1466 | { | 1466 | { |
1467 | struct mmc_host *mmc = host->mmc; | 1467 | if (IS_ERR(host->mmc->supply.vmmc)) |
1468 | 1468 | sdhci_set_power_noreg(host, mode, vdd); | |
1469 | if (host->ops->set_power) | ||
1470 | host->ops->set_power(host, mode, vdd); | ||
1471 | else if (!IS_ERR(mmc->supply.vmmc)) | ||
1472 | sdhci_set_power_reg(host, mode, vdd); | ||
1473 | else | 1469 | else |
1474 | sdhci_set_power(host, mode, vdd); | 1470 | sdhci_set_power_reg(host, mode, vdd); |
1475 | } | 1471 | } |
1472 | EXPORT_SYMBOL_GPL(sdhci_set_power); | ||
1476 | 1473 | ||
1477 | /*****************************************************************************\ | 1474 | /*****************************************************************************\ |
1478 | * * | 1475 | * * |
@@ -1613,7 +1610,10 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
1613 | } | 1610 | } |
1614 | } | 1611 | } |
1615 | 1612 | ||
1616 | __sdhci_set_power(host, ios->power_mode, ios->vdd); | 1613 | if (host->ops->set_power) |
1614 | host->ops->set_power(host, ios->power_mode, ios->vdd); | ||
1615 | else | ||
1616 | sdhci_set_power(host, ios->power_mode, ios->vdd); | ||
1617 | 1617 | ||
1618 | if (host->ops->platform_send_init_74_clocks) | 1618 | if (host->ops->platform_send_init_74_clocks) |
1619 | host->ops->platform_send_init_74_clocks(host, ios->power_mode); | 1619 | host->ops->platform_send_init_74_clocks(host, ios->power_mode); |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index c722cd23205c..766df17fb7eb 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -683,6 +683,8 @@ u16 sdhci_calc_clk(struct sdhci_host *host, unsigned int clock, | |||
683 | void sdhci_set_clock(struct sdhci_host *host, unsigned int clock); | 683 | void sdhci_set_clock(struct sdhci_host *host, unsigned int clock); |
684 | void sdhci_set_power(struct sdhci_host *host, unsigned char mode, | 684 | void sdhci_set_power(struct sdhci_host *host, unsigned char mode, |
685 | unsigned short vdd); | 685 | unsigned short vdd); |
686 | void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, | ||
687 | unsigned short vdd); | ||
686 | void sdhci_set_bus_width(struct sdhci_host *host, int width); | 688 | void sdhci_set_bus_width(struct sdhci_host *host, int width); |
687 | void sdhci_reset(struct sdhci_host *host, u8 mask); | 689 | void sdhci_reset(struct sdhci_host *host, u8 mask); |
688 | void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); | 690 | void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); |