From patchwork Wed Aug 19 09:15:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11723317 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2058C618 for ; Wed, 19 Aug 2020 09:18:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8E3A20639 for ; Wed, 19 Aug 2020 09:18:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="OnCEKARu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="hLDIQWoB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8E3A20639 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 32F981813; Wed, 19 Aug 2020 11:17:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 32F981813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1597828722; bh=SJY8rABm3iHip6ruNiiRRpzvPv1UBlF/9DEgEvR6sD0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OnCEKARuac/qZvRylaxGSmiuostX49YaSd4RM7hL5NSVOMQDw8HXXiU9knQKLwjWF Gpyw0+1KY3oEv9ot3x5ICSFxNsTxa8oL/KmHCGuKPH1DOrmxERhV0PbaLClvd1lm2F Uwu7K3ikynTEE34GbRnLja/GyNSIlnqf6/cH0LaI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CF49FF8025A; Wed, 19 Aug 2020 11:17:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 02E2BF80260; Wed, 19 Aug 2020 11:17:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AFE3BF80255 for ; Wed, 19 Aug 2020 11:17:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AFE3BF80255 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="hLDIQWoB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1597828620; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=QF9pEdpob/aapYjgmPjRf6gK63aNdtYCv2gYZ1UtYsQ=; b=hLDIQWoB6MS1V4NvBrlJsSrKq7dWawvTqhDnhjzJGX9aihpcaVBW1xsIgfgR+NF/vp KURKdWEjeqC+zBJKnpzc+07i9VnYHJomvO4m3G1Gkv3+5zOHlEI+P9RMn34Y0y2/HajC AyEz0OkQ3BOkhrr13gjRk7Q4tZxyccpM6gEGulU2mwW+mtRzhc/phFU01Piqoe3SKUZq Bjezhg7gf9R1rFr1bEGVmNa5aiSRi/VrlYRQQq8GTLZ6SbXrDm+E7Q70OZQtP8TArqoC 6xw8G/+0e7TImFDaDuhfVe/oMOzOudlFSTPzEJglCJvWa6YiHoUH17fxuyGBZg8FRwTt Fg1A== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6NDwQo" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w7J9Gt0ST (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 19 Aug 2020 11:16:55 +0200 (CEST) From: Stephan Gerhold To: Mark Brown Subject: [PATCH 1/2] ASoC: dt-bindings: qcom: Document "aux-devs" property Date: Wed, 19 Aug 2020 11:15:32 +0200 Message-Id: <20200819091533.2334-2-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200819091533.2334-1-stephan@gerhold.net> References: <20200819091533.2334-1-stephan@gerhold.net> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Banajit Goswami , Stephan Gerhold , linux-arm-msm@vger.kernel.org, Patrick Lai , Liam Girdwood , Rob Herring , Srinivas Kandagatla X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" In some cases we need to probe additional audio components that do not appear as part of the DAI links specified in the device tree. Examples for this are auxiliary devices such as analog amplifiers or codecs. To make them work they need to be added as part of "aux-devs" and connected to some other audio component using the audio routes configurable using "(qcom,)audio-routing". Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold --- .../devicetree/bindings/sound/qcom,apq8016-sbc.txt | 7 +++++++ Documentation/devicetree/bindings/sound/qcom,apq8096.txt | 8 ++++++++ Documentation/devicetree/bindings/sound/qcom,sdm845.txt | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt b/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt index 84b28dbe9f15..23998262a0a7 100644 --- a/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt +++ b/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt @@ -34,6 +34,13 @@ Required properties: * DMIC * Ext Spk +Optional properties: + +- aux-devs : A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "qcom,audio-routing". + Dai-link subnode properties and subnodes: Required dai-link subnodes: diff --git a/Documentation/devicetree/bindings/sound/qcom,apq8096.txt b/Documentation/devicetree/bindings/sound/qcom,apq8096.txt index c814e867850f..248df5056fec 100644 --- a/Documentation/devicetree/bindings/sound/qcom,apq8096.txt +++ b/Documentation/devicetree/bindings/sound/qcom,apq8096.txt @@ -55,6 +55,14 @@ This binding describes the APQ8096 sound card, which uses qdsp for audio. Value type: Definition: The user-visible name of this sound card. +- aux-devs + Usage: optional + Value type: + Definition: A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "audio-routing". + = dailinks Each subnode of sndcard represents either a dailink, and subnodes of each dailinks would be cpu/codec/platform dais. diff --git a/Documentation/devicetree/bindings/sound/qcom,sdm845.txt b/Documentation/devicetree/bindings/sound/qcom,sdm845.txt index ca8c89e88bfa..3d5cbe953cf7 100644 --- a/Documentation/devicetree/bindings/sound/qcom,sdm845.txt +++ b/Documentation/devicetree/bindings/sound/qcom,sdm845.txt @@ -24,6 +24,14 @@ This binding describes the SDM845 sound card, which uses qdsp for audio. Value type: Definition: The user-visible name of this sound card. +- aux-devs + Usage: optional + Value type: + Definition: A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "audio-routing". + = dailinks Each subnode of sndcard represents either a dailink, and subnodes of each dailinks would be cpu/codec/platform dais. From patchwork Wed Aug 19 09:15:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11723319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17B0F739 for ; Wed, 19 Aug 2020 09:19:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C9B820639 for ; Wed, 19 Aug 2020 09:19:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="bCH1zANJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="hrRCfeuE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C9B820639 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 277721834; Wed, 19 Aug 2020 11:18:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 277721834 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1597828770; bh=tJSP5OFOrmLv72YyzMbpihFggnmPdL4eX4KmW6kGvHA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bCH1zANJPBwc9+YoJYBoCFLEOxNmnVvx+2k/+zAbhbyo24oKrwmyCJCDZvMtbfAt3 MZ8oIKCe9ayjaAX1FNe16IbVlWDjYWRVAerp9RhBDJCF2IfappGHFk70gE9qxNXedK qwW3yPCOhzEz/ZksBKF6oNfKZWMPmfCd8tt0Wj+U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C4F2EF802A8; Wed, 19 Aug 2020 11:17:15 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BF666F802A9; Wed, 19 Aug 2020 11:17:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6B21AF8011C for ; Wed, 19 Aug 2020 11:17:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6B21AF8011C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="hrRCfeuE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1597828623; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=O63GLG7sddoCYObzLYc9FbVF3AO3J5EaI5KdyvqBGk8=; b=hrRCfeuEGj9Vq4pUDteVYUJXQSA86fFdNkl+ixrqTG+R5p584BN5I33Wp56Og75LCB kZuLxujJNiU7NONi6VcGnnZuAAsn7SvdcYSAkosGjqLEnkWvl5Y3xVWJ0VHEXYV9llNT eDCjuitbQEAbLML5Tz1jAC9jsp2qil84P5BMYsAfSVRf8HySbHax+LuXL0Ua+doMpMg2 oTlC55JO9I5X5hoduuIzFfdpmGmZeLmcY6Tii7fW9IboftJRq9a8PdNg3FFoGcaqIZGF 81sPGBMl5zDgLghoTfzK9Vq014p+w3JAEajmqPDjAuS/WwQ/Vr7JwQ7cXnHQ61NFflqY +nAA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6NDwQo" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w7J9Gu0SU (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 19 Aug 2020 11:16:56 +0200 (CEST) From: Stephan Gerhold To: Mark Brown Subject: [PATCH 2/2] ASoC: qcom: common: Parse auxiliary devices from device tree Date: Wed, 19 Aug 2020 11:15:33 +0200 Message-Id: <20200819091533.2334-3-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200819091533.2334-1-stephan@gerhold.net> References: <20200819091533.2334-1-stephan@gerhold.net> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Banajit Goswami , Stephan Gerhold , linux-arm-msm@vger.kernel.org, Patrick Lai , Liam Girdwood , Rob Herring , Srinivas Kandagatla X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" In some cases we need to probe additional audio components that do not appear as part of the DAI links specified in the device tree. Examples for this are auxiliary devices such as analog amplifiers or codecs. The ASoC core provides a way to probe these components by adding them to snd_soc_card->aux_dev. We can use the snd_soc_of_parse_aux_devs() function to parse them from the device tree. As an example for this, some MSM8916 smartphones have an analog speaker amplifier connected to the HPHR output. With the new property this can be modelled as follows: speaker-amp: audio-amplifier { compatible = "simple-audio-amplifier"; enable-gpios = <&msmgpio 114 GPIO_ACTIVE_HIGH>; sound-name-prefix = "Speaker Amp"; }; &sound { aux-devs = <&speaker_amp>; audio-routing = "Speaker Amp IN", "HPHR"; }; Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold --- sound/soc/qcom/common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index 5194d90ddb96..fe6e778c31c0 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -39,6 +39,10 @@ int qcom_snd_parse_of(struct snd_soc_card *card) return ret; } + ret = snd_soc_of_parse_aux_devs(card, "aux-devs"); + if (ret) + return ret; + /* Populate links */ num_links = of_get_child_count(dev->of_node);