Skip to content

Commit

Permalink
snd_bcm2835: disable HDMI audio when vc4 is used (#3640)
Browse files Browse the repository at this point in the history
Things don't work too well when both the vc4 driver and the firmware
driver are trying to control the same audio output:

[  763.569406] bcm2835_audio bcm2835_audio: vchi message timeout, msg=5

Hence, when the vc4 HDMI driver is used, let it control audio. This is done
by introducing a new device tree property to the audio node, and
extending the vc4-kms-v3d overlays to set it appropriately.

Signed-off-by: Hristo Venev <[email protected]>
  • Loading branch information
hvenev authored and popcornmix committed Jun 10, 2020
1 parent 0654fb6 commit 46b071e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -2745,6 +2745,7 @@ Params: cma-256 CMA is 256MB (needs 1GB)
cma-size CMA size in bytes, 4MB aligned
cma-default Use upstream's default value
audio Enable or disable audio over HDMI (default "on")
noaudio Disable all HDMI audio (default "off")


Name: vc4-kms-v3d-pi4
Expand All @@ -2761,6 +2762,7 @@ Params: cma-256 CMA is 256MB
"on")
audio1 Enable or disable audio over HDMI1 (default
"on")
noaudio Disable all HDMI audio (default "off")


Name: vga666
Expand Down
10 changes: 9 additions & 1 deletion arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@
};
};

fragment@14 {
target = <&audio>;
__overlay__ {
brcm,disable-hdmi;
};
};

__overrides__ {
audio = <0>,"!13";
audio = <0>,"!13", <0>,"=14";
noaudio = <0>,"=13", <0>,"!14";
};
};
8 changes: 8 additions & 0 deletions arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,16 @@
};
};

fragment@19 {
target = <&audio>;
__overlay__ {
brcm,disable-hdmi;
};
};

__overrides__ {
audio = <0>,"!17";
audio1 = <0>,"!18";
noaudio = <0>,"=17", <0>,"=18", <0>,"!19";
};
};
4 changes: 3 additions & 1 deletion drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
}

if (!enable_compat_alsa) {
set_hdmi_enables(dev);
if (!of_property_read_bool(dev->of_node, "brcm,disable-hdmi"))
set_hdmi_enables(dev);

// In this mode, always enable analog output
enable_headphones = true;
} else {
Expand Down

0 comments on commit 46b071e

Please sign in to comment.