linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: mythripk@ti.com, linux-omap@vger.kernel.org,
	linux-fbdev@vger.kernel.org, andy.green@linaro.org,
	n-dechesne@ti.com
Subject: Re: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state
Date: Tue, 26 Jun 2012 12:03:33 +0000	[thread overview]
Message-ID: <1340712213.24530.21.camel@deskari> (raw)
In-Reply-To: <CAJe_Zhd-LA67yO-H_7pacB_T8_z6=Zf47QuoHSJcsXDZ9S+byw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2902 bytes --]

On Tue, 2012-06-26 at 15:27 +0530, Jassi Brar wrote:

> Seems similar, but I only tested OMAP4 HDMI.

Would something like this one below work for you? It fixes the issues on
my overo board.

Instead of using omapdss device's suspend/resume callbacks, this one
uses PM notifier calls which happen before suspend and after resume.

I still think the suspend handling is wrong, omapdss shouldn't be
enabling and disabling panel devices like that, but this one should
remove the biggest issues with the current suspend method.

 Tomi

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 5066eee..c35a248 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -32,6 +32,7 @@
 #include <linux/io.h>
 #include <linux/device.h>
 #include <linux/regulator/consumer.h>
+#include <linux/suspend.h>
 
 #include <video/omapdss.h>
 
@@ -201,6 +202,30 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
 #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
 
 /* PLATFORM DEVICE */
+static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void *d)
+{
+	DSSDBG("pm notif %lu\n", v);
+
+	switch (v)
+	{
+	case PM_SUSPEND_PREPARE:
+		DSSDBG("suspending displays\n");
+		return dss_suspend_all_devices();
+
+	case PM_POST_SUSPEND:
+		DSSDBG("resuming displays\n");
+		return dss_resume_all_devices();
+
+	default:
+		return 0;
+	}
+}
+
+static struct notifier_block omap_dss_pm_notif_block =
+{
+	.notifier_call = omap_dss_pm_notif,
+};
+
 static int __init omap_dss_probe(struct platform_device *pdev)
 {
 	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
@@ -224,6 +249,8 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 	else if (pdata->default_device)
 		core.default_display_name = pdata->default_device->name;
 
+	register_pm_notifier(&omap_dss_pm_notif_block);
+
 	return 0;
 
 err_debugfs:
@@ -233,6 +260,8 @@ err_debugfs:
 
 static int omap_dss_remove(struct platform_device *pdev)
 {
+	unregister_pm_notifier(&omap_dss_pm_notif_block);
+
 	dss_uninitialize_debugfs();
 
 	dss_uninit_overlays(pdev);
@@ -247,25 +276,9 @@ static void omap_dss_shutdown(struct platform_device *pdev)
 	dss_disable_all_devices();
 }
 
-static int omap_dss_suspend(struct platform_device *pdev, pm_message_t state)
-{
-	DSSDBG("suspend %d\n", state.event);
-
-	return dss_suspend_all_devices();
-}
-
-static int omap_dss_resume(struct platform_device *pdev)
-{
-	DSSDBG("resume\n");
-
-	return dss_resume_all_devices();
-}
-
 static struct platform_driver omap_dss_driver = {
 	.remove         = omap_dss_remove,
 	.shutdown	= omap_dss_shutdown,
-	.suspend	= omap_dss_suspend,
-	.resume		= omap_dss_resume,
 	.driver         = {
 		.name   = "omapdss",
 		.owner  = THIS_MODULE,


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-06-26 12:03 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-23  8:18 [PATCH] OMAPDSS: Check if RPM enabled before trying to change state jaswinder.singh
2012-06-25  6:20 ` Tomi Valkeinen
2012-06-25  8:53   ` Jassi Brar
2012-06-25  9:30     ` Tomi Valkeinen
2012-06-25 12:39       ` Jassi Brar
2012-06-25 12:41         ` Tomi Valkeinen
2012-06-25 13:43           ` Jassi Brar
2012-06-25 13:49             ` Tomi Valkeinen
2012-06-25 17:18               ` Jassi Brar
2012-06-26  7:19                 ` Tomi Valkeinen
2012-06-26  8:44                   ` Jassi Brar
2012-06-26  8:40                     ` Andy Green
2012-06-26  9:07                     ` Tomi Valkeinen
2012-06-26 10:09                       ` Jassi Brar
2012-06-26 12:03                         ` Tomi Valkeinen [this message]
2012-06-26 14:52                           ` Jassi Brar
2012-06-26 15:08                             ` Tomi Valkeinen
2012-06-26 15:21                               ` Jassi Brar
2012-06-26 15:11                                 ` Tomi Valkeinen
2012-06-26 17:13                                   ` Jassi Brar
2012-06-26 18:44                                     ` Tomi Valkeinen
2012-06-27  4:54                                       ` Jassi Brar
2012-06-27  5:58                                         ` Tomi Valkeinen
2012-06-27  7:53                                           ` Jassi Brar
2012-06-27  8:13                                             ` Tomi Valkeinen
2012-06-27 14:56                                               ` Jassi Brar
2012-06-28  6:41                                                 ` Tomi Valkeinen
2012-06-28  7:58                                                   ` Jassi Brar
2012-06-28  7:58                                                     ` Tomi Valkeinen
2012-06-25 12:05   ` Grazvydas Ignotas
2012-06-25 12:30     ` Tomi Valkeinen
2012-06-25 12:54       ` Rajendra Nayak
2012-06-25 12:50         ` Tomi Valkeinen
2012-06-26  4:55           ` Rajendra Nayak
2012-06-26 13:02             ` Grazvydas Ignotas
2012-06-26 14:34               ` Alan Stern
2012-06-26 15:01                 ` Tomi Valkeinen
2012-06-26 15:11                   ` Alan Stern
2012-06-25 12:45     ` Jassi Brar

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=1340712213.24530.21.camel@deskari \
    --to=tomi.valkeinen@ti.com \
    --cc=andy.green@linaro.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mythripk@ti.com \
    --cc=n-dechesne@ti.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).