All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM
@ 2011-07-11 12:35 Laurent Pinchart
  2011-07-12  9:33 ` [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming Guennadi Liakhovetski
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Laurent Pinchart @ 2011-07-11 12:35 UTC (permalink / raw)
  To: linux-fbdev

Resuming from runtime PM restores all LCDC registers. If the dot clock
is off at that time display panning information will be corrupted.

Turn the dot clock on before resuming from runtime PM. Similarly,
turn the clock off after suspending the LCDC.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
 drivers/video/sh_mobile_lcdcfb.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

This patch should fix the LCDC panning issue caused by runtime suspend. It
applies on top of Rafael J. Wysocki's pm-domains branch and Damian
Hobson-Garcia's MERAM patches.

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 48a40e3..e9b80bc 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -256,9 +256,9 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
 static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
 {
 	if (atomic_inc_and_test(&priv->hw_usecnt)) {
-		pm_runtime_get_sync(priv->dev);
 		if (priv->dot_clk)
 			clk_enable(priv->dot_clk);
+		pm_runtime_get_sync(priv->dev);
 		if (priv->meram_dev && priv->meram_dev->pdev)
 			pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
 	}
@@ -267,11 +267,11 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
 static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
 {
 	if (atomic_sub_return(1, &priv->hw_usecnt) = -1) {
-		if (priv->dot_clk)
-			clk_disable(priv->dot_clk);
 		if (priv->meram_dev && priv->meram_dev->pdev)
 			pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
 		pm_runtime_put(priv->dev);
+		if (priv->dot_clk)
+			clk_disable(priv->dot_clk);
 	}
 }
 
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-09-20 23:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 12:35 [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM Laurent Pinchart
2011-07-12  9:33 ` [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming Guennadi Liakhovetski
2011-07-12  9:37 ` [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM Laurent Pinchart
2011-07-13  8:21 ` Paul Mundt
2011-09-20 19:30 ` Laurent Pinchart
2011-09-20 19:52 ` [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming Florian Tobias Schandinat
2011-09-20 19:56 ` [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM Laurent Pinchart
2011-09-20 20:19 ` [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming Florian Tobias Schandinat
2011-09-20 22:44 ` [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM Laurent Pinchart
2011-09-20 23:03 ` Laurent Pinchart

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.