]> git.karo-electronics.de Git - linux-beck.git/commitdiff
OMAPDSS: HDMI: use core power on/off with edid & detect
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 19 Oct 2012 14:42:27 +0000 (17:42 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 29 Oct 2012 10:44:41 +0000 (12:44 +0200)
This patch makes use of the hdmi_power_[on|off]_core() functions added
in the previous patch. The functions are used when reading EDID or
detecting if a monitor is connected.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ricardo Neri <ricardo.neri@ti.com>
drivers/video/omap2/dss/dss.h
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/hdmi_panel.c

index d614fda9275ce5b4923a0b55992054c24e106eb1..ff7a55b54b8e6e3d03b61a58e3e70c11ab0452cd 100644 (file)
@@ -509,6 +509,8 @@ static inline unsigned long hdmi_get_pixel_clock(void)
 #endif
 int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
 void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
+int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev);
+void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev);
 void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
                struct omap_video_timings *timings);
 int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
index 1226044e55082dbd02c5042ac35b28e0c76ceab3..81b9fc48295f7c5993d7ac810c5ef919ce63cca5 100644 (file)
@@ -759,6 +759,41 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
        mutex_unlock(&hdmi.lock);
 }
 
+int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev)
+{
+       int r = 0;
+
+       DSSDBG("ENTER omapdss_hdmi_core_enable\n");
+
+       mutex_lock(&hdmi.lock);
+
+       hdmi.ip_data.hpd_gpio = hdmi.hpd_gpio;
+
+       r = hdmi_power_on_core(dssdev);
+       if (r) {
+               DSSERR("failed to power on device\n");
+               goto err0;
+       }
+
+       mutex_unlock(&hdmi.lock);
+       return 0;
+
+err0:
+       mutex_unlock(&hdmi.lock);
+       return r;
+}
+
+void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev)
+{
+       DSSDBG("Enter omapdss_hdmi_core_disable\n");
+
+       mutex_lock(&hdmi.lock);
+
+       hdmi_power_off_core(dssdev);
+
+       mutex_unlock(&hdmi.lock);
+}
+
 static int hdmi_get_clocks(struct platform_device *pdev)
 {
        struct clk *clk;
index 3f9a4b947a54ce4efdcf4da40dc3299e2954163a..a385b69a018e665fba418ebc68d7611a2f5a8e57 100644 (file)
@@ -334,7 +334,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
        need_enable = dssdev->state == OMAP_DSS_DISPLAY_DISABLED;
 
        if (need_enable) {
-               r = omapdss_hdmi_display_enable(dssdev);
+               r = omapdss_hdmi_core_enable(dssdev);
                if (r)
                        goto err;
        }
@@ -342,7 +342,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
        r = omapdss_hdmi_read_edid(buf, len);
 
        if (need_enable)
-               omapdss_hdmi_display_disable(dssdev);
+               omapdss_hdmi_core_disable(dssdev);
 err:
        mutex_unlock(&hdmi.lock);
 
@@ -359,7 +359,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
        need_enable = dssdev->state == OMAP_DSS_DISPLAY_DISABLED;
 
        if (need_enable) {
-               r = omapdss_hdmi_display_enable(dssdev);
+               r = omapdss_hdmi_core_enable(dssdev);
                if (r)
                        goto err;
        }
@@ -367,7 +367,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
        r = omapdss_hdmi_detect();
 
        if (need_enable)
-               omapdss_hdmi_display_disable(dssdev);
+               omapdss_hdmi_core_disable(dssdev);
 err:
        mutex_unlock(&hdmi.lock);