Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5290219imm; Tue, 16 Oct 2018 08:05:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV62gB/qOaNttrutTojees48s+MJR1R/rAQGCu1jXIP/Y39WT/+DT1cGH/bBHPq5GadGkZhYf X-Received: by 2002:a63:b95c:: with SMTP id v28-v6mr20453107pgo.221.1539702304729; Tue, 16 Oct 2018 08:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539702304; cv=none; d=google.com; s=arc-20160816; b=SXc4LATu9+9y2HDowg8utkQovULX5kKUXo1S1/T8owdBSMNLiWamxkgwiYsP6n2FAF CDtYVPO/nQBBU69ShNWOQdCOTKnZfHdgfSO5uJDdXtA4TXX2YqX6/FB6aGA3VXTo98C+ SfrN+0lwpLt5qBtS7M1yPwsw3P15HUN9S4PNm9P5PMwP1T4EL/siE6JzMPAqnT2l1j5m t2TU3AX5EthX5f89A0eKe6czHGcMBvqT2/ooJG94EZpz3VIYUABLSb1iHycAdjmjwV2/ Cb3V8GTG4fyk1cQWRvv+uEFev7NSN2dVZHc5ddlBwvd9ckxcUMv2JIMtFnDMCldTgrlB nzcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2Us70D/NSSPyarTGORtR956tsCofGwgFb318rWrbeog=; b=0NJxt45uM8Qjy9iONJxNWLuJocD4hPQGgvWZmMSn36YSmmQjdzE+/qIJ1qL8Zm0UiD rlWlZ07nlY2Vghqhk8N1mfnTmmKT5GrjuhxRebeW7q3Vo93agcbynvgJXCzFjSA84xWz VmM+AxC5PBsfkIpOQQjCtQZf9y6AWSIVwqycdpZbtRa/VgNjbiy7CozLjGRuPhvzGRMl Pgy+keC0IJNiWSQOkqFiIhGbWctGeGGFrh3aKsqEU+ShF2dofBTd5VXqodpT1xMZOwP6 ue3R7TSD4WRRHMDIC2DZd0f9ugu+fIMXl6Y4uVTTbpy0z5yy69+t3ibr47acFuZPyWxh ZvYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17-v6si13898647pgm.317.2018.10.16.08.04.47; Tue, 16 Oct 2018 08:05:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727384AbeJPWyy (ORCPT + 99 others); Tue, 16 Oct 2018 18:54:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:55712 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727323AbeJPWyx (ORCPT ); Tue, 16 Oct 2018 18:54:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3CCDAB07D; Tue, 16 Oct 2018 15:04:01 +0000 (UTC) From: Nicolas Saenz Julienne To: gregkh@linuxfoundation.org Cc: eric@anholt.net, stefan.wahren@i2se.com, linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, tiwai@suse.de, nsaenzjulienne@suse.de Subject: [PATCH 9/9] staging: bcm2835-audio: check for VCHIQ during probe Date: Tue, 16 Oct 2018 17:02:28 +0200 Message-Id: <20181016150228.16994-10-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016150228.16994-1-nsaenzjulienne@suse.de> References: <20181016150228.16994-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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