From: Maurus Cuelenaere <mcuelenaere@gmail.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kyungmin.park@samsung.com,
kgene.kim@samsung.com, ben-linux@fluff.org,
akpm@linux-foundation.org, broonie@opensource.wolfsonmicro.com
Subject: Re: [PATCH 4/4] sdhci-s3c: add regulator support
Date: Wed, 28 Jul 2010 16:48:06 +0200 [thread overview]
Message-ID: <4C504326.30708@gmail.com> (raw)
In-Reply-To: <1280326797-15792-5-git-send-email-m.szyprowski@samsung.com>
Op 28-07-10 16:19, Marek Szyprowski schreef:
> This patch adds support for regulator API to sdhci-s3c driver. Regulators
> can be used to disable power in suspended state to reduce dissipated
> energy.
I'm not sure about this, when I would try to do this I'd look at implementing
this in the sdhci driver itself instead of a subdriver of it.
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 30 +++++++++++++++++++++++++++++-
> 1 files changed, 29 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 606e695..b9d46a5 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -19,6 +19,7 @@
> #include <linux/clk.h>
> #include <linux/io.h>
> #include <linux/gpio.h>
> +#include <linux/regulator/consumer.h>
>
> #include <linux/mmc/host.h>
>
> @@ -50,6 +51,7 @@ struct sdhci_s3c {
>
> struct clk *clk_io;
> struct clk *clk_bus[MAX_BUS_CLK];
> + struct regulator *vmmc;
> };
>
> static inline struct sdhci_s3c *to_s3c(struct sdhci_host *host)
> @@ -309,6 +311,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, host);
>
> + sc->vmmc = regulator_get(dev, "vmmc");
> + if (IS_ERR(sc->vmmc)) {
> + dev_warn(dev, "no vmmc regulator found\n");
> + sc->vmmc = NULL;
> + } else
> + regulator_enable(sc->vmmc);
> +
> sc->clk_io = clk_get(dev, "hsmmc");
> if (IS_ERR(sc->clk_io)) {
> dev_err(dev, "failed to get io clock\n");
> @@ -482,6 +491,11 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
> clk_disable(sc->clk_io);
> clk_put(sc->clk_io);
>
> + if (sc->vmmc) {
> + regulator_disable(sc->vmmc);
> + regulator_put(sc->vmmc);
> + }
> +
> iounmap(host->ioaddr);
> release_resource(sc->ioarea);
> kfree(sc->ioarea);
> @@ -496,15 +510,29 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
>
> 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);
> +
> + return ret;
> }
>
> static int sdhci_s3c_resume(struct platform_device *dev)
> {
> struct sdhci_host *host = platform_get_drvdata(dev);
> + struct sdhci_s3c *sc = sdhci_priv(host);
> +
> + if (sc->vmmc) {
> + int ret = regulator_disable(sc->vmmc);
> + if (ret)
> + return ret;
> + mdelay(2);
Shouldn't these delays be handled in the regulator framework itself?
> + }
>
> sdhci_resume_host(host);
> return 0;
--
Maurus Cuelenaere
WARNING: multiple messages have this Message-ID (diff)
From: mcuelenaere@gmail.com (Maurus Cuelenaere)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] sdhci-s3c: add regulator support
Date: Wed, 28 Jul 2010 16:48:06 +0200 [thread overview]
Message-ID: <4C504326.30708@gmail.com> (raw)
In-Reply-To: <1280326797-15792-5-git-send-email-m.szyprowski@samsung.com>
Op 28-07-10 16:19, Marek Szyprowski schreef:
> This patch adds support for regulator API to sdhci-s3c driver. Regulators
> can be used to disable power in suspended state to reduce dissipated
> energy.
I'm not sure about this, when I would try to do this I'd look at implementing
this in the sdhci driver itself instead of a subdriver of it.
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 30 +++++++++++++++++++++++++++++-
> 1 files changed, 29 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 606e695..b9d46a5 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -19,6 +19,7 @@
> #include <linux/clk.h>
> #include <linux/io.h>
> #include <linux/gpio.h>
> +#include <linux/regulator/consumer.h>
>
> #include <linux/mmc/host.h>
>
> @@ -50,6 +51,7 @@ struct sdhci_s3c {
>
> struct clk *clk_io;
> struct clk *clk_bus[MAX_BUS_CLK];
> + struct regulator *vmmc;
> };
>
> static inline struct sdhci_s3c *to_s3c(struct sdhci_host *host)
> @@ -309,6 +311,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, host);
>
> + sc->vmmc = regulator_get(dev, "vmmc");
> + if (IS_ERR(sc->vmmc)) {
> + dev_warn(dev, "no vmmc regulator found\n");
> + sc->vmmc = NULL;
> + } else
> + regulator_enable(sc->vmmc);
> +
> sc->clk_io = clk_get(dev, "hsmmc");
> if (IS_ERR(sc->clk_io)) {
> dev_err(dev, "failed to get io clock\n");
> @@ -482,6 +491,11 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
> clk_disable(sc->clk_io);
> clk_put(sc->clk_io);
>
> + if (sc->vmmc) {
> + regulator_disable(sc->vmmc);
> + regulator_put(sc->vmmc);
> + }
> +
> iounmap(host->ioaddr);
> release_resource(sc->ioarea);
> kfree(sc->ioarea);
> @@ -496,15 +510,29 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
>
> 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);
> +
> + return ret;
> }
>
> static int sdhci_s3c_resume(struct platform_device *dev)
> {
> struct sdhci_host *host = platform_get_drvdata(dev);
> + struct sdhci_s3c *sc = sdhci_priv(host);
> +
> + if (sc->vmmc) {
> + int ret = regulator_disable(sc->vmmc);
> + if (ret)
> + return ret;
> + mdelay(2);
Shouldn't these delays be handled in the regulator framework itself?
> + }
>
> sdhci_resume_host(host);
> return 0;
--
Maurus Cuelenaere
next prev parent reply other threads:[~2010-07-28 14:48 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 14:19 [PATCH] SDHCI-S3C updates Marek Szyprowski
2010-07-28 14:19 ` Marek Szyprowski
2010-07-28 14:19 ` [PATCHv2 1/4] sdhci-s3c: add support for the non standard minimal clock value Marek Szyprowski
2010-07-28 14:19 ` Marek Szyprowski
2010-07-28 16:48 ` Ben Dooks
2010-07-28 16:48 ` Ben Dooks
2010-07-29 5:30 ` Marek Szyprowski
2010-07-29 5:30 ` Marek Szyprowski
2010-07-28 14:19 ` [PATCH 2/4] sdhci-s3c: enable SDHCI_QUIRK_NO_HISPD_BIT quirk Marek Szyprowski
2010-07-28 14:19 ` Marek Szyprowski
2010-07-28 14:19 ` [PATCHv5 3/4] sdhci-s3c: add support for new card detection methods (driver part) Marek Szyprowski
2010-07-28 14:19 ` Marek Szyprowski
2010-07-28 14:39 ` Maurus Cuelenaere
2010-07-28 14:39 ` Maurus Cuelenaere
2010-07-29 5:22 ` Marek Szyprowski
2010-07-29 5:22 ` Marek Szyprowski
2010-07-28 17:03 ` Ben Dooks
2010-07-28 17:03 ` Ben Dooks
2010-07-29 5:40 ` Marek Szyprowski
2010-07-29 5:40 ` Marek Szyprowski
2010-07-28 14:19 ` [PATCH 4/4] sdhci-s3c: add regulator support Marek Szyprowski
2010-07-28 14:19 ` Marek Szyprowski
2010-07-28 14:48 ` Maurus Cuelenaere [this message]
2010-07-28 14:48 ` Maurus Cuelenaere
2010-07-28 15:41 ` Mark Brown
2010-07-28 15:41 ` Mark Brown
2010-07-28 17:06 ` Maurus Cuelenaere
2010-07-28 17:06 ` Maurus Cuelenaere
2010-07-28 17:14 ` Mark Brown
2010-07-28 17:14 ` Mark Brown
2010-07-29 5:28 ` Marek Szyprowski
2010-07-29 5:28 ` Marek Szyprowski
2010-07-28 17:39 ` Mark Brown
2010-07-28 17:39 ` Mark Brown
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=4C504326.30708@gmail.com \
--to=mcuelenaere@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ben-linux@fluff.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.