linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sh_mmcif: support aggressive clock gating
@ 2011-02-25 15:58 Guennadi Liakhovetski
  2011-02-25 17:30 ` Chris Ball
  0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2011-02-25 15:58 UTC (permalink / raw)
  To: linux-sh; +Cc: linux-mmc

To support MMC aggressive clock gating the driver has to stop the interface
clock, when the .set_ios() method is called with .clock = 0.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

Tested on ap4evb and ecovec

 drivers/mmc/host/sh_mmcif.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 12884c2..3d735da 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -850,15 +850,15 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	struct sh_mmcif_host *host = mmc_priv(mmc);
 	struct sh_mmcif_plat_data *p = host->pd->dev.platform_data;
 
-	if (ios->power_mode = MMC_POWER_OFF) {
+	if (ios->power_mode = MMC_POWER_UP) {
+		if (p->set_pwr)
+			p->set_pwr(host->pd, ios->power_mode);
+	} else if (ios->power_mode = MMC_POWER_OFF || !ios->clock) {
 		/* clock stop */
 		sh_mmcif_clock_control(host, 0);
-		if (p->down_pwr)
+		if (ios->power_mode = MMC_POWER_OFF && p->down_pwr)
 			p->down_pwr(host->pd);
 		return;
-	} else if (ios->power_mode = MMC_POWER_UP) {
-		if (p->set_pwr)
-			p->set_pwr(host->pd, ios->power_mode);
 	}
 
 	if (ios->clock)
-- 
1.7.2.3


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

* Re: [PATCH] mmc: sh_mmcif: support aggressive clock gating
  2011-02-25 15:58 [PATCH] mmc: sh_mmcif: support aggressive clock gating Guennadi Liakhovetski
@ 2011-02-25 17:30 ` Chris Ball
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2011-02-25 17:30 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-sh, linux-mmc

Hi Guennadi,

On Fri, Feb 25, 2011 at 04:58:38PM +0100, Guennadi Liakhovetski wrote:
> To support MMC aggressive clock gating the driver has to stop the interface
> clock, when the .set_ios() method is called with .clock = 0.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
> 
> Tested on ap4evb and ecovec
> 
>  drivers/mmc/host/sh_mmcif.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 12884c2..3d735da 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -850,15 +850,15 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  	struct sh_mmcif_host *host = mmc_priv(mmc);
>  	struct sh_mmcif_plat_data *p = host->pd->dev.platform_data;
>  
> -	if (ios->power_mode = MMC_POWER_OFF) {
> +	if (ios->power_mode = MMC_POWER_UP) {
> +		if (p->set_pwr)
> +			p->set_pwr(host->pd, ios->power_mode);
> +	} else if (ios->power_mode = MMC_POWER_OFF || !ios->clock) {
>  		/* clock stop */
>  		sh_mmcif_clock_control(host, 0);
> -		if (p->down_pwr)
> +		if (ios->power_mode = MMC_POWER_OFF && p->down_pwr)
>  			p->down_pwr(host->pd);
>  		return;
> -	} else if (ios->power_mode = MMC_POWER_UP) {
> -		if (p->set_pwr)
> -			p->set_pwr(host->pd, ios->power_mode);
>  	}
>  
>  	if (ios->clock)

Thanks, pushed to mmc-next for .39.

-- 
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:[~2011-02-25 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 15:58 [PATCH] mmc: sh_mmcif: support aggressive clock gating Guennadi Liakhovetski
2011-02-25 17:30 ` 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).