diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/bridge/dw_hdmi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c index 78363552d80e..b75922d4901e 100644 --- a/drivers/gpu/drm/bridge/dw_hdmi.c +++ b/drivers/gpu/drm/bridge/dw_hdmi.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/hdmi.h> | 18 | #include <linux/hdmi.h> |
19 | #include <linux/mutex.h> | ||
19 | #include <linux/of_device.h> | 20 | #include <linux/of_device.h> |
20 | 21 | ||
21 | #include <drm/drm_of.h> | 22 | #include <drm/drm_of.h> |
@@ -126,6 +127,7 @@ struct dw_hdmi { | |||
126 | struct i2c_adapter *ddc; | 127 | struct i2c_adapter *ddc; |
127 | void __iomem *regs; | 128 | void __iomem *regs; |
128 | 129 | ||
130 | struct mutex audio_mutex; | ||
129 | unsigned int sample_rate; | 131 | unsigned int sample_rate; |
130 | int ratio; | 132 | int ratio; |
131 | 133 | ||
@@ -357,12 +359,16 @@ static void hdmi_set_clk_regenerator(struct dw_hdmi *hdmi, | |||
357 | 359 | ||
358 | static void hdmi_init_clk_regenerator(struct dw_hdmi *hdmi) | 360 | static void hdmi_init_clk_regenerator(struct dw_hdmi *hdmi) |
359 | { | 361 | { |
362 | mutex_lock(&hdmi->audio_mutex); | ||
360 | hdmi_set_clk_regenerator(hdmi, 74250000); | 363 | hdmi_set_clk_regenerator(hdmi, 74250000); |
364 | mutex_unlock(&hdmi->audio_mutex); | ||
361 | } | 365 | } |
362 | 366 | ||
363 | static void hdmi_clk_regenerator_update_pixel_clock(struct dw_hdmi *hdmi) | 367 | static void hdmi_clk_regenerator_update_pixel_clock(struct dw_hdmi *hdmi) |
364 | { | 368 | { |
369 | mutex_lock(&hdmi->audio_mutex); | ||
365 | hdmi_set_clk_regenerator(hdmi, hdmi->hdmi_data.video_mode.mpixelclock); | 370 | hdmi_set_clk_regenerator(hdmi, hdmi->hdmi_data.video_mode.mpixelclock); |
371 | mutex_unlock(&hdmi->audio_mutex); | ||
366 | } | 372 | } |
367 | 373 | ||
368 | /* | 374 | /* |
@@ -1565,6 +1571,8 @@ int dw_hdmi_bind(struct device *dev, struct device *master, | |||
1565 | hdmi->ratio = 100; | 1571 | hdmi->ratio = 100; |
1566 | hdmi->encoder = encoder; | 1572 | hdmi->encoder = encoder; |
1567 | 1573 | ||
1574 | mutex_init(&hdmi->audio_mutex); | ||
1575 | |||
1568 | of_property_read_u32(np, "reg-io-width", &val); | 1576 | of_property_read_u32(np, "reg-io-width", &val); |
1569 | 1577 | ||
1570 | switch (val) { | 1578 | switch (val) { |