linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org,
	Magnus Damm <magnus.damm@gmail.com>, Chris Ball <cjb@laptop.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 5/5 v4] mmc: sh_mmcif: add regulator support
Date: Wed, 20 Jun 2012 06:58:10 +0000	[thread overview]
Message-ID: <20120620065809.GL20030@verge.net.au> (raw)
In-Reply-To: <Pine.LNX.4.64.1206200820510.20254@axis700.grange>

On Wed, Jun 20, 2012 at 08:38:27AM +0200, Guennadi Liakhovetski wrote:
> On Wed, 20 Jun 2012, Simon Horman wrote:
> 
> > Hi Guennadi,
> > 
> > On Wed, Jun 13, 2012 at 03:37:31PM +0200, Guennadi Liakhovetski wrote:
> > > Add regulator support to the sh_mmcif driver, but also preserve the current
> > > power-callback.
> > > 
> > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > > ---
> > > 
> > > v4: update to the new mmc_regulator_get_supply() function
> > > 
> > >  drivers/mmc/host/sh_mmcif.c |   38 +++++++++++++++++++++++++++++++-------
> > >  1 files changed, 31 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> > > index 4680276..204bced 100644
> > > --- a/drivers/mmc/host/sh_mmcif.c
> > > +++ b/drivers/mmc/host/sh_mmcif.c
> > > @@ -923,10 +923,22 @@ static int sh_mmcif_clk_update(struct sh_mmcif_host *host)
> > >  	return ret;
> > >  }
> > >  
> > > +static void sh_mmcif_set_power(struct sh_mmcif_host *host, struct mmc_ios *ios)
> > > +{
> > > +	struct sh_mmcif_plat_data *pd = host->pd->dev.platform_data;
> > > +	struct mmc_host *mmc = host->mmc;
> > > +
> > > +	if (pd->set_pwr)
> > > +		pd->set_pwr(host->pd, ios->power_mode != MMC_POWER_OFF);
> > > +	if (!IS_ERR(mmc->supply.vmmc))
> > > +		/* Errors ignored... */
> > > +		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc,
> > > +				      ios->power_mode ? ios->vdd : 0);
> > > +}
> > > +
> > >  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;
> > >  	unsigned long flags;
> > >  
> > >  	spin_lock_irqsave(&host->lock, flags);
> > > @@ -944,6 +956,7 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> > >  			sh_mmcif_request_dma(host, host->pd->dev.platform_data);
> > >  			host->card_present = true;
> > >  		}
> > > +		sh_mmcif_set_power(host, ios);
> > >  	} else if (ios->power_mode = MMC_POWER_OFF || !ios->clock) {
> > >  		/* clock stop */
> > >  		sh_mmcif_clock_control(host, 0);
> > > @@ -957,8 +970,8 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> > >  			pm_runtime_put(&host->pd->dev);
> > >  			clk_disable(host->hclk);
> > >  			host->power = false;
> > > -			if (p->set_pwr && ios->power_mode = MMC_POWER_OFF)
> > > -				p->set_pwr(host->pd, 0);
> > > +			if (ios->power_mode = MMC_POWER_OFF)
> > > +				sh_mmcif_set_power(host, ios);
> > >  		}
> > >  		host->state = STATE_IDLE;
> > >  		return;
> > > @@ -966,8 +979,6 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> > >  
> > >  	if (ios->clock) {
> > >  		if (!host->power) {
> > > -			if (p->set_pwr)
> > > -				p->set_pwr(host->pd, ios->power_mode);
> > >  			sh_mmcif_clk_update(host);
> > >  			pm_runtime_get_sync(&host->pd->dev);
> > >  			host->power = true;
> > 
> > It is unclear to me how this hunk relates to the description of the
> > change in the changelog.
> 
> Right, it is probably not very obvious. We could extend the description 
> with something like:
> 
> Also note, that the card power is not switched off during clock gating 
> periods, hence there's no need to power it on every time the card is 
> re-activated.

Thanks, that would make things much clearer.

Reviewed-by: Simon Horman <horms@verge.net.au>

      reply	other threads:[~2012-06-20  6:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 13:37 [PATCH 0/5 v4] mmc: sh_mmcif: clock and power updates Guennadi Liakhovetski
2012-06-13 13:37 ` [PATCH 1/5 v4] mmc: sh_mmcif: simplify and use meaningful label names in error-handling Guennadi Liakhovetski
2012-06-20  5:02   ` Simon Horman
2012-06-13 13:37 ` [PATCH 2/5 v4] mmc: sh_mmcif: fix clock management Guennadi Liakhovetski
2012-06-20  5:18   ` Simon Horman
2012-06-20  6:41     ` Guennadi Liakhovetski
2012-06-20  6:58       ` Simon Horman
2012-06-13 13:37 ` [PATCH 3/5 v4] mmc: sh_mmcif: re-read the clock frequency every time the clock is turned on Guennadi Liakhovetski
2012-06-20  5:23   ` Simon Horman
2012-06-13 13:37 ` [PATCH 4/5 v4] mmc: sh_mmcif: remove redundant .down_pwr() callback Guennadi Liakhovetski
2012-06-20  4:58   ` Simon Horman
2012-06-20  6:19     ` Guennadi Liakhovetski
2012-06-20  6:57       ` Simon Horman
2012-06-13 13:37 ` [PATCH 5/5 v4] mmc: sh_mmcif: add regulator support Guennadi Liakhovetski
2012-06-17 17:23   ` Mark Brown
2012-06-20  5:12   ` Simon Horman
2012-06-20  6:38     ` Guennadi Liakhovetski
2012-06-20  6:58       ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120620065809.GL20030@verge.net.au \
    --to=horms@verge.net.au \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=cjb@laptop.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).