aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorJassi Brar <jaswinder.singh@linaro.org>2012-06-27 10:04:56 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-06-29 02:42:42 -0400
commit3a5383a2373fd5bc5ebdd781c8ac89ab5d0cb8a4 (patch)
treef568116f7c39ee62ab42ab745946d55b48703cd6 /drivers/video
parentece2f1539e917a4f23c30c2cca41ed5aa127abe3 (diff)
OMAPDSS: HDMI: Replace spinlock with mutex in hdmi_check_hpd_state
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/hdmi.c1
-rw-r--r--drivers/video/omap2/dss/ti_hdmi.h1
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c7
3 files changed, 4 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index b07e16bc4527..fb834abc5c2e 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -758,6 +758,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
758 hdmi.ip_data.core_av_offset = HDMI_CORE_AV; 758 hdmi.ip_data.core_av_offset = HDMI_CORE_AV;
759 hdmi.ip_data.pll_offset = HDMI_PLLCTRL; 759 hdmi.ip_data.pll_offset = HDMI_PLLCTRL;
760 hdmi.ip_data.phy_offset = HDMI_PHY; 760 hdmi.ip_data.phy_offset = HDMI_PHY;
761 mutex_init(&hdmi.ip_data.lock);
761 762
762 hdmi_panel_init(); 763 hdmi_panel_init();
763 764
diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h
index d174ca128932..cc292b829c9d 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -177,6 +177,7 @@ struct hdmi_ip_data {
177 177
178 /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */ 178 /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */
179 int hpd_gpio; 179 int hpd_gpio;
180 struct mutex lock;
180}; 181};
181int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data); 182int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
182void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data); 183void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index 3fa3d98d1ae7..49b171b1f4ae 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -235,13 +235,10 @@ void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data)
235 235
236static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data) 236static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data)
237{ 237{
238 unsigned long flags;
239 bool hpd; 238 bool hpd;
240 int r; 239 int r;
241 /* this should be in ti_hdmi_4xxx_ip private data */
242 static DEFINE_SPINLOCK(phy_tx_lock);
243 240
244 spin_lock_irqsave(&phy_tx_lock, flags); 241 mutex_lock(&ip_data->lock);
245 242
246 hpd = gpio_get_value(ip_data->hpd_gpio); 243 hpd = gpio_get_value(ip_data->hpd_gpio);
247 244
@@ -257,7 +254,7 @@ static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data)
257 } 254 }
258 255
259err: 256err:
260 spin_unlock_irqrestore(&phy_tx_lock, flags); 257 mutex_unlock(&ip_data->lock);
261 return r; 258 return r;
262} 259}
263 260