staging: bcm2835-audio: Add disable-headphones flag

Add a property to allow the headphone output to be disabled. Use an
integer property rather than a boolean so that an overlay can clear it.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2020-10-26 10:23:22 +00:00
committed by Dom Cobley
parent 1438bedfa8
commit ee90e47d88

View File

@@ -336,6 +336,7 @@ static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
int err;
u32 disable_headphones = 0;
if (num_channels <= 0 || num_channels > MAX_SUBSTREAMS) {
num_channels = MAX_SUBSTREAMS;
@@ -346,6 +347,11 @@ static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
if (!of_property_read_bool(dev->of_node, "brcm,disable-hdmi"))
set_hdmi_enables(dev);
of_property_read_u32(dev->of_node,
"brcm,disable-headphones",
&disable_headphones);
enable_headphones = !disable_headphones;
err = bcm2835_devm_add_vchi_ctx(dev);
if (err)
return err;