Re: [PATCH 4/4] sdhci-s3c: add regulator support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 28, 2010 at 04:19:57PM +0200, Marek Szyprowski wrote:

>  static int sdhci_s3c_suspend(struct platform_device *dev, pm_message_t pm)
>  {
> +	int ret = 0;
>  	struct sdhci_host *host = platform_get_drvdata(dev);
> +	struct sdhci_s3c *sc = sdhci_priv(host);
>  
>  	sdhci_suspend_host(host, pm);
> -	return 0;
> +
> +	if (sc->vmmc)
> +		ret = regulator_disable(sc->vmmc);
> +

So, on suspend you disable the regulator...

> +	struct sdhci_s3c *sc = sdhci_priv(host);
> +
> +	if (sc->vmmc) {
> +		int ret = regulator_disable(sc->vmmc);
> +		if (ret)
> +			return ret;

...and on resume you disable it again.  I'm surprised this works
properly after resume, at the very least the core is going to get
confused about the reference counts I'd expect.

I suspect this is for something we need to do better in the regulator
API - restoring the state of the regulators after a resume if the
hardware changes them.  A lot of regulators just do this in hardware so
we didn't need to worry about it previously.

> +		mdelay(2);

This could do with some sort of comment.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux