All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-xenon: add set_power callback
@ 2017-08-18 20:48 Zhoujie Wu
  2017-08-21  6:11 ` Jisheng Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Zhoujie Wu @ 2017-08-18 20:48 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter, linux-mmc
  Cc: zmxu, jszhang, nadavh, xigu, dingwei, kostap, hannah, hongd,
	dougj, ygao, liuw, gregory.clement, thomas.petazzoni, Zhoujie Wu

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 <zjwu@marvell.com>
---
 drivers/mmc/host/sdhci-xenon.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
index edd4d915..e82dc01 100644
--- a/drivers/mmc/host/sdhci-xenon.c
+++ b/drivers/mmc/host/sdhci-xenon.c
@@ -210,8 +210,28 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
 	sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
 }
 
+
+static void xenon_set_power(struct sdhci_host *host, unsigned char mode,
+		unsigned short vdd)
+{
+	struct mmc_host *mmc = host->mmc;
+	u8 pwr = host->pwr;
+
+	sdhci_set_power_noreg(host, mode, vdd);
+
+	if (host->pwr == pwr)
+		return;
+
+	if (host->pwr == 0)
+		vdd = 0;
+
+	if (!IS_ERR(mmc->supply.vmmc))
+		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+}
+
 static const struct sdhci_ops sdhci_xenon_ops = {
 	.set_clock		= sdhci_set_clock,
+	.set_power		= xenon_set_power,
 	.set_bus_width		= sdhci_set_bus_width,
 	.reset			= xenon_reset,
 	.set_uhs_signaling	= xenon_set_uhs_signaling,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: sdhci-xenon: add set_power callback
  2017-08-18 20:48 [PATCH] mmc: sdhci-xenon: add set_power callback Zhoujie Wu
@ 2017-08-21  6:11 ` Jisheng Zhang
  2017-08-21 17:59   ` Zhoujie Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Jisheng Zhang @ 2017-08-21  6:11 UTC (permalink / raw)
  To: Zhoujie Wu
  Cc: ulf.hansson, adrian.hunter, linux-mmc, zmxu, nadavh, xigu,
	dingwei, kostap, hannah, hongd, dougj, ygao, liuw,
	gregory.clement, thomas.petazzoni

On Fri, 18 Aug 2017 13:48:04 -0700 Zhoujie Wu wrote:

> 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 <zjwu@marvell.com>
> ---
>  drivers/mmc/host/sdhci-xenon.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
> index edd4d915..e82dc01 100644
> --- a/drivers/mmc/host/sdhci-xenon.c
> +++ b/drivers/mmc/host/sdhci-xenon.c
> @@ -210,8 +210,28 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
>  	sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
>  }
>  
> +

remove this extra blank line.

> +static void xenon_set_power(struct sdhci_host *host, unsigned char mode,
> +		unsigned short vdd)
> +{
> +	struct mmc_host *mmc = host->mmc;
> +	u8 pwr = host->pwr;
> +
> +	sdhci_set_power_noreg(host, mode, vdd);
> +
> +	if (host->pwr == pwr)
> +		return;
> +
> +	if (host->pwr == 0)
> +		vdd = 0;
> +
> +	if (!IS_ERR(mmc->supply.vmmc))
> +		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
> +}
> +
>  static const struct sdhci_ops sdhci_xenon_ops = {
>  	.set_clock		= sdhci_set_clock,
> +	.set_power		= xenon_set_power,
>  	.set_bus_width		= sdhci_set_bus_width,
>  	.reset			= xenon_reset,
>  	.set_uhs_signaling	= xenon_set_uhs_signaling,


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: sdhci-xenon: add set_power callback
  2017-08-21  6:11 ` Jisheng Zhang
@ 2017-08-21 17:59   ` Zhoujie Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Zhoujie Wu @ 2017-08-21 17:59 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: ulf.hansson, adrian.hunter, linux-mmc, zmxu, nadavh, xigu,
	dingwei, kostap, hannah, hongd, dougj, ygao, liuw,
	gregory.clement, thomas.petazzoni



On 08/20/2017 11:11 PM, Jisheng Zhang wrote:
> On Fri, 18 Aug 2017 13:48:04 -0700 Zhoujie Wu wrote:
>
>> 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 <zjwu@marvell.com>
>> ---
>>   drivers/mmc/host/sdhci-xenon.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
>> index edd4d915..e82dc01 100644
>> --- a/drivers/mmc/host/sdhci-xenon.c
>> +++ b/drivers/mmc/host/sdhci-xenon.c
>> @@ -210,8 +210,28 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
>>   	sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
>>   }
>>   
>> +
> remove this extra blank line.
Thanks, updated the patch.
>> +static void xenon_set_power(struct sdhci_host *host, unsigned char mode,
>> +		unsigned short vdd)
>> +{
>> +	struct mmc_host *mmc = host->mmc;
>> +	u8 pwr = host->pwr;
>> +
>> +	sdhci_set_power_noreg(host, mode, vdd);
>> +
>> +	if (host->pwr == pwr)
>> +		return;
>> +
>> +	if (host->pwr == 0)
>> +		vdd = 0;
>> +
>> +	if (!IS_ERR(mmc->supply.vmmc))
>> +		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
>> +}
>> +
>>   static const struct sdhci_ops sdhci_xenon_ops = {
>>   	.set_clock		= sdhci_set_clock,
>> +	.set_power		= xenon_set_power,
>>   	.set_bus_width		= sdhci_set_bus_width,
>>   	.reset			= xenon_reset,
>>   	.set_uhs_signaling	= xenon_set_uhs_signaling,


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-21 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18 20:48 [PATCH] mmc: sdhci-xenon: add set_power callback Zhoujie Wu
2017-08-21  6:11 ` Jisheng Zhang
2017-08-21 17:59   ` Zhoujie Wu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.