All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH] OMAP: DSS: ensure clocks are disabled on failed init
Date: Mon, 26 Apr 2010 12:12:46 -0700	[thread overview]
Message-ID: <1272309166-698-1-git-send-email-khilman@deeprootsystems.com> (raw)

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


             reply	other threads:[~2010-04-26 19:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26 19:12 Kevin Hilman [this message]
2010-04-27  9:14 ` [PATCH] OMAP: DSS: ensure clocks are disabled on failed init Grazvydas Ignotas
2010-04-27 10:40   ` Tomi Valkeinen
2010-04-27 15:13     ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272309166-698-1-git-send-email-khilman@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.