mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 10:29:52 +00:00
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:
@@ -336,6 +336,7 @@ static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
|
|||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
int err;
|
int err;
|
||||||
|
u32 disable_headphones = 0;
|
||||||
|
|
||||||
if (num_channels <= 0 || num_channels > MAX_SUBSTREAMS) {
|
if (num_channels <= 0 || num_channels > MAX_SUBSTREAMS) {
|
||||||
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"))
|
if (!of_property_read_bool(dev->of_node, "brcm,disable-hdmi"))
|
||||||
set_hdmi_enables(dev);
|
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);
|
err = bcm2835_devm_add_vchi_ctx(dev);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
Reference in New Issue
Block a user