public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: Set SDHCI_POWER_ON with external vmmc
@ 2015-01-14  6:24 Tim Kryger
  2015-01-14  8:53 ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Kryger @ 2015-01-14  6:24 UTC (permalink / raw)
  To: Chris Ball, Ulf Hansson
  Cc: Tim Kryger, Alexandre Courbot, Sachin Kamat, Linux MMC List

Host controllers lacking the required internal vmmc regulator may still
follow the spec with regard to the LSB of SDHCI_POWER_CONTROL.  Set the
SDHCI_POWER_ON bit when vmmc is enabled to encourage the controller to
to drive CMD, DAT, SDCLK.

This fixes a regression observed on some Qualcomm and Nvidia boards
caused by 5222161 mmc: sdhci: Improve external VDD regulator support.

Signed-off-by: Tim Kryger <tim.kryger@gmail.com>
Tested-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---
 drivers/mmc/host/sdhci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ada1a3e..59a328a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1239,6 +1239,12 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
 		spin_unlock_irq(&host->lock);
 		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
 		spin_lock_irq(&host->lock);
+
+		if (mode != MMC_POWER_OFF)
+			sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
+		else
+			sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
+
 		return;
 	}
 
-- 
1.9.1


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

* Re: [PATCH] mmc: sdhci: Set SDHCI_POWER_ON with external vmmc
  2015-01-14  6:24 [PATCH] mmc: sdhci: Set SDHCI_POWER_ON with external vmmc Tim Kryger
@ 2015-01-14  8:53 ` Ulf Hansson
  2015-02-10  8:53   ` Alexandre Courbot
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2015-01-14  8:53 UTC (permalink / raw)
  To: Tim Kryger
  Cc: Chris Ball, Alexandre Courbot, Sachin Kamat, Linux MMC List,
	linux-mmc

+ linux-mmc

On 14 January 2015 at 07:24, Tim Kryger <tim.kryger@gmail.com> wrote:
> Host controllers lacking the required internal vmmc regulator may still
> follow the spec with regard to the LSB of SDHCI_POWER_CONTROL.  Set the
> SDHCI_POWER_ON bit when vmmc is enabled to encourage the controller to
> to drive CMD, DAT, SDCLK.
>
> This fixes a regression observed on some Qualcomm and Nvidia boards
> caused by 5222161 mmc: sdhci: Improve external VDD regulator support.
>
> Signed-off-by: Tim Kryger <tim.kryger@gmail.com>
> Tested-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>

Thanks! Applied for fixes.

I noticed this wasn't posted to linux-mmc. I am anyway picking it up
as this change has already been discussed and tested, see:
https://lkml.org/lkml/2014/11/3/1029

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index ada1a3e..59a328a 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1239,6 +1239,12 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
>                 spin_unlock_irq(&host->lock);
>                 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
>                 spin_lock_irq(&host->lock);
> +
> +               if (mode != MMC_POWER_OFF)
> +                       sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
> +               else
> +                       sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
> +
>                 return;
>         }
>
> --
> 1.9.1
>

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

* Re: [PATCH] mmc: sdhci: Set SDHCI_POWER_ON with external vmmc
  2015-01-14  8:53 ` Ulf Hansson
@ 2015-02-10  8:53   ` Alexandre Courbot
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Courbot @ 2015-02-10  8:53 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Tim Kryger, Chris Ball, Sachin Kamat, Linux MMC List, linux-mmc

On Wed, Jan 14, 2015 at 5:53 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> + linux-mmc
>
> On 14 January 2015 at 07:24, Tim Kryger <tim.kryger@gmail.com> wrote:
>> Host controllers lacking the required internal vmmc regulator may still
>> follow the spec with regard to the LSB of SDHCI_POWER_CONTROL.  Set the
>> SDHCI_POWER_ON bit when vmmc is enabled to encourage the controller to
>> to drive CMD, DAT, SDCLK.
>>
>> This fixes a regression observed on some Qualcomm and Nvidia boards
>> caused by 5222161 mmc: sdhci: Improve external VDD regulator support.
>>
>> Signed-off-by: Tim Kryger <tim.kryger@gmail.com>
>> Tested-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
>
> Thanks! Applied for fixes.
>
> I noticed this wasn't posted to linux-mmc. I am anyway picking it up
> as this change has already been discussed and tested, see:
> https://lkml.org/lkml/2014/11/3/1029

The party is probably over for this patch, but FWIW:

Tested-by: Alexandre Courbot <acourbot@nvidia.com>

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

end of thread, other threads:[~2015-02-10  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-14  6:24 [PATCH] mmc: sdhci: Set SDHCI_POWER_ON with external vmmc Tim Kryger
2015-01-14  8:53 ` Ulf Hansson
2015-02-10  8:53   ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox