diff options
author | Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> | 2011-06-22 20:40:10 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-06-22 20:40:10 +0100 |
commit | ae74634232206f55718c3cc3fba84a313e089d9a (patch) | |
tree | f79a4c2a887f5af6d04e95246bde4dd0a9affb11 | |
parent | 8ca943c3aaf85bc0af961c7c160104960d557adb (diff) |
Subject: [PATCH 06/19] 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>
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 19 | ||||
-rw-r--r-- | drivers/video/omap2/dss/hdmi_omap4_panel.c | 12 |
3 files changed, 33 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 8ab6d43329b..42889a1cfda 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -508,6 +508,8 @@ 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 b0555f4f0a7..ed7f1d55116 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -1196,6 +1196,25 @@ 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) + hdmi_read_edid(NULL); + if (!hdmi.edid_set) + return -EINVAL; + memcpy(buf, hdmi.edid, min(len, HDMI_EDID_MAX_LENGTH)); + return 0; +} + int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { diff --git a/drivers/video/omap2/dss/hdmi_omap4_panel.c b/drivers/video/omap2/dss/hdmi_omap4_panel.c index 7d4f2bd7c50..7c787a40bb7 100644 --- a/drivers/video/omap2/dss/hdmi_omap4_panel.c +++ b/drivers/video/omap2/dss/hdmi_omap4_panel.c @@ -143,6 +143,16 @@ 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); +} + static void hdmi_get_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { @@ -197,6 +207,8 @@ 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, .check_timings = hdmi_check_timings, |