linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sdhci: vmmc regulator should be explicitly enabled/disabled
@ 2012-07-24  0:25 philipspatches
  2012-08-08  2:33 ` Chris Ball
  0 siblings, 1 reply; 2+ messages in thread
From: philipspatches @ 2012-07-24  0:25 UTC (permalink / raw)
  To: cjb, linux-mmc; +Cc: Philip Rakity

From: Philip Rakity <prakity@marvell.com>

The vmmc regulator should not rely on it being enabled in
the platform code.  Expliciitly enable and disable the
regulator.

Signed-off-by: Philip Rakity <prakity@marvell.com>
---
 drivers/mmc/host/sdhci.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ac50d35..8c58865 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2908,7 +2908,8 @@ int sdhci_add_host(struct sdhci_host *host)
 	if (IS_ERR(host->vmmc)) {
 		pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
 		host->vmmc = NULL;
-	}
+	} else
+		regulator_enable(host->vmmc);
 
 #ifdef CONFIG_REGULATOR
 	if (host->vmmc) {
@@ -3165,8 +3166,10 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
 	tasklet_kill(&host->card_tasklet);
 	tasklet_kill(&host->finish_tasklet);
 
-	if (host->vmmc)
+	if (host->vmmc) {
+		regulator_disable(host->vmmc);
 		regulator_put(host->vmmc);
+	}
 
 	if (host->vqmmc) {
 		regulator_disable(host->vqmmc);
-- 
1.7.0.4


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

* Re: [PATCH] sdhci: vmmc regulator should be explicitly enabled/disabled
  2012-07-24  0:25 [PATCH] sdhci: vmmc regulator should be explicitly enabled/disabled philipspatches
@ 2012-08-08  2:33 ` Chris Ball
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2012-08-08  2:33 UTC (permalink / raw)
  To: philipspatches; +Cc: linux-mmc, Philip Rakity

Hi,

On Mon, Jul 23 2012, philipspatches@gmail.com wrote:
> From: Philip Rakity <prakity@marvell.com>
>
> The vmmc regulator should not rely on it being enabled in
> the platform code.  Expliciitly enable and disable the
> regulator.
>
> Signed-off-by: Philip Rakity <prakity@marvell.com>
> ---
>  drivers/mmc/host/sdhci.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index ac50d35..8c58865 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2908,7 +2908,8 @@ int sdhci_add_host(struct sdhci_host *host)
>  	if (IS_ERR(host->vmmc)) {
>  		pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
>  		host->vmmc = NULL;
> -	}
> +	} else
> +		regulator_enable(host->vmmc);
>  
>  #ifdef CONFIG_REGULATOR
>  	if (host->vmmc) {
> @@ -3165,8 +3166,10 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
>  	tasklet_kill(&host->card_tasklet);
>  	tasklet_kill(&host->finish_tasklet);
>  
> -	if (host->vmmc)
> +	if (host->vmmc) {
> +		regulator_disable(host->vmmc);
>  		regulator_put(host->vmmc);
> +	}
>  
>  	if (host->vqmmc) {
>  		regulator_disable(host->vqmmc);

Thanks, pushed to mmc-next for 3.7.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

end of thread, other threads:[~2012-08-08  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24  0:25 [PATCH] sdhci: vmmc regulator should be explicitly enabled/disabled philipspatches
2012-08-08  2:33 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).