Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+13 −13
Original line number Original line Diff line number Diff line
@@ -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,
			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)
		}
		}
	}
	}


	__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);
+2 −0
Original line number Original line Diff line number Diff line
@@ -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);