Commit 882a0644 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Inki Dae

drm/exynos/hdmi: remove private lock code

Most of the code is called by drm core framework, so it is already synchronized.
The only async function is irq routine which only calls drm framework so it
does not need to be synchronized.
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Reviewed-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent ef6ce28b
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "regs-hdmi.h" #include "regs-hdmi.h"
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -188,7 +187,6 @@ struct hdmi_context { ...@@ -188,7 +187,6 @@ struct hdmi_context {
struct drm_encoder *encoder; struct drm_encoder *encoder;
bool powered; bool powered;
bool dvi_mode; bool dvi_mode;
struct mutex hdmi_mutex;
void __iomem *regs; void __iomem *regs;
int irq; int irq;
...@@ -1774,10 +1772,8 @@ static void hdmi_conf_apply(struct hdmi_context *hdata) ...@@ -1774,10 +1772,8 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)
hdmiphy_conf_reset(hdata); hdmiphy_conf_reset(hdata);
hdmiphy_conf_apply(hdata); hdmiphy_conf_apply(hdata);
mutex_lock(&hdata->hdmi_mutex);
hdmi_start(hdata, false); hdmi_start(hdata, false);
hdmi_conf_init(hdata); hdmi_conf_init(hdata);
mutex_unlock(&hdata->hdmi_mutex);
hdmi_audio_init(hdata); hdmi_audio_init(hdata);
...@@ -2029,12 +2025,8 @@ static void hdmi_commit(struct exynos_drm_display *display) ...@@ -2029,12 +2025,8 @@ static void hdmi_commit(struct exynos_drm_display *display)
{ {
struct hdmi_context *hdata = display_to_hdmi(display); struct hdmi_context *hdata = display_to_hdmi(display);
mutex_lock(&hdata->hdmi_mutex); if (!hdata->powered)
if (!hdata->powered) {
mutex_unlock(&hdata->hdmi_mutex);
return; return;
}
mutex_unlock(&hdata->hdmi_mutex);
hdmi_conf_apply(hdata); hdmi_conf_apply(hdata);
} }
...@@ -2043,16 +2035,11 @@ static void hdmi_poweron(struct hdmi_context *hdata) ...@@ -2043,16 +2035,11 @@ static void hdmi_poweron(struct hdmi_context *hdata)
{ {
struct hdmi_resources *res = &hdata->res; struct hdmi_resources *res = &hdata->res;
mutex_lock(&hdata->hdmi_mutex); if (hdata->powered)
if (hdata->powered) {
mutex_unlock(&hdata->hdmi_mutex);
return; return;
}
hdata->powered = true; hdata->powered = true;
mutex_unlock(&hdata->hdmi_mutex);
pm_runtime_get_sync(hdata->dev); pm_runtime_get_sync(hdata->dev);
if (regulator_bulk_enable(res->regul_count, res->regul_bulk)) if (regulator_bulk_enable(res->regul_count, res->regul_bulk))
...@@ -2073,10 +2060,8 @@ static void hdmi_poweroff(struct hdmi_context *hdata) ...@@ -2073,10 +2060,8 @@ static void hdmi_poweroff(struct hdmi_context *hdata)
{ {
struct hdmi_resources *res = &hdata->res; struct hdmi_resources *res = &hdata->res;
mutex_lock(&hdata->hdmi_mutex);
if (!hdata->powered) if (!hdata->powered)
goto out; return;
mutex_unlock(&hdata->hdmi_mutex);
/* HDMI System Disable */ /* HDMI System Disable */
hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN); hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN);
...@@ -2096,11 +2081,7 @@ static void hdmi_poweroff(struct hdmi_context *hdata) ...@@ -2096,11 +2081,7 @@ static void hdmi_poweroff(struct hdmi_context *hdata)
pm_runtime_put_sync(hdata->dev); pm_runtime_put_sync(hdata->dev);
mutex_lock(&hdata->hdmi_mutex);
hdata->powered = false; hdata->powered = false;
out:
mutex_unlock(&hdata->hdmi_mutex);
} }
static void hdmi_dpms(struct exynos_drm_display *display, int mode) static void hdmi_dpms(struct exynos_drm_display *display, int mode)
...@@ -2330,8 +2311,6 @@ static int hdmi_probe(struct platform_device *pdev) ...@@ -2330,8 +2311,6 @@ static int hdmi_probe(struct platform_device *pdev)
hdata->display.type = EXYNOS_DISPLAY_TYPE_HDMI; hdata->display.type = EXYNOS_DISPLAY_TYPE_HDMI;
hdata->display.ops = &hdmi_display_ops; hdata->display.ops = &hdmi_display_ops;
mutex_init(&hdata->hdmi_mutex);
platform_set_drvdata(pdev, hdata); platform_set_drvdata(pdev, hdata);
match = of_match_node(hdmi_match_types, dev->of_node); match = of_match_node(hdmi_match_types, dev->of_node);
......
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