* [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
@ 2011-12-30 2:24 Mark Brown
2012-01-02 2:07 ` Jaehoon Chung
0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2011-12-30 2:24 UTC (permalink / raw)
To: Jaehoon Chung, Chris Ball, Kukjin Kim, Kyungmin Park
Cc: linux-mmc, Mark Brown
This matches current best practice as one can have runtime PM enabled
without system sleep and CONFIG_PM is defined for both.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/mmc/host/sdhci-s3c.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 1af756e..df066b5 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -20,6 +20,7 @@
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/module.h>
+#include <linux/pm.h>
#include <linux/mmc/host.h>
@@ -620,8 +621,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-
+#ifdef CONFIG_PM_SLEEP
static int sdhci_s3c_suspend(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
@@ -635,10 +635,11 @@ static int sdhci_s3c_resume(struct device *dev)
return sdhci_resume_host(host);
}
+#endif
+#ifdef CONFIG_PM
static const struct dev_pm_ops sdhci_s3c_pmops = {
- .suspend = sdhci_s3c_suspend,
- .resume = sdhci_s3c_resume,
+ SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
};
#define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
--
1.7.7.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
2011-12-30 2:24 Mark Brown
@ 2012-01-02 2:07 ` Jaehoon Chung
2012-01-02 11:49 ` Mark Brown
0 siblings, 1 reply; 10+ messages in thread
From: Jaehoon Chung @ 2012-01-02 2:07 UTC (permalink / raw)
To: Mark Brown
Cc: Jaehoon Chung, Chris Ball, Kukjin Kim, Kyungmin Park, linux-mmc
Hi Mark.
On 12/30/2011 11:24 AM, Mark Brown wrote:
> This matches current best practice as one can have runtime PM enabled
> without system sleep and CONFIG_PM is defined for both.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 1af756e..df066b5 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -20,6 +20,7 @@
> #include <linux/io.h>
> #include <linux/gpio.h>
> #include <linux/module.h>
> +#include <linux/pm.h>
I think this include is unnecessary.
Thanks,
Jaehoon Chung
>
> #include <linux/mmc/host.h>
>
> @@ -620,8 +621,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -
> +#ifdef CONFIG_PM_SLEEP
> static int sdhci_s3c_suspend(struct device *dev)
> {
> struct sdhci_host *host = dev_get_drvdata(dev);
> @@ -635,10 +635,11 @@ static int sdhci_s3c_resume(struct device *dev)
>
> return sdhci_resume_host(host);
> }
> +#endif
>
> +#ifdef CONFIG_PM
> static const struct dev_pm_ops sdhci_s3c_pmops = {
> - .suspend = sdhci_s3c_suspend,
> - .resume = sdhci_s3c_resume,
> + SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
> };
>
> #define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
2012-01-02 2:07 ` Jaehoon Chung
@ 2012-01-02 11:49 ` Mark Brown
2012-01-02 15:24 ` Jae hoon Chung
0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2012-01-02 11:49 UTC (permalink / raw)
To: Jaehoon Chung; +Cc: Chris Ball, Kukjin Kim, Kyungmin Park, linux-mmc
On Mon, Jan 02, 2012 at 11:07:59AM +0900, Jaehoon Chung wrote:
> On 12/30/2011 11:24 AM, Mark Brown wrote:
> > +#include <linux/pm.h>
> I think this include is unnecessary.
I think you are wrong. What makes you say that you think it is not
needed?
> > +#ifdef CONFIG_PM
> > static const struct dev_pm_ops sdhci_s3c_pmops = {
> > - .suspend = sdhci_s3c_suspend,
> > - .resume = sdhci_s3c_resume,
> > + SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
Note that above.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
2012-01-02 11:49 ` Mark Brown
@ 2012-01-02 15:24 ` Jae hoon Chung
2012-01-02 17:32 ` Mark Brown
0 siblings, 1 reply; 10+ messages in thread
From: Jae hoon Chung @ 2012-01-02 15:24 UTC (permalink / raw)
To: Mark Brown
Cc: Jaehoon Chung, Chris Ball, Kukjin Kim, Kyungmin Park, linux-mmc
2012/1/2 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Mon, Jan 02, 2012 at 11:07:59AM +0900, Jaehoon Chung wrote:
>> On 12/30/2011 11:24 AM, Mark Brown wrote:
>
>> > +#include <linux/pm.h>
>
>> I think this include is unnecessary.
>
> I think you are wrong. What makes you say that you think it is not
> needed?
If that didn't include,,what's happen?
I think that is already included...Anyway..this patch looks fine to me..
(if use with your patch[2/2]..)
Thanks,
Jaehoon Chung
>
>> > +#ifdef CONFIG_PM
>> > static const struct dev_pm_ops sdhci_s3c_pmops = {
>> > - .suspend = sdhci_s3c_suspend,
>> > - .resume = sdhci_s3c_resume,
>> > + SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
>
> Note that above.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
2012-01-02 15:24 ` Jae hoon Chung
@ 2012-01-02 17:32 ` Mark Brown
0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2012-01-02 17:32 UTC (permalink / raw)
To: Jae hoon Chung
Cc: Jaehoon Chung, Chris Ball, Kukjin Kim, Kyungmin Park, linux-mmc
On Tue, Jan 03, 2012 at 12:24:53AM +0900, Jae hoon Chung wrote:
> 2012/1/2 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> >> On 12/30/2011 11:24 AM, Mark Brown wrote:
> >> > +#include <linux/pm.h>
> >> I think this include is unnecessary.
> > I think you are wrong. What makes you say that you think it is not
> > needed?
> If that didn't include,,what's happen?
The code won't compile as we're relying on a macro defined in the
header.
> I think that is already included...Anyway..this patch looks fine to me..
> (if use with your patch[2/2]..)
It's not included directly (or indirectly as far as I remember).
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
@ 2012-02-15 18:15 Mark Brown
2012-02-15 18:15 ` [PATCH 2/2] mmc: sdhci-s3c: Enable runtime power management Mark Brown
0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2012-02-15 18:15 UTC (permalink / raw)
To: Chris Ball, Ben Dooks; +Cc: linux-mmc, Mark Brown
This matches current best practice as one can have runtime PM enabled
without system sleep and CONFIG_PM is defined for both.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/mmc/host/sdhci-s3c.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index b19e7d4..84ea6c7 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -20,6 +20,7 @@
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/module.h>
+#include <linux/pm.h>
#include <linux/mmc/host.h>
@@ -620,8 +621,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-
+#ifdef CONFIG_PM_SLEEP
static int sdhci_s3c_suspend(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
@@ -635,10 +635,11 @@ static int sdhci_s3c_resume(struct device *dev)
return sdhci_resume_host(host);
}
+#endif
+#ifdef CONFIG_PM
static const struct dev_pm_ops sdhci_s3c_pmops = {
- .suspend = sdhci_s3c_suspend,
- .resume = sdhci_s3c_resume,
+ SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
};
#define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
--
1.7.9.rc1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] mmc: sdhci-s3c: Enable runtime power management
2012-02-15 18:15 [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend Mark Brown
@ 2012-02-15 18:15 ` Mark Brown
0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2012-02-15 18:15 UTC (permalink / raw)
To: Chris Ball, Ben Dooks; +Cc: linux-mmc, Mark Brown
Since most of the work is already done by the core we just need to add
runtime suspend methods and tell the PM core that runtime PM is enabled
for this device.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/mmc/host/sdhci-s3c.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 84ea6c7..f114725 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -21,6 +21,7 @@
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/pm.h>
+#include <linux/pm_runtime.h>
#include <linux/mmc/host.h>
@@ -545,6 +546,11 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
if (pdata->host_caps2)
host->mmc->caps2 |= pdata->host_caps2;
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
+ pm_runtime_use_autosuspend(&pdev->dev);
+ pm_suspend_ignore_children(&pdev->dev, 1);
+
ret = sdhci_add_host(host);
if (ret) {
dev_err(dev, "sdhci_add_host() failed\n");
@@ -564,6 +570,8 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
err_add_host:
release_resource(sc->ioarea);
+ pm_runtime_forbid(&pdev->dev);
+ pm_runtime_get_noresume(&pdev->dev);
kfree(sc->ioarea);
err_req_regs:
@@ -602,6 +610,8 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
sdhci_remove_host(host, 1);
+ pm_runtime_disable(&pdev->dev);
+
for (ptr = 0; ptr < 3; ptr++) {
if (sc->clk_bus[ptr]) {
clk_disable(sc->clk_bus[ptr]);
@@ -637,9 +647,27 @@ static int sdhci_s3c_resume(struct device *dev)
}
#endif
+#ifdef CONFIG_PM_RUNTIME
+static int sdhci_s3c_runtime_suspend(struct device *dev)
+{
+ struct sdhci_host *host = dev_get_drvdata(dev);
+
+ return sdhci_runtime_suspend_host(host);
+}
+
+static int sdhci_s3c_runtime_resume(struct device *dev)
+{
+ struct sdhci_host *host = dev_get_drvdata(dev);
+
+ return sdhci_runtime_resume_host(host);
+}
+#endif
+
#ifdef CONFIG_PM
static const struct dev_pm_ops sdhci_s3c_pmops = {
SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
+ SET_RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume,
+ NULL)
};
#define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
--
1.7.9.rc1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
2012-03-03 0:44 [PATCH v3 0/6] mmc: sdhci-s3c: Rework platform data and add device tree support Kukjin Kim
@ 2012-03-03 0:46 ` Mark Brown
2012-03-05 10:24 ` Jaehoon Chung
2012-03-09 4:56 ` Chris Ball
0 siblings, 2 replies; 10+ messages in thread
From: Mark Brown @ 2012-03-03 0:46 UTC (permalink / raw)
To: Kukjin Kim, Chris Ball
Cc: linux-samsung-soc, linux-arm-kernel, linux-mmc, Mark Brown
This matches current best practice as one can have runtime PM enabled
without system sleep and CONFIG_PM is defined for both.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/mmc/host/sdhci-s3c.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index ea0767e..46152d6 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
+#include <linux/pm.h>
#include <linux/mmc/host.h>
@@ -807,8 +808,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-
+#ifdef CONFIG_PM_SLEEP
static int sdhci_s3c_suspend(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
@@ -822,10 +822,11 @@ static int sdhci_s3c_resume(struct device *dev)
return sdhci_resume_host(host);
}
+#endif
+#ifdef CONFIG_PM
static const struct dev_pm_ops sdhci_s3c_pmops = {
- .suspend = sdhci_s3c_suspend,
- .resume = sdhci_s3c_resume,
+ SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
};
#define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
--
1.7.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
2012-03-03 0:46 ` [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend Mark Brown
@ 2012-03-05 10:24 ` Jaehoon Chung
2012-03-09 4:56 ` Chris Ball
1 sibling, 0 replies; 10+ messages in thread
From: Jaehoon Chung @ 2012-03-05 10:24 UTC (permalink / raw)
To: Mark Brown
Cc: Kukjin Kim, Chris Ball, linux-samsung-soc, linux-arm-kernel,
linux-mmc
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
On 03/03/2012 09:46 AM, Mark Brown wrote:
> This matches current best practice as one can have runtime PM enabled
> without system sleep and CONFIG_PM is defined for both.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index ea0767e..46152d6 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -22,6 +22,7 @@
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/of_gpio.h>
> +#include <linux/pm.h>
>
> #include <linux/mmc/host.h>
>
> @@ -807,8 +808,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -
> +#ifdef CONFIG_PM_SLEEP
> static int sdhci_s3c_suspend(struct device *dev)
> {
> struct sdhci_host *host = dev_get_drvdata(dev);
> @@ -822,10 +822,11 @@ static int sdhci_s3c_resume(struct device *dev)
>
> return sdhci_resume_host(host);
> }
> +#endif
>
> +#ifdef CONFIG_PM
> static const struct dev_pm_ops sdhci_s3c_pmops = {
> - .suspend = sdhci_s3c_suspend,
> - .resume = sdhci_s3c_resume,
> + SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
> };
>
> #define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend
2012-03-03 0:46 ` [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend Mark Brown
2012-03-05 10:24 ` Jaehoon Chung
@ 2012-03-09 4:56 ` Chris Ball
1 sibling, 0 replies; 10+ messages in thread
From: Chris Ball @ 2012-03-09 4:56 UTC (permalink / raw)
To: Mark Brown; +Cc: Kukjin Kim, linux-samsung-soc, linux-arm-kernel, linux-mmc
Hi Mark,
On Fri, Mar 02 2012, Mark Brown wrote:
> This matches current best practice as one can have runtime PM enabled
> without system sleep and CONFIG_PM is defined for both.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index ea0767e..46152d6 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -22,6 +22,7 @@
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/of_gpio.h>
> +#include <linux/pm.h>
>
> #include <linux/mmc/host.h>
>
> @@ -807,8 +808,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -
> +#ifdef CONFIG_PM_SLEEP
> static int sdhci_s3c_suspend(struct device *dev)
> {
> struct sdhci_host *host = dev_get_drvdata(dev);
> @@ -822,10 +822,11 @@ static int sdhci_s3c_resume(struct device *dev)
>
> return sdhci_resume_host(host);
> }
> +#endif
>
> +#ifdef CONFIG_PM
> static const struct dev_pm_ops sdhci_s3c_pmops = {
> - .suspend = sdhci_s3c_suspend,
> - .resume = sdhci_s3c_resume,
> + SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
> };
>
> #define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
Thanks, pushed to mmc-next for 3.4 with Jaehoon's ACK.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-03-09 4:56 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 18:15 [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend Mark Brown
2012-02-15 18:15 ` [PATCH 2/2] mmc: sdhci-s3c: Enable runtime power management Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2012-03-03 0:44 [PATCH v3 0/6] mmc: sdhci-s3c: Rework platform data and add device tree support Kukjin Kim
2012-03-03 0:46 ` [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend Mark Brown
2012-03-05 10:24 ` Jaehoon Chung
2012-03-09 4:56 ` Chris Ball
2011-12-30 2:24 Mark Brown
2012-01-02 2:07 ` Jaehoon Chung
2012-01-02 11:49 ` Mark Brown
2012-01-02 15:24 ` Jae hoon Chung
2012-01-02 17:32 ` Mark Brown
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).