Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2334790rwd; Wed, 14 Jun 2023 01:03:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bnNrKWAJDer4IhIEBK/IVDktfY3LLCWigJF9fj06y+qrnKouMvfiJHkraIt0TQIxEDQ0+ X-Received: by 2002:a05:6a00:16cc:b0:646:9232:df6 with SMTP id l12-20020a056a0016cc00b0064692320df6mr1553389pfc.33.1686729814053; Wed, 14 Jun 2023 01:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686729814; cv=none; d=google.com; s=arc-20160816; b=jE6fNgVDGDwEfhne7xIaeSHnoVACqMeJu7P9bfTk+1UxxXizTsJAysoXrGKbRTLLRB syK20h8QptULHol29WxbOrBUo7qpx2aQ/QLYA514C92l1SxoWVq2cXzgrYw3RxdAxBaw Lx0Skr2W32Zm5qsNTBFnNNrjjbqne5Cx7I/vIcJ1qhneyJpxQGg5q7eY6zdFG98L5vmQ iPkD3Z/yvvjvL1m7IPNq13K1dtTz9rKP95dM2/Q7RJmEfN2B3aVWnClxz1yKDDOUWxt/ xaDIeFY6tbfX0E86uVqpnPjZIWjXgwwizEDB6LOcNmxdan9PeDtBNptbBY7lDuuOIN+m 4fNA== 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=Ec9QmzV7xFVi3Aacgabibi4bTW5c+oEym4noV+pQMtHYEJF1VXQg5hmAOLCN0d/njK WTZbRd59ms/HtYAspcm3onLMVLO5HFSOlGkw4CgykF4Ml6bU/vmwSxbvxgXzeprfiylF nU5Rrt0A7XwsFq3HbNvBY/pYSI7B76Mtaovu0RpR4IBDjoggqKjDBZJDAXRNQQ6GSMda prNyEAKs3OSKNu4gZX/Bv5L02Sy0QeYfOLc0Yspxzp6F8ir0h+oa6ZnYhJpQ8hvKfawa G4EpmLoZKrew5yg/DHytRwkIhuMYcaWmCPRbMm01kE3TXE+SggmnIC3Fu8VTD/5CmgNI 2dlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="bp/L3mDY"; 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 m29-20020a63711d000000b00502f4fd0c16si7090487pgc.653.2023.06.14.01.03.21; Wed, 14 Jun 2023 01:03:34 -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="bp/L3mDY"; 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 S243434AbjFNHtl (ORCPT + 99 others); Wed, 14 Jun 2023 03:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243066AbjFNHte (ORCPT ); Wed, 14 Jun 2023 03:49:34 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5D46170E; Wed, 14 Jun 2023 00:49:31 -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=1686728970; 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=bp/L3mDYJD0nORz8aM+ayzwsonaK5n4v4rtNVz9nKMSKsLrSSkUipHXdZ1mY43QoU+uFdm 3fnhRBylAXt0Nvz+D++gKyQNwk+J8kQ2nrQM6umRSysGq5Zi7pPE5gEP3nzglXWOAJgGy3 x3YDU+CkxIUjiWvMZ9yHisfbc9cMOkOi2AX6q0W5okEJvtsSS2/5SZywuec0PUezO4pbXX QTyGlH0y43NW/fK0ssYDUEUGiCUvyTNBvWfpM3+Z6BxNpFzXH0PYiVzQ+yciIEcdoHtxCF gvslU6pr8uWxnraOlODA5IEYNr7Qg7OYqSMZd2LqCGKwDPR1LsdE28bkV6F1gA== 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 E09851C0019; Wed, 14 Jun 2023 07:49:28 +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 v4 02/13] ASoC: dt-bindings: simple-card: Add additional-devs subnode Date: Wed, 14 Jun 2023 09:48:53 +0200 Message-Id: <20230614074904.29085-3-herve.codina@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230614074904.29085-1-herve.codina@bootlin.com> References: <20230614074904.29085-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,URIBL_BLOCKED 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