OMAP: DSS2: HDMI: make set_timing saner
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 22 Aug 2011 11:57:33 +0000 (14:57 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 30 Sep 2011 13:16:44 +0000 (16:16 +0300)
Currently the set_timings code for hdmi is quite strange. The display is
disabled in hdmi_omap4_panel.c before setting timings, and enabled in
hdmi.c after setting the timings. Furthermore, the timings were not
permanent, and disabling and enabling the display would lose them.

This patch makes the set_timings handling a bit better.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/hdmi_panel.c

index 06a78b2ab690885352e9bd19cce746e9111e7dd3..f503aa495b2f5ddad59deef9208a7db8791d16b4 100644 (file)
@@ -571,11 +571,20 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev)
        struct hdmi_cm cm;
 
        hdmi.custom_set = 1;
+
        cm = hdmi_get_code(&dssdev->panel.timings);
        hdmi.code = cm.code;
        hdmi.mode = cm.mode;
-       omapdss_hdmi_display_enable(dssdev);
-       hdmi.custom_set = 0;
+
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
+               int r;
+
+               hdmi_power_off(dssdev);
+
+               r = hdmi_power_on(dssdev);
+               if (r)
+                       DSSERR("failed to power on device\n");
+       }
 }
 
 int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
index e30182f5fecfc50c58a29e4e2c1cb780225bd65d..8c851e624ee645ea4596d0971b9642e0d6bdee85 100644 (file)
@@ -161,12 +161,7 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev,
        mutex_lock(&hdmi.hdmi_lock);
 
        dssdev->panel.timings = *timings;
-
-       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
-               /* turn the hdmi off and on to get new timings to use */
-               omapdss_hdmi_display_disable(dssdev);
-               omapdss_hdmi_display_set_timing(dssdev);
-       }
+       omapdss_hdmi_display_set_timing(dssdev);
 
        mutex_unlock(&hdmi.hdmi_lock);
 }