diff mbox

spi/pl022: Unprepare clocks while suspended

Message ID 1390416154-3292-1-git-send-email-broonie@kernel.org (mailing list archive)
State Accepted
Commit 3e7dde425dbcc7965398e92909d898c4ebc9fdb8
Headers show

Commit Message

Mark Brown Jan. 22, 2014, 6:42 p.m. UTC
From: Mark Brown <broonie@linaro.org>

When the driver was converted to clk_prepare() the suspend path didn't
have any changes made so the clock remains prepared throughout the runtime
of the driver. Unprepare it when suspended so that any savings that can be
made as a result are made.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/spi/spi-pl022.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Linus Walleij Jan. 23, 2014, 7:13 a.m. UTC | #1
On Wed, Jan 22, 2014 at 7:42 PM, Mark Brown <broonie@kernel.org> wrote:

> From: Mark Brown <broonie@linaro.org>
>
> When the driver was converted to clk_prepare() the suspend path didn't
> have any changes made so the clock remains prepared throughout the runtime
> of the driver. Unprepare it when suspended so that any savings that can be
> made as a result are made.
>
> Signed-off-by: Mark Brown <broonie@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Maybe you should update the probe() and remove()
runpaths to use the combined prepare_enable() &
unprepare_disable() calls as well when you're at it?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Jan. 23, 2014, 12:18 p.m. UTC | #2
On Thu, Jan 23, 2014 at 08:13:09AM +0100, Linus Walleij wrote:

> Maybe you should update the probe() and remove()
> runpaths to use the combined prepare_enable() &
> unprepare_disable() calls as well when you're at it?

Yes, someone should probably do that :)
diff mbox

Patch

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 2789b452e711..4ec49eae6141 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2296,7 +2296,7 @@  pl022_remove(struct amba_device *adev)
  */
 static void pl022_suspend_resources(struct pl022 *pl022, bool runtime)
 {
-	clk_disable(pl022->clk);
+	clk_disable_unprepare(pl022->clk);
 
 	if (runtime)
 		pinctrl_pm_select_idle_state(&pl022->adev->dev);
@@ -2312,7 +2312,7 @@  static void pl022_resume_resources(struct pl022 *pl022, bool runtime)
 		/* Then let's idle the pins until the next transfer happens */
 		pinctrl_pm_select_idle_state(&pl022->adev->dev);
 
-	clk_enable(pl022->clk);
+	clk_prepare_enable(pl022->clk);
 }
 #endif