RE: [PATCH 3/5 v3] ESDHC: Power management for ESDHC

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

 



Thanks, Chris.
I will try it.
If it is ok, I will post the new patch.

> -----Original Message-----
> From: Chris Ball [mailto:cjb@xxxxxxxxxx]
> Sent: Tuesday, January 03, 2012 10:12 AM
> To: Wolfram Sang
> Cc: Huang Changming-R66093; linux-mmc@xxxxxxxxxxxxxxx; Huang Changming-
> R66093; Jiang Yutang-B14898
> Subject: Re: [PATCH 3/5 v3] ESDHC: Power management for ESDHC
> 
> Hi,
> 
> On Mon, Jan 02 2012, Wolfram Sang wrote:
> >> Wolfram, do you have time to look at this?  Looks like we need to
> expose
> >> suspend/resume hooks to -pltfm users for this use case -- I don't
> think
> >> any esdhc code should be in sdhci-pltfm.c.  (I don't mind writing the
> >> patch if you agree that that's the correct solution here.)
> >
> > I won't have time to look at it, but what you say sounds reasonable to
> me.
> 
> Thanks, Wolfram.  Jerry, does this patch give you the hook you need to
> handle this inside the driver instead of sdhci/sdhci-pltfm?
> 
> From: Chris Ball <cjb@xxxxxxxxxx>
> Subject: [PATCH] mmc: sdhci: Add platform suspend/resume hooks.
> 
> Some platforms require saving/restoring registers across suspend/resume;
> this hook allows them to do that inside their driver.
> 
> Signed-off-by: Chris Ball <cjb@xxxxxxxxxx>
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 384adda..3425c9a 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2351,6 +2351,9 @@ int sdhci_suspend_host(struct sdhci_host *host)
>  {
>  	int ret;
> 
> +	if (host->ops->platform_suspend)
> +		host->ops->platform_suspend(host);
> +
>  	sdhci_disable_card_detection(host);
> 
>  	/* Disable tuning since we are suspending */
> @@ -2391,6 +2394,9 @@ int sdhci_resume_host(struct sdhci_host *host)
>  	ret = mmc_resume_host(host->mmc);
>  	sdhci_enable_card_detection(host);
> 
> +	if (host->ops->platform_resume)
> +		host->ops->platform_resume(host);
> +
>  	/* Set the re-tuning expiration flag */
>  	if ((host->version >= SDHCI_SPEC_300) && host->tuning_count &&
>  	    (host->tuning_mode == SDHCI_TUNING_MODE_1))
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index a04d4d0..ae05a80 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -274,6 +274,8 @@ struct sdhci_ops {
>  	void	(*platform_reset_exit)(struct sdhci_host *host, u8 mask);
>  	int	(*set_uhs_signaling)(struct sdhci_host *host, unsigned int
> uhs);
>  	void	(*hw_reset)(struct sdhci_host *host);
> +	void	(*platform_suspend)(struct sdhci_host *host);
> +	void	(*platform_resume)(struct sdhci_host *host);
>  };
> 
>  #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
> --
> Chris Ball   <cjb@xxxxxxxxxx>   <http://printf.net/>
> One Laptop Per Child


--
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