1 From 744543757bef8621f7791e28ecb894b2627cb449 Mon Sep 17 00:00:00 2001
2 From: Hristo Venev <hristo@venev.name>
3 Date: Fri, 5 Jun 2020 09:22:49 +0000
4 Subject: [PATCH] snd_bcm2835: disable HDMI audio when vc4 is used
7 Things don't work too well when both the vc4 driver and the firmware
8 driver are trying to control the same audio output:
10 [ 763.569406] bcm2835_audio bcm2835_audio: vchi message timeout, msg=5
12 Hence, when the vc4 HDMI driver is used, let it control audio. This is done
13 by introducing a new device tree property to the audio node, and
14 extending the vc4-kms-v3d overlays to set it appropriately.
16 Signed-off-by: Hristo Venev <hristo@venev.name>
18 arch/arm/boot/dts/overlays/README | 2 ++
19 arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 10 +++++++++-
20 arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts | 8 ++++++++
21 drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 4 +++-
22 4 files changed, 22 insertions(+), 2 deletions(-)
24 --- a/arch/arm/boot/dts/overlays/README
25 +++ b/arch/arm/boot/dts/overlays/README
26 @@ -2745,6 +2745,7 @@ Params: cma-256 CMA is 2
27 cma-size CMA size in bytes, 4MB aligned
28 cma-default Use upstream's default value
29 audio Enable or disable audio over HDMI (default "on")
30 + noaudio Disable all HDMI audio (default "off")
34 @@ -2761,6 +2762,7 @@ Params: cma-256 CMA is 2
36 audio1 Enable or disable audio over HDMI1 (default
38 + noaudio Disable all HDMI audio (default "off")
42 --- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts
43 +++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts
57 + audio = <0>,"!13", <0>,"=14";
58 + noaudio = <0>,"=13", <0>,"!14";
61 --- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts
62 +++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts
77 + noaudio = <0>,"=17", <0>,"=18", <0>,"!19";
80 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
81 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
82 @@ -381,7 +381,9 @@ static int snd_bcm2835_alsa_probe(struct
85 if (!enable_compat_alsa) {
86 - set_hdmi_enables(dev);
87 + if (!of_property_read_bool(dev->of_node, "brcm,disable-hdmi"))
88 + set_hdmi_enables(dev);
90 // In this mode, always enable analog output
91 enable_headphones = true;