* [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle
@ 2008-11-21 9:24 Adrian Hunter
2008-11-26 19:11 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2008-11-21 9:24 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org Mailing List
Add a timer that is kept active by MMC requests. FCLK is disabled on timeout
Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
---
drivers/mmc/host/omap_hsmmc.c | 73 +++++++++++++++++++++++++++++++++-------
1 files changed, 60 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 0df6841..ee21a64 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -121,6 +121,9 @@
#define OMAP_HSMMC_WRITE(base, reg, val) \
__raw_writel((val), (base) + OMAP_HSMMC_##reg)
+enum {OFF = 0, ON};
+#define IDLE_TIMEOUT (5*HZ)
+
struct mmc_omap_host {
struct device *dev;
struct mmc_host *mmc;
@@ -148,9 +151,50 @@ struct mmc_omap_host {
int initstr;
int slot_id;
int dbclk_enabled;
+
+ struct timer_list idle_timer;
+ spinlock_t clk_lock; /* for changing enabled state */
+ int fclk_enabled:1;
+
struct omap_mmc_platform_data *pdata;
};
+int mmc_omap_fclk_state(struct mmc_omap_host *host, unsigned int state)
+{
+ unsigned long flags;
+ int ret;
+
+ spin_lock_irqsave(&host->clk_lock, flags);
+ if (host->fclk_enabled != state) {
+ if (state == ON) {
+ if (host->fclk_enabled == OFF) {
+ ret = clk_enable(host->fclk);
+ if (ret != 0)
+ return ret;
+ dev_dbg(mmc_dev(host->mmc),
+ "mmc_fclk: enabled\n");
+ }
+ /* Revisit: Change the timer bump based on real
+ MMC usage characteristics */
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
+ } else {
+ clk_disable(host->fclk);
+ dev_dbg(mmc_dev(host->mmc), "mmc_fclk: disabled\n");
+ del_timer(&host->idle_timer);
+ }
+ host->fclk_enabled = state;
+ }
+ spin_unlock_irqrestore(&host->clk_lock, flags);
+ return 0;
+}
+
+static void mmc_omap_idle_timer(unsigned long data)
+{
+ struct mmc_omap_host *host = (struct mmc_omap_host *) data;
+
+ mmc_omap_fclk_state(host, OFF);
+}
+
/*
* Stop clock to the card
*/
@@ -457,7 +501,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
int ret;
/* Disable the clocks */
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_disable(host->dbclk);
@@ -471,7 +515,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
if (ret != 0)
goto err;
- clk_enable(host->fclk);
+ mmc_omap_fclk_state(host, ON);
clk_enable(host->iclk);
clk_enable(host->dbclk);
@@ -742,10 +786,10 @@ static void omap_mmc_request(struct mmc_host *mmc, struct mmc_request *req)
WARN_ON(host->mrq != NULL);
host->mrq = req;
mmc_omap_prepare_data(host, req);
+ mmc_omap_fclk_state(host, ON);
mmc_omap_start_command(host, req->cmd, req->data);
}
-
/* Routine to configure clock values. Exposed API to core */
static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
@@ -824,6 +868,7 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
OMAP_HSMMC_WRITE(host->base, CON,
OMAP_HSMMC_READ(host->base, CON) | OD);
+
}
static int omap_hsmmc_get_cd(struct mmc_host *mmc)
@@ -860,7 +905,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
struct mmc_host *mmc;
struct mmc_omap_host *host = NULL;
struct resource *res;
- int ret = 0, irq;
+ int ret = 0, irq, reg;
u32 hctl, capa;
if (pdata == NULL) {
@@ -925,14 +970,17 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
goto err1;
}
- if (clk_enable(host->fclk) != 0) {
+ spin_lock_init(&host->clk_lock);
+ setup_timer(&host->idle_timer, mmc_omap_idle_timer,
+ (unsigned long) host);
+
+ if (mmc_omap_fclk_state(host, ON) != 0) {
clk_put(host->iclk);
clk_put(host->fclk);
goto err1;
}
-
if (clk_enable(host->iclk) != 0) {
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_put(host->iclk);
clk_put(host->fclk);
goto err1;
@@ -1047,7 +1095,7 @@ err_irq_cd:
err_irq_cd_init:
free_irq(host->irq, host);
err_irq:
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_put(host->fclk);
clk_put(host->iclk);
@@ -1096,7 +1144,7 @@ static int omap_mmc_remove(struct platform_device *pdev)
free_irq(mmc_slot(host).card_detect_irq, host);
flush_scheduled_work();
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_put(host->fclk);
clk_put(host->iclk);
@@ -1149,7 +1197,7 @@ static int omap_mmc_suspend(struct platform_device *pdev, pm_message_t state)
| SDBP);
}
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_disable(host->dbclk);
}
@@ -1169,13 +1217,12 @@ static int omap_mmc_resume(struct platform_device *pdev)
if (host) {
- ret = clk_enable(host->fclk);
- if (ret)
+ if (mmc_omap_fclk_state(host, ON) != 0)
goto clk_en_err;
ret = clk_enable(host->iclk);
if (ret) {
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_put(host->fclk);
goto clk_en_err;
}
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle
2008-11-21 9:24 [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle Adrian Hunter
@ 2008-11-26 19:11 ` Tony Lindgren
2008-11-27 8:43 ` Adrian Hunter
0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2008-11-26 19:11 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linux-omap@vger.kernel.org Mailing List
* Adrian Hunter <ext-adrian.hunter@nokia.com> [081121 01:15]:
> Add a timer that is kept active by MMC requests. FCLK is disabled on timeout
Let's keep these patches on hold until we have the hsmmc.c driver in
mainline, then get them integrated via LKML.
Meanwhile, maybe you want to set up a git branch for hsmmc to queue these?
And then I could mirror your hsmmc branch.
Regards,
Tony
> Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
> ---
> drivers/mmc/host/omap_hsmmc.c | 73 +++++++++++++++++++++++++++++++++-------
> 1 files changed, 60 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 0df6841..ee21a64 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -121,6 +121,9 @@
> #define OMAP_HSMMC_WRITE(base, reg, val) \
> __raw_writel((val), (base) + OMAP_HSMMC_##reg)
>
> +enum {OFF = 0, ON};
> +#define IDLE_TIMEOUT (5*HZ)
> +
> struct mmc_omap_host {
> struct device *dev;
> struct mmc_host *mmc;
> @@ -148,9 +151,50 @@ struct mmc_omap_host {
> int initstr;
> int slot_id;
> int dbclk_enabled;
> +
> + struct timer_list idle_timer;
> + spinlock_t clk_lock; /* for changing enabled state */
> + int fclk_enabled:1;
> +
> struct omap_mmc_platform_data *pdata;
> };
>
> +int mmc_omap_fclk_state(struct mmc_omap_host *host, unsigned int state)
> +{
> + unsigned long flags;
> + int ret;
> +
> + spin_lock_irqsave(&host->clk_lock, flags);
> + if (host->fclk_enabled != state) {
> + if (state == ON) {
> + if (host->fclk_enabled == OFF) {
> + ret = clk_enable(host->fclk);
> + if (ret != 0)
> + return ret;
> + dev_dbg(mmc_dev(host->mmc),
> + "mmc_fclk: enabled\n");
> + }
> + /* Revisit: Change the timer bump based on real
> + MMC usage characteristics */
> + mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
> + } else {
> + clk_disable(host->fclk);
> + dev_dbg(mmc_dev(host->mmc), "mmc_fclk: disabled\n");
> + del_timer(&host->idle_timer);
> + }
> + host->fclk_enabled = state;
> + }
> + spin_unlock_irqrestore(&host->clk_lock, flags);
> + return 0;
> +}
> +
> +static void mmc_omap_idle_timer(unsigned long data)
> +{
> + struct mmc_omap_host *host = (struct mmc_omap_host *) data;
> +
> + mmc_omap_fclk_state(host, OFF);
> +}
> +
> /*
> * Stop clock to the card
> */
> @@ -457,7 +501,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
> int ret;
>
> /* Disable the clocks */
> - clk_disable(host->fclk);
> + mmc_omap_fclk_state(host, OFF);
> clk_disable(host->iclk);
> clk_disable(host->dbclk);
>
> @@ -471,7 +515,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
> if (ret != 0)
> goto err;
>
> - clk_enable(host->fclk);
> + mmc_omap_fclk_state(host, ON);
> clk_enable(host->iclk);
> clk_enable(host->dbclk);
>
> @@ -742,10 +786,10 @@ static void omap_mmc_request(struct mmc_host *mmc, struct mmc_request *req)
> WARN_ON(host->mrq != NULL);
> host->mrq = req;
> mmc_omap_prepare_data(host, req);
> + mmc_omap_fclk_state(host, ON);
> mmc_omap_start_command(host, req->cmd, req->data);
> }
>
> -
> /* Routine to configure clock values. Exposed API to core */
> static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> {
> @@ -824,6 +868,7 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
> OMAP_HSMMC_WRITE(host->base, CON,
> OMAP_HSMMC_READ(host->base, CON) | OD);
> +
> }
>
> static int omap_hsmmc_get_cd(struct mmc_host *mmc)
> @@ -860,7 +905,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
> struct mmc_host *mmc;
> struct mmc_omap_host *host = NULL;
> struct resource *res;
> - int ret = 0, irq;
> + int ret = 0, irq, reg;
> u32 hctl, capa;
>
> if (pdata == NULL) {
> @@ -925,14 +970,17 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
> goto err1;
> }
>
> - if (clk_enable(host->fclk) != 0) {
> + spin_lock_init(&host->clk_lock);
> + setup_timer(&host->idle_timer, mmc_omap_idle_timer,
> + (unsigned long) host);
> +
> + if (mmc_omap_fclk_state(host, ON) != 0) {
> clk_put(host->iclk);
> clk_put(host->fclk);
> goto err1;
> }
> -
> if (clk_enable(host->iclk) != 0) {
> - clk_disable(host->fclk);
> + mmc_omap_fclk_state(host, OFF);
> clk_put(host->iclk);
> clk_put(host->fclk);
> goto err1;
> @@ -1047,7 +1095,7 @@ err_irq_cd:
> err_irq_cd_init:
> free_irq(host->irq, host);
> err_irq:
> - clk_disable(host->fclk);
> + mmc_omap_fclk_state(host, OFF);
> clk_disable(host->iclk);
> clk_put(host->fclk);
> clk_put(host->iclk);
> @@ -1096,7 +1144,7 @@ static int omap_mmc_remove(struct platform_device *pdev)
> free_irq(mmc_slot(host).card_detect_irq, host);
> flush_scheduled_work();
>
> - clk_disable(host->fclk);
> + mmc_omap_fclk_state(host, OFF);
> clk_disable(host->iclk);
> clk_put(host->fclk);
> clk_put(host->iclk);
> @@ -1149,7 +1197,7 @@ static int omap_mmc_suspend(struct platform_device *pdev, pm_message_t state)
> | SDBP);
> }
>
> - clk_disable(host->fclk);
> + mmc_omap_fclk_state(host, OFF);
> clk_disable(host->iclk);
> clk_disable(host->dbclk);
> }
> @@ -1169,13 +1217,12 @@ static int omap_mmc_resume(struct platform_device *pdev)
>
> if (host) {
>
> - ret = clk_enable(host->fclk);
> - if (ret)
> + if (mmc_omap_fclk_state(host, ON) != 0)
> goto clk_en_err;
>
> ret = clk_enable(host->iclk);
> if (ret) {
> - clk_disable(host->fclk);
> + mmc_omap_fclk_state(host, OFF);
> clk_put(host->fclk);
> goto clk_en_err;
> }
> --
> 1.5.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle
2008-11-26 19:11 ` Tony Lindgren
@ 2008-11-27 8:43 ` Adrian Hunter
2008-12-09 20:02 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2008-11-27 8:43 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap@vger.kernel.org Mailing List,
Lavinen Jarkko (Nokia-M/Helsinki)
Tony Lindgren wrote:
> * Adrian Hunter <ext-adrian.hunter@nokia.com> [081121 01:15]:
>> Add a timer that is kept active by MMC requests. FCLK is disabled on timeout
>
> Let's keep these patches on hold until we have the hsmmc.c driver in
> mainline, then get them integrated via LKML.
>
> Meanwhile, maybe you want to set up a git branch for hsmmc to queue these?
> And then I could mirror your hsmmc branch.
As you wish.
tree is:
git://git.infradead.org/users/ahunter/omap_hsmmc.git
branch is:
omap_hsmmc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle
2008-11-27 8:43 ` Adrian Hunter
@ 2008-12-09 20:02 ` Tony Lindgren
0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2008-12-09 20:02 UTC (permalink / raw)
To: Adrian Hunter
Cc: linux-omap@vger.kernel.org Mailing List,
Lavinen Jarkko (Nokia-M/Helsinki)
* Adrian Hunter <ext-adrian.hunter@nokia.com> [081127 00:34]:
> Tony Lindgren wrote:
>> * Adrian Hunter <ext-adrian.hunter@nokia.com> [081121 01:15]:
>>> Add a timer that is kept active by MMC requests. FCLK is disabled on timeout
>>
>> Let's keep these patches on hold until we have the hsmmc.c driver in
>> mainline, then get them integrated via LKML.
>>
>> Meanwhile, maybe you want to set up a git branch for hsmmc to queue these?
>> And then I could mirror your hsmmc branch.
>
> As you wish.
>
> tree is:
>
> git://git.infradead.org/users/ahunter/omap_hsmmc.git
>
> branch is:
>
> omap_hsmmc
Thanks, I'm now mirroring that branch in my git tree, and I've merged
it to linux-omap tree.
Please rebase your omap_hsmmc branch against the mainline tree once
we have the current mmc patches in my hsmmc branch integrated to
mainline. That way the omap_hsmmc queue will be ready for next merge
window.
Regards,
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/9] OMAP: HSMMC: Patches
@ 2008-11-21 9:23 Adrian Hunter
2008-11-21 9:37 ` Adrian Hunter
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2008-11-21 9:23 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org Mailing List
Hi
OMAP HSMMC is not ready for mainline, but development is ongoing.
In the meantime these patches are best posted and applied via
omap mailing list and tree.
Regards
Adrian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/9] OMAP: HSMMC: Patches
2008-11-21 9:23 [PATCH 0/9] OMAP: HSMMC: Patches Adrian Hunter
@ 2008-11-21 9:37 ` Adrian Hunter
2008-11-21 9:43 ` [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle Adrian Hunter
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2008-11-21 9:37 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org Mailing List
Adrian Hunter wrote:
> Hi
>
> OMAP HSMMC is not ready for mainline, but development is ongoing.
>
> In the meantime these patches are best posted and applied via
> omap mailing list and tree.
>
> Regards
> Adrian
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Just realised I forgot the from lines in all those patches - will resend.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle
2008-11-21 9:37 ` Adrian Hunter
@ 2008-11-21 9:43 ` Adrian Hunter
0 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2008-11-21 9:43 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org Mailing List
From: Amit Kucheria <amit.kucheria@verdurent.com>
Date: Mon, 22 Sep 2008 10:23:09 +0300
Add a timer that is kept active by MMC requests. FCLK is disabled on timeout
Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
---
drivers/mmc/host/omap_hsmmc.c | 73 +++++++++++++++++++++++++++++++++-------
1 files changed, 60 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 0df6841..ee21a64 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -121,6 +121,9 @@
#define OMAP_HSMMC_WRITE(base, reg, val) \
__raw_writel((val), (base) + OMAP_HSMMC_##reg)
+enum {OFF = 0, ON};
+#define IDLE_TIMEOUT (5*HZ)
+
struct mmc_omap_host {
struct device *dev;
struct mmc_host *mmc;
@@ -148,9 +151,50 @@ struct mmc_omap_host {
int initstr;
int slot_id;
int dbclk_enabled;
+
+ struct timer_list idle_timer;
+ spinlock_t clk_lock; /* for changing enabled state */
+ int fclk_enabled:1;
+
struct omap_mmc_platform_data *pdata;
};
+int mmc_omap_fclk_state(struct mmc_omap_host *host, unsigned int state)
+{
+ unsigned long flags;
+ int ret;
+
+ spin_lock_irqsave(&host->clk_lock, flags);
+ if (host->fclk_enabled != state) {
+ if (state == ON) {
+ if (host->fclk_enabled == OFF) {
+ ret = clk_enable(host->fclk);
+ if (ret != 0)
+ return ret;
+ dev_dbg(mmc_dev(host->mmc),
+ "mmc_fclk: enabled\n");
+ }
+ /* Revisit: Change the timer bump based on real
+ MMC usage characteristics */
+ mod_timer(&host->idle_timer, jiffies + IDLE_TIMEOUT);
+ } else {
+ clk_disable(host->fclk);
+ dev_dbg(mmc_dev(host->mmc), "mmc_fclk: disabled\n");
+ del_timer(&host->idle_timer);
+ }
+ host->fclk_enabled = state;
+ }
+ spin_unlock_irqrestore(&host->clk_lock, flags);
+ return 0;
+}
+
+static void mmc_omap_idle_timer(unsigned long data)
+{
+ struct mmc_omap_host *host = (struct mmc_omap_host *) data;
+
+ mmc_omap_fclk_state(host, OFF);
+}
+
/*
* Stop clock to the card
*/
@@ -457,7 +501,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
int ret;
/* Disable the clocks */
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_disable(host->dbclk);
@@ -471,7 +515,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
if (ret != 0)
goto err;
- clk_enable(host->fclk);
+ mmc_omap_fclk_state(host, ON);
clk_enable(host->iclk);
clk_enable(host->dbclk);
@@ -742,10 +786,10 @@ static void omap_mmc_request(struct mmc_host *mmc, struct mmc_request *req)
WARN_ON(host->mrq != NULL);
host->mrq = req;
mmc_omap_prepare_data(host, req);
+ mmc_omap_fclk_state(host, ON);
mmc_omap_start_command(host, req->cmd, req->data);
}
-
/* Routine to configure clock values. Exposed API to core */
static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
@@ -824,6 +868,7 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
OMAP_HSMMC_WRITE(host->base, CON,
OMAP_HSMMC_READ(host->base, CON) | OD);
+
}
static int omap_hsmmc_get_cd(struct mmc_host *mmc)
@@ -860,7 +905,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
struct mmc_host *mmc;
struct mmc_omap_host *host = NULL;
struct resource *res;
- int ret = 0, irq;
+ int ret = 0, irq, reg;
u32 hctl, capa;
if (pdata == NULL) {
@@ -925,14 +970,17 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
goto err1;
}
- if (clk_enable(host->fclk) != 0) {
+ spin_lock_init(&host->clk_lock);
+ setup_timer(&host->idle_timer, mmc_omap_idle_timer,
+ (unsigned long) host);
+
+ if (mmc_omap_fclk_state(host, ON) != 0) {
clk_put(host->iclk);
clk_put(host->fclk);
goto err1;
}
-
if (clk_enable(host->iclk) != 0) {
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_put(host->iclk);
clk_put(host->fclk);
goto err1;
@@ -1047,7 +1095,7 @@ err_irq_cd:
err_irq_cd_init:
free_irq(host->irq, host);
err_irq:
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_put(host->fclk);
clk_put(host->iclk);
@@ -1096,7 +1144,7 @@ static int omap_mmc_remove(struct platform_device *pdev)
free_irq(mmc_slot(host).card_detect_irq, host);
flush_scheduled_work();
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_put(host->fclk);
clk_put(host->iclk);
@@ -1149,7 +1197,7 @@ static int omap_mmc_suspend(struct platform_device *pdev, pm_message_t state)
| SDBP);
}
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_disable(host->iclk);
clk_disable(host->dbclk);
}
@@ -1169,13 +1217,12 @@ static int omap_mmc_resume(struct platform_device *pdev)
if (host) {
- ret = clk_enable(host->fclk);
- if (ret)
+ if (mmc_omap_fclk_state(host, ON) != 0)
goto clk_en_err;
ret = clk_enable(host->iclk);
if (ret) {
- clk_disable(host->fclk);
+ mmc_omap_fclk_state(host, OFF);
clk_put(host->fclk);
goto clk_en_err;
}
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-09 20:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-21 9:24 [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle Adrian Hunter
2008-11-26 19:11 ` Tony Lindgren
2008-11-27 8:43 ` Adrian Hunter
2008-12-09 20:02 ` Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2008-11-21 9:23 [PATCH 0/9] OMAP: HSMMC: Patches Adrian Hunter
2008-11-21 9:37 ` Adrian Hunter
2008-11-21 9:43 ` [PATCH 1/9] OMAP: HSMMC: Make driver support dynamic idle Adrian Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox