kernel: bump 5.4 to 5.4.48
[oweals/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0589-drm-vc4-hdmi-Add-an-audio-support-flag.patch
1 From 6154f7383e2defe48eea7fddb6ce646a0069828b Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 6 Feb 2020 16:21:45 +0100
4 Subject: [PATCH] drm/vc4: hdmi: Add an audio support flag
5
6 The BCM2711 audio support doesn't work yet, so let's add a boolean to
7 indicate whether or not it's supported, and only register a sound card if
8 that boolean is set.
9
10 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
11 ---
12  drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++
13  drivers/gpu/drm/vc4/vc4_hdmi.h | 3 +++
14  2 files changed, 7 insertions(+)
15
16 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
17 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
18 @@ -944,6 +944,9 @@ static int vc4_hdmi_audio_init(struct vc
19         int ret;
20         int len;
21  
22 +       if (!vc4_hdmi->variant->audio_available)
23 +               return 0;
24 +
25         if (!of_find_property(dev->of_node, "dmas", &len) ||
26             len == 0) {
27                 dev_warn(dev,
28 @@ -1444,6 +1447,7 @@ static int vc4_hdmi_dev_remove(struct pl
29  }
30  
31  static const struct vc4_hdmi_variant bcm2835_variant = {
32 +       .audio_available        = true,
33         .registers              = vc4_hdmi_fields,
34         .num_registers          = ARRAY_SIZE(vc4_hdmi_fields),
35  
36 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h
37 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
38 @@ -32,6 +32,9 @@ struct vc4_hdmi_variant {
39          */
40         unsigned int id;
41  
42 +       /* Set to true when the audio support is available */
43 +       bool audio_available;
44 +
45         /* List of the registers available on that variant */
46         const struct vc4_hdmi_register *registers;
47