aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRicardo Salveti de Araujo <ricardo.salveti@canonical.com>2011-04-04 03:11:56 -0300
committerRicardo Salveti de Araujo <ricardo.salveti@canonical.com>2011-05-16 22:49:55 -0300
commit5686410a6094b68aa665a33097aa0f381e2b7125 (patch)
tree2a549781862b7939603323ee4888533ffaa0bda6 /drivers
parent6f202d57b83ff3f8860bcf416736e9955ee88f97 (diff)
downloadlinux-linaro-android-5686410a6094b68aa665a33097aa0f381e2b7125.tar.gz
OMAP: DSS2: HDMI: Adding is_detected callback support
This is a port from Rob Clark <rob@ti.com> patch. Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/dss.h1
-rw-r--r--drivers/video/omap2/dss/hdmi.c9
-rw-r--r--drivers/video/omap2/dss/hdmi_omap4_panel.c6
3 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index fbf4a69cebc..8c32717b73c 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -483,6 +483,7 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev);
int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings);
+bool omapdss_hdmi_is_detected(struct omap_dss_device *dssdev);
int omapdss_hdmi_get_edid(struct omap_dss_device *dssdev, u8 *buf, int len);
int hdmi_panel_init(void);
void hdmi_panel_exit(void);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index fe1b6803c4b..fd0d57807c6 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1204,6 +1204,15 @@ static void hdmi_power_off(struct omap_dss_device *dssdev)
hdmi.edid_set = 0;
}
+bool omapdss_hdmi_is_detected(struct omap_dss_device *dssdev)
+{
+ u32 r;
+
+ r = hdmi_read_reg(HDMI_CORE_SYS_SYS_STAT);
+
+ return !!(r & 0x2);
+}
+
int omapdss_hdmi_get_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
{
if (!hdmi.edid_set)
diff --git a/drivers/video/omap2/dss/hdmi_omap4_panel.c b/drivers/video/omap2/dss/hdmi_omap4_panel.c
index e04960a0a20..9ab7f81796a 100644
--- a/drivers/video/omap2/dss/hdmi_omap4_panel.c
+++ b/drivers/video/omap2/dss/hdmi_omap4_panel.c
@@ -143,6 +143,11 @@ err:
return r;
}
+static bool hdmi_panel_is_detected(struct omap_dss_device *dssdev)
+{
+ return omapdss_hdmi_is_detected(dssdev);
+}
+
static int hdmi_get_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
{
return omapdss_hdmi_get_edid(dssdev, buf, len);
@@ -202,6 +207,7 @@ static struct omap_dss_driver hdmi_driver = {
.disable = hdmi_panel_disable,
.suspend = hdmi_panel_suspend,
.resume = hdmi_panel_resume,
+ .is_detected = hdmi_panel_is_detected,
.get_edid = hdmi_get_edid,
.get_timings = hdmi_get_timings,
.set_timings = hdmi_set_timings,