kernel: bump 4.19 to 4.19.122
[oweals/openwrt.git] / target / linux / bcm27xx / patches-4.19 / 950-0630-drm-vc4-A-present-but-empty-dmas-disables-audio.patch
1 From 8befbf55f2668a4dae739588ed3c0b0d06fccacd 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 @@ -1099,10 +1099,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