Commit 3a5383a2 authored by Jassi Brar's avatar Jassi Brar Committed by Tomi Valkeinen

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: default avatarJassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent ece2f153
...@@ -758,6 +758,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) ...@@ -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.core_av_offset = HDMI_CORE_AV;
hdmi.ip_data.pll_offset = HDMI_PLLCTRL; hdmi.ip_data.pll_offset = HDMI_PLLCTRL;
hdmi.ip_data.phy_offset = HDMI_PHY; hdmi.ip_data.phy_offset = HDMI_PHY;
mutex_init(&hdmi.ip_data.lock);
hdmi_panel_init(); hdmi_panel_init();
......
...@@ -177,6 +177,7 @@ struct hdmi_ip_data { ...@@ -177,6 +177,7 @@ struct hdmi_ip_data {
/* ti_hdmi_4xxx_ip private data. These should be in a separate struct */ /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */
int hpd_gpio; int hpd_gpio;
struct mutex lock;
}; };
int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data); int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data); void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
......
...@@ -235,13 +235,10 @@ void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data) ...@@ -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) static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data)
{ {
unsigned long flags;
bool hpd; bool hpd;
int r; 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); hpd = gpio_get_value(ip_data->hpd_gpio);
...@@ -257,7 +254,7 @@ static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data) ...@@ -257,7 +254,7 @@ static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data)
} }
err: err:
spin_unlock_irqrestore(&phy_tx_lock, flags); mutex_unlock(&ip_data->lock);
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment