linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Pramod Gurav <pramod.gurav@linaro.org>,
	ulf.hansson@linaro.org
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ritesh Harjani <riteshh@codeaurora.org>,
	Georgi Djakov <georgi.djakov@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>
Subject: Re: [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support
Date: Thu, 8 Sep 2016 11:00:28 +0300	[thread overview]
Message-ID: <d6680c7c-8373-1ad4-dd7f-9d0281b3a258@intel.com> (raw)
In-Reply-To: <79066adb-c45b-158f-99af-6d86e6de7513@intel.com>

On 08/09/16 10:47, Adrian Hunter wrote:
> On 16/06/16 15:35, Pramod Gurav wrote:
>> Provides runtime PM callbacks to enable and disable clock resources
>> when idle. Also support system PM callbacks to be called during system
>> suspend and resume.
>>
>> Signed-off-by: Pramod Gurav <pramod.gurav@linaro.org>
> 
> Can we get some Tested/Reviewed/Acked-by from people using this driver?

Oops wrong version of the patch.  Please disregard the comment for this
patch, and see instead the later patch.

> 
>> ---
>>  drivers/mmc/host/sdhci-msm.c | 57 ++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 57 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
>> index 0653fe7..f4394c8 100644
>> --- a/drivers/mmc/host/sdhci-msm.c
>> +++ b/drivers/mmc/host/sdhci-msm.c
>> @@ -18,6 +18,7 @@
>>  #include <linux/of_device.h>
>>  #include <linux/delay.h>
>>  #include <linux/mmc/mmc.h>
>> +#include <linux/pm_runtime.h>
>>  #include <linux/slab.h>
>>  
>>  #include "sdhci-pltfm.h"
>> @@ -549,6 +550,11 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>>  	if (ret)
>>  		goto clk_disable;
>>  
>> +	platform_set_drvdata(pdev, msm_host);
>> +
>> +	pm_runtime_set_active(&pdev->dev);
>> +	pm_runtime_enable(&pdev->dev);
>> +
>>  	return 0;
>>  
>>  clk_disable:
>> @@ -580,12 +586,63 @@ static int sdhci_msm_remove(struct platform_device *pdev)
>>  	return 0;
>>  }
>>  
>> +static int sdhci_msm_runtime_suspend(struct device *dev)
>> +{
>> +	struct sdhci_msm_host *msm_host = dev_get_drvdata(dev);
>> +
>> +	clk_disable_unprepare(msm_host->clk);
>> +	clk_disable_unprepare(msm_host->pclk);
>> +
>> +	return 0;
>> +}
>> +
>> +static int sdhci_msm_runtime_resume(struct device *dev)
>> +{
>> +	struct sdhci_msm_host *msm_host = dev_get_drvdata(dev);
>> +	int ret;
>> +
>> +	ret = clk_prepare_enable(msm_host->clk);
>> +	if (ret) {
>> +		dev_err(dev, "clk_enable failed: %d\n", ret);
>> +		return ret;
>> +	}
>> +	ret = clk_prepare_enable(msm_host->pclk);
>> +	if (ret) {
>> +		dev_err(dev, "clk_enable failed: %d\n", ret);
>> +		clk_disable_unprepare(msm_host->clk);
>> +		return ret;
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static int sdhci_msm_suspend(struct device *dev)
>> +{
>> +	pm_runtime_force_suspend(dev);
>> +
>> +	return 0;
>> +}
>> +
>> +static int sdhci_msm_resume(struct device *dev)
>> +{
>> +	pm_runtime_force_resume(dev);
>> +
>> +	return 0;
>> +}
>> +
>> +static const struct dev_pm_ops sdhci_msm_pm_ops = {
>> +	SET_LATE_SYSTEM_SLEEP_PM_OPS(sdhci_msm_suspend, sdhci_msm_resume)
>> +	SET_RUNTIME_PM_OPS(sdhci_msm_runtime_suspend, sdhci_msm_runtime_resume,
>> +				NULL)
>> +};
>> +
>>  static struct platform_driver sdhci_msm_driver = {
>>  	.probe = sdhci_msm_probe,
>>  	.remove = sdhci_msm_remove,
>>  	.driver = {
>>  		   .name = "sdhci_msm",
>>  		   .of_match_table = sdhci_msm_dt_match,
>> +		   .pm = &sdhci_msm_pm_ops,
>>  	},
>>  };
>>  
>>
> 
> 

  reply	other threads:[~2016-09-08  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 12:35 [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support Pramod Gurav
2016-08-29  8:59 ` Pramod Gurav
2016-08-29 14:20 ` Ulf Hansson
2016-08-31  5:22   ` Pramod Gurav
2016-09-08  7:47 ` Adrian Hunter
2016-09-08  8:00   ` Adrian Hunter [this message]
2016-09-01 14:17 Pramod Gurav

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=d6680c7c-8373-1ad4-dd7f-9d0281b3a258@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=georgi.djakov@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=pramod.gurav@linaro.org \
    --cc=riteshh@codeaurora.org \
    --cc=sboyd@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    /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).