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
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
10 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
12 drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++
13 drivers/gpu/drm/vc4/vc4_hdmi.h | 3 +++
14 2 files changed, 7 insertions(+)
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
22 + if (!vc4_hdmi->variant->audio_available)
25 if (!of_find_property(dev->of_node, "dmas", &len) ||
28 @@ -1445,6 +1448,7 @@ static int vc4_hdmi_dev_remove(struct pl
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),
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 {
42 + /* Set to true when the audio support is available */
43 + bool audio_available;
45 /* List of the registers available on that variant */
46 const struct vc4_hdmi_register *registers;