]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
OMAPDSS: HDMI: Replace spinlock with mutex in hdmi_check_hpd_state
authorJassi Brar <jaswinder.singh@linaro.org>
Wed, 27 Jun 2012 14:04:56 +0000 (19:34 +0530)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 29 Jun 2012 06:42:42 +0000 (09:42 +0300)
State change of HDMI PHY could potentially take many millisecs, we can do
better by protecting things in hdmi_set_phy_pwr() with a mutex rather than
a spin_lock_irqsave.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/ti_hdmi.h
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c

index b07e16bc452795d1b31d2249220f8cdc8204b713..fb834abc5c2ec0bd85431648f160938d2d883086 100644 (file)
@@ -758,6 +758,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
        hdmi.ip_data.core_av_offset = HDMI_CORE_AV;
        hdmi.ip_data.pll_offset = HDMI_PLLCTRL;
        hdmi.ip_data.phy_offset = HDMI_PHY;
+       mutex_init(&hdmi.ip_data.lock);
 
        hdmi_panel_init();
 
index d174ca12893236c3ef873b16050897f3bc3e481d..cc292b829c9d2dafcdf92ff11f59fdc8e4962d48 100644 (file)
@@ -177,6 +177,7 @@ struct hdmi_ip_data {
 
        /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */
        int hpd_gpio;
+       struct mutex lock;
 };
 int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
 void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
index 3fa3d98d1ae76bc622dfff5256018b6185616eff..49b171b1f4ae66d315570fb866ba64aac1a4ac69 100644 (file)
@@ -235,13 +235,10 @@ void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data)
 
 static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data)
 {
-       unsigned long flags;
        bool hpd;
        int r;
-       /* this should be in ti_hdmi_4xxx_ip private data */
-       static DEFINE_SPINLOCK(phy_tx_lock);
 
-       spin_lock_irqsave(&phy_tx_lock, flags);
+       mutex_lock(&ip_data->lock);
 
        hpd = gpio_get_value(ip_data->hpd_gpio);
 
@@ -257,7 +254,7 @@ static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data)
        }
 
 err:
-       spin_unlock_irqrestore(&phy_tx_lock, flags);
+       mutex_unlock(&ip_data->lock);
        return r;
 }