lkml.org 
[lkml]   [2018]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 9/9] staging: bcm2835-audio: check for VCHIQ during probe
Date
The audio data is sent to rpi's VideoCore IV trough VCHIQ. We make sure
it's available and that we fail gracefully in case it isn't there.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
index 039565311d10..f4b19a4a974b 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
@@ -294,9 +294,19 @@ static int snd_add_child_devices(struct device *device, u32 numchans)
static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
+ struct device_node *fw_node;
u32 numchans;
int err;

+ fw_node = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-vchiq");
+ if (!fw_node) {
+ dev_err(&pdev->dev, "no vchiq firmware node\n");
+ return -ENODEV;
+ }
+
+ if (!vchi_ready(fw_node))
+ return -EPROBE_DEFER;
+
err = of_property_read_u32(dev->of_node, "brcm,pwm-channels",
&numchans);
if (err) {
--
2.19.1
\
 
 \ /
  Last update: 2018-10-16 17:05    [W:0.073 / U:1.072 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site