Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9014338rwd; Wed, 21 Jun 2023 01:40:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iU8/dBNGAIj0cV+UzFYV2q4GvwDnSOMiDe18qzPq0RjH+UNNPQ1ayRb0lrzAfQydRtI7T X-Received: by 2002:a17:902:8489:b0:1b3:d357:5ea6 with SMTP id c9-20020a170902848900b001b3d3575ea6mr12910879plo.53.1687336839136; Wed, 21 Jun 2023 01:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687336839; cv=none; d=google.com; s=arc-20160816; b=VUnFm283KjSgRceFHDcq/L39d1dUnH2ddOIi/hX1AfFveJKPOFFn5zrC4VC4bmHy3z AICgHrukTRmX/myRzl0HHnu3iqyVnti7lQ4ttu1e3ZD2fPy/XkCHUU4FpgGOk56YCQ/a huYRV14UtCGMwZADP1BjfUtfZXfzt9WuB+R8FOGR9AHpHAuPf5B+TOwonGMenuUVKBYH bYTI2e2//zj64CAZZxdCfbwT8KnQf2C0VDW3pE4QCqIv2bbtaWWCk+WgtloRmQnnS7sj r3cb7zTFEFE28hwTwpDcJEKxx3OrWTFhciOFI/saD7YFKWCed1pCvtDW9lW7eh8/pVmT AuuQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=WYtqxR//h5o3fcMngi/YGGEQl12cFL95TkWLUIHTxSw=; b=I7vakMlrpdxhfISJawblIMaqDwP/HtuyGnDL0gHyc+NbsvFxQfznVlm//5f+KRlHeh 3Rw6taVGtHLEQYtWYQBI5SvGR2jEnOoHIg5suE4tHPq+axatKrf4qpmXza0VhKXP1jxO hqtoM2oETR2V+uMm8DccLRBrNFzVJ6yj9TyshcD6Vn3ba0+goUuXrCmkOiIA3TjVhmoc dvPSpq/U9oQXFo4E7Md4DZgRumqs5avb1WcqLoB/5V4fhqEkC7uWNCnnOYrat3v5EB9+ kLh6gTGPIyd4IDSt1+fG4HnGq+BiNzWo93NCyjLVzHY9krXscmPjeDNTHT3nFFsqtMKz n4Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SgudXOqm; 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 i1-20020a170902c94100b001b676f312a8si3793529pla.440.2023.06.21.01.40.26; Wed, 21 Jun 2023 01:40:39 -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=SgudXOqm; 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 S230031AbjFUIGm (ORCPT + 99 others); Wed, 21 Jun 2023 04:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbjFUIGk (ORCPT ); Wed, 21 Jun 2023 04:06:40 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75BEC19A2; Wed, 21 Jun 2023 01:06:25 -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=1687334783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WYtqxR//h5o3fcMngi/YGGEQl12cFL95TkWLUIHTxSw=; b=SgudXOqmAUvHeu4Jo3eLRfZ1fN2zhpb2s2JmooflnVq4jwsIFIoXRIaxuN23vxaILTt3Do CGki7lB5WuwItvsGgzokEFaiwHTF1MFaHNEbJ5Rj2SCmtGrW41IBSmy8EL8EOKI4fUsu64 JUzZxmEFw6a5mediCQXKrRThbcQExL5Qgj+Wu5YzVbkZ/9e9W9zMG5trHILycqU8NZvOc3 Ig14PDS7aCqu6HKYRJ7HkLg4q1vsGAFTmKKbNN1x3wwO5toJi72p8psxqHtpAb0tpReRlZ bnLJA0nAyGADD0pCG5WmgyNReUWUcMCVwat4VJ99IenkWCevR6MhQTnStmjGyQ== 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 ESMTPSA id 9ED9D6000A; Wed, 21 Jun 2023 08:06:21 +0000 (UTC) Date: Wed, 21 Jun 2023 10:06:20 +0200 From: Herve Codina To: Rob Herring Cc: Liam Girdwood , Mark Brown , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , Lars-Peter Clausen , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto , Andy Shevchenko , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Christophe Leroy , Thomas Petazzoni Subject: Re: [PATCH v5 02/13] ASoC: dt-bindings: simple-card: Add additional-devs subnode Message-ID: <20230621100620.0666ae29@bootlin.com> In-Reply-To: <20230620164521.GA3789188-robh@kernel.org> References: <20230615152631.224529-1-herve.codina@bootlin.com> <20230615152631.224529-3-herve.codina@bootlin.com> <20230620164521.GA3789188-robh@kernel.org> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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_PASS, 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 Hi Rob, On Tue, 20 Jun 2023 10:45:21 -0600 Rob Herring wrote: > On Thu, Jun 15, 2023 at 05:26:20PM +0200, Herve Codina wrote: > > 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" > > Why do you need this under the card node? Can't you just use the > existing aux-devs? aux-devs is a phandle array referencing auxiliary devices. I cannot define a node with just aux-devs, just reference. I need device auxiliary devices that are not defined somewhere else in the DT. A SPI amplifier is defined as a subnode of a SPI controler. But my IIO/ASoC virtual devices are not defined under some hardware bus. I need to define them here, as a simple-audio-card subnode. Several subnodes are already defined for a simple-audio-card subnode for other purpose. Instead of having virtual device nodes directly as chidren mixed with the other purpose nodes of the simple-audio-card, I group them under the additional-devs node in order to ease evolution and maintenance. Best regards, Hervé > > > 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 > > -- Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com