84b044eb63766c2b81963b54b7078e5d85f93f07
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0281-drm-vc4-A-present-but-empty-dmas-disables-audio.patch
1 From 88d5709082671ff2abeddc2a9b4acacbb85b9194 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 31 Jul 2019 17:36:34 +0100
4 Subject: [PATCH] drm/vc4: A present but empty dmas disables audio
5
6 Overlays are unable to remove properties in the base DTB, but they
7 can overwrite them. Allow a present but empty 'dmas' property
8 to also disable the HDMI audio interface.
9
10 See: https://github.com/raspberrypi/linux/issues/2489
11
12 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
13 ---
14 drivers/gpu/drm/vc4/vc4_hdmi.c | 6 ++++--
15 1 file changed, 4 insertions(+), 2 deletions(-)
16
17 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
18 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
19 @@ -1054,10 +1054,12 @@ static int vc4_hdmi_audio_init(struct vc
20 struct device *dev = &hdmi->pdev->dev;
21 const __be32 *addr;
22 int ret;
23 + int len;
24
25 - if (!of_find_property(dev->of_node, "dmas", NULL)) {
26 + if (!of_find_property(dev->of_node, "dmas", &len) ||
27 + len == 0) {
28 dev_warn(dev,
29 - "'dmas' DT property is missing, no HDMI audio\n");
30 + "'dmas' DT property is missing or empty, no HDMI audio\n");
31 return 0;
32 }
33