OMAPDSS: HDMI: Add locking for hdmi interface set timing functions
authorArchit Taneja <archit@ti.com>
Tue, 14 Aug 2012 19:10:31 +0000 (00:40 +0530)
committerArchit Taneja <archit@ti.com>
Wed, 15 Aug 2012 10:18:23 +0000 (15:48 +0530)
The hdmi interface driver exposes functions to the hdmi panel driver to
configure the interface timings maintained by the hdmi driver.

These timings(stored in hdmi.ip_data.cfg) should be protected by the hdmi lock
to ensure they are called sequentially, this is similar to how hdmi enable and
disable functions need locking.

Signed-off-by: Archit Taneja <archit@ti.com>
drivers/video/omap2/dss/hdmi.c

index 964a19500c0e696a53d5145c80fc0e825ede08fe..0cdf24673d48d74050ac56a72b08556bd1777151 100644 (file)
@@ -561,6 +561,8 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
        struct hdmi_cm cm;
        const struct hdmi_config *t;
 
+       mutex_lock(&hdmi.lock);
+
        cm = hdmi_get_code(timings);
        hdmi.ip_data.cfg.cm = cm;
 
@@ -579,6 +581,8 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
        } else {
                dss_mgr_set_timings(dssdev->manager, &t->timings);
        }
+
+       mutex_unlock(&hdmi.lock);
 }
 
 static void hdmi_dump_regs(struct seq_file *s)