From: <mythripk@ti.com>
To: tomi.valkeinen@ti.com, linux-omap@vger.kernel.org
Cc: Mythri P K <mythripk@ti.com>
Subject: [PATCH 3/3] OMAPDSS: HDMI: Add option to enable HDMI in HPD mode
Date: Tue, 13 Dec 2011 18:54:58 +0530 [thread overview]
Message-ID: <1323782698-24428-4-git-send-email-mythripk@ti.com> (raw)
In-Reply-To: <1323782698-24428-3-git-send-email-mythripk@ti.com>
From: Mythri P K <mythripk@ti.com>
Add option in the panel to enable HDMI in HPD mode to enable the interrupt to
detect cable connect/disconnect, HDMI will be powered on only when the cable is
connected and powered down when cable is disconnected.
Signed-off-by: Mythri P K <mythripk@ti.com>
---
drivers/video/omap2/dss/hdmi_panel.c | 54 ++++++++++++++++++++++++++++++++--
include/video/omapdss.h | 1 +
2 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
index 533d5dc..0b8a8ac 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -61,7 +61,7 @@ static int hdmi_panel_enable(struct omap_dss_device *dssdev)
mutex_lock(&hdmi.hdmi_lock);
- if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
+ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
r = -EINVAL;
goto err;
}
@@ -222,11 +222,57 @@ err:
return r;
}
+static void hdmi_hpd_disable(struct omap_dss_device *dssdev)
+{
+ mutex_lock(&hdmi.hdmi_lock);
+
+ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE ||
+ dssdev->state == OMAP_DSS_DISPLAY_HOTPLUG)
+ omapdss_hdmi_hpd_disable(dssdev);
+
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+
+ mutex_unlock(&hdmi.hdmi_lock);
+}
+
+static int hdmi_hpd_enable(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+ DSSDBG("ENTER hdmi_hpd_enable\n");
+
+ mutex_lock(&hdmi.hdmi_lock);
+
+ if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
+ r = -EINVAL;
+ goto err;
+ }
+
+ r = omapdss_hdmi_hpd_enable(dssdev);
+
+ if (r < 0) {
+ DSSERR("failed to power on\n");
+ goto err;
+ } else if (r == 1) {
+ r = omapdss_hdmi_display_enable(dssdev);
+ if (r) {
+ DSSERR("failed to power on\n");
+ goto err;
+ }
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+ } else {
+ dssdev->state = OMAP_DSS_DISPLAY_HOTPLUG;
+ }
+
+err: mutex_unlock(&hdmi.hdmi_lock);
+
+ return r;
+}
+
static struct omap_dss_driver hdmi_driver = {
.probe = hdmi_panel_probe,
.remove = hdmi_panel_remove,
- .enable = hdmi_panel_enable,
- .disable = hdmi_panel_disable,
+ .enable = hdmi_hpd_enable,
+ .disable = hdmi_hpd_disable,
.suspend = hdmi_panel_suspend,
.resume = hdmi_panel_resume,
.get_timings = hdmi_get_timings,
@@ -234,6 +280,8 @@ static struct omap_dss_driver hdmi_driver = {
.check_timings = hdmi_check_timings,
.read_edid = hdmi_read_edid,
.detect = hdmi_detect,
+ .default_enable = hdmi_panel_enable,
+ .default_disable = hdmi_panel_disable,
.driver = {
.name = "hdmi_panel",
.owner = THIS_MODULE,
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 82e2c3e..5623a34 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -159,6 +159,7 @@ enum omap_dss_display_state {
OMAP_DSS_DISPLAY_DISABLED = 0,
OMAP_DSS_DISPLAY_ACTIVE,
OMAP_DSS_DISPLAY_SUSPENDED,
+ OMAP_DSS_DISPLAY_HOTPLUG,
};
/* XXX perhaps this should be removed */
--
1.7.5.4
next prev parent reply other threads:[~2011-12-13 13:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 13:24 [PATCH 0/3] OMAPDSS: HDMI: HDMI Hot-plug detect support mythripk
2011-12-13 13:24 ` [PATCH 1/3] OMAPDSS: HDMI: HPD support in boardfile mythripk
2011-12-13 13:24 ` [PATCH 2/3] OMAPDSS: HDMI: HPD support added to HDMI driver mythripk
2011-12-13 13:24 ` mythripk [this message]
2011-12-17 1:34 ` [PATCH 1/3] OMAPDSS: HDMI: HPD support in boardfile Tony Lindgren
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=1323782698-24428-4-git-send-email-mythripk@ti.com \
--to=mythripk@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=tomi.valkeinen@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).