All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP: DSS: ensure clocks are disabled on failed init
@ 2010-04-26 19:12 Kevin Hilman
  2010-04-27  9:14 ` Grazvydas Ignotas
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hilman @ 2010-04-26 19:12 UTC (permalink / raw)
  To: linux-omap

Currently, if init fails for whatever reason, various DSS related
clocks will be left enabled and prevent the chip from hitting
retention or off-mode.

This patch ensures the clocks are disabled on a failed init.

For this to work, a check had to be added to dispc_save_context()
to not save context if it has not yet been initialized.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
Patch against v2.6.34-rc5.

Discovered when testing n900 with current PM branch + Roger's 
series for the LCC panel.  DPI init fails since it can't find
VDDS_DSI regulator, and as a result init fails out and leaves
clocks enabled.

 drivers/video/omap2/dss/core.c  |    1 +
 drivers/video/omap2/dss/dispc.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 7ebe50b..62f7ee2 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -584,6 +584,7 @@ static int omap_dss_probe(struct platform_device *pdev)
 
 	/* XXX fail correctly */
 fail0:
+	dss_clk_disable_all();
 	return r;
 }
 
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index e777e35..4cc54ef 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -195,6 +195,9 @@ void dispc_save_context(void)
 	if (cpu_is_omap24xx())
 		return;
 
+	if (!dispc.base)
+		return;
+
 	SR(SYSCONFIG);
 	SR(IRQENABLE);
 	SR(CONTROL);
-- 
1.7.0.2


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

end of thread, other threads:[~2010-04-27 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-26 19:12 [PATCH] OMAP: DSS: ensure clocks are disabled on failed init Kevin Hilman
2010-04-27  9:14 ` Grazvydas Ignotas
2010-04-27 10:40   ` Tomi Valkeinen
2010-04-27 15:13     ` Kevin Hilman

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.