Skip to contentSkip to conversation

spi/pl022: Unprepare clocks while suspended

PATCH In review Mark Brown 2 participants 3 messages Jan 22, 2014 – Jan 23, 2014 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 spi/pl022: Unprepare clocks while suspended

From: Mark Brown <[email protected]>

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.

---
 drivers/spi/spi-pl022.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-pl022.c +2 -2
index 2789b452e711..4ec49eae6141 100644
@@ -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
 
Signature · 6 lines
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1390416154-3292-1-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Acked-by
#2 lore raw
Quoted 8 lines · Mark Brown

From: Mark Brown <[email protected]>

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.

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CACRpkdYPR92BS2Fzkw+m40cu__ct6xcku8yV6mY=_4dQU61tvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#4 lore raw
Quoted 3 lines · Linus Walleij

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 :)