Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5472943rwd; Mon, 12 Jun 2023 05:46:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4l25a+++ZuNAvHsYmuspu0urywmceqoMHy8ebEjdDzKmVG5lJ2ypaYRL4aQlCpTsdd7+Et X-Received: by 2002:aa7:c0d2:0:b0:514:3e1:239c with SMTP id j18-20020aa7c0d2000000b0051403e1239cmr4886119edp.42.1686574013970; Mon, 12 Jun 2023 05:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686574013; cv=none; d=google.com; s=arc-20160816; b=k0qkwtNaBgNTmss3yAW+r8BOt7T5GdBNhyIYgLb4roaohlISzD40fIHkEGgd4YUjE0 h0Ncdp9QYWF9xN9wJ1DT/xWsAotllP2hFw43iVEFT3QQCcn4cDXONluSJTG8om8bGbYg YMNvgg4GtDO52yyz/e+BZo6KngIwqaYf3tM5k72f/HYkQOL+IJED56lqv9G93q33A6D+ Vb3Vze85aKUzisSPv5P1q+uK8rXMJChcjknNgUFIU2DweewXwwYhV4EaAv62XiJfQA/0 jmxO1YpFN1qDFNfTDzSfzg1+/rqsG/mS3Eit7scotBZJkPTt0SXKJ1gFXNiwC0PLddVH b/MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5N9NSA3ycLJUSucfBk1k0lUH03RfOeo/UXNYngARjpo=; b=I5cNp+GgB7yUfLoJLPaXuDCyt6LLwDyt7j0qhTt+FTrFRQLmTDTuQ6ZF8dqozANPHD tm3aYvL3yhQsQ5s3B3Gxqb/yY2InMUeMydbj5TFsEUE80nwxbUvaSQR7GM2+1incFAz9 NwGoMTTpbVuEQwauU9bQEUQujVhNdFMQTIxO4Op5iz6Us0NIlQg3QpCwxY26oiviPF+5 bdLStvJNTktdEDjpharp5C5T6biH2/fv+WjwC3Ut1mFQShxNSHEWKTQVOOHf6qMJK3SJ 7g8XzisNioEb+/ETNqHT1T21DcTtoCjeuKijcMEmiY5BDkzUDrDU2hNzLBIcIrWdyV8n BZPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YGKZRu7k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a05640210d500b005163008c6b9si5515607edu.655.2023.06.12.05.46.29; Mon, 12 Jun 2023 05:46:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YGKZRu7k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233867AbjFLMaL (ORCPT + 99 others); Mon, 12 Jun 2023 08:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjFLMaB (ORCPT ); Mon, 12 Jun 2023 08:30:01 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC551B8; Mon, 12 Jun 2023 05:29:59 -0700 (PDT) X-GND-Sasl: herve.codina@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686572998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5N9NSA3ycLJUSucfBk1k0lUH03RfOeo/UXNYngARjpo=; b=YGKZRu7kczGFyQhYuKljB2H0wcRlSjCvrJZD4Qt0DkQMhhwcwYyKzpVCyOiSfd3DUbq1dA owP7TbiaJxnSfH3BxuJjA2hBU1KnPzVQrAjGXk6ZpqcISmaJY+Vby6UV/n43ekKfT8Y00s JSoPUt86Nc2LGk+pMT1Lo7cMFpx+zFlPoNqHOHJEArYidq3hEcNydXzLK+BPbwpnHCBaPi 7Sr0d9LJ73yLetnEHdtS/mEDtI7LMP8BRAx+/ZK3Fjn10OoEeMXTeXBUmMLV+ad4Xmg7WZ BmLCeKt2lu9csLU2P/+zQlHhqEHWdKiono4xRrViTOUDbsKfgmEvR/qdiQe3nA== X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com X-GND-Sasl: herve.codina@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 1036424000C; Mon, 12 Jun 2023 12:29:57 +0000 (UTC) From: Herve Codina To: Herve Codina , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , Lars-Peter Clausen , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto , Andy Shevchenko Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Christophe Leroy , Thomas Petazzoni Subject: [PATCH v3 02/12] ASoC: dt-bindings: simple-card: Add additional-devs subnode Date: Mon, 12 Jun 2023 14:29:16 +0200 Message-Id: <20230612122926.107333-3-herve.codina@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230612122926.107333-1-herve.codina@bootlin.com> References: <20230612122926.107333-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The additional-devs subnode allows to declared some virtual devices as sound card children. These virtual devices can then be used by the sound card and so be present in the audio path. The first virtual device supported is the audio IIO auxiliary device in order to support an IIO device as an audio auxiliary device. Signed-off-by: Herve Codina --- .../bindings/sound/simple-card.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/simple-card.yaml b/Documentation/devicetree/bindings/sound/simple-card.yaml index b05e05c81cc4..59ac2d1d1ccf 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.yaml +++ b/Documentation/devicetree/bindings/sound/simple-card.yaml @@ -148,6 +148,15 @@ definitions: required: - sound-dai + additional-devs: + type: object + description: + Additional devices used by the simple audio card. + patternProperties: + '^iio-aux(-.+)?$': + type: object + $ref: audio-iio-aux.yaml# + properties: compatible: contains: @@ -187,6 +196,8 @@ properties: $ref: "#/definitions/mclk-fs" simple-audio-card,aux-devs: $ref: "#/definitions/aux-devs" + simple-audio-card,additional-devs: + $ref: "#/definitions/additional-devs" simple-audio-card,convert-rate: $ref: "#/definitions/convert-rate" simple-audio-card,convert-channels: @@ -359,6 +370,48 @@ examples: }; }; +# -------------------- +# route audio to/from a codec through an amplifier +# designed with a potentiometer driven by IIO: +# -------------------- + - | + sound { + compatible = "simple-audio-card"; + + simple-audio-card,aux-devs = <&_in>, <&_out>; + simple-audio-card,routing = + "CODEC LEFTIN", "AMP_IN LEFT OUT", + "CODEC RIGHTIN", "AMP_IN RIGHT OUT", + "AMP_OUT LEFT IN", "CODEC LEFTOUT", + "AMP_OUT RIGHT IN", "CODEC RIGHTOUT"; + + simple-audio-card,additional-devs { + amp_out: iio-aux-out { + compatible = "audio-iio-aux"; + io-channels = <&pot_out 0>, <&pot_out 1>; + io-channel-names = "LEFT", "RIGHT"; + snd-control-invert-range = <1 1>; + sound-name-prefix = "AMP_OUT"; + }; + + amp_in: iio_aux-in { + compatible = "audio-iio-aux"; + io-channels = <&pot_in 0>, <&pot_in 1>; + io-channel-names = "LEFT", "RIGHT"; + sound-name-prefix = "AMP_IN"; + }; + }; + + simple-audio-card,cpu { + sound-dai = <&cpu>; + }; + + simple-audio-card,codec { + sound-dai = <&codec>; + clocks = <&clocks>; + }; + }; + # -------------------- # Sampling Rate Conversion # -------------------- -- 2.40.1