Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8092174rwd; Tue, 20 Jun 2023 10:03:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45HJvdvstSJjBPlufiDPifp6wtYwkmZYub08r1qGuih9gWigcoxYfHdUCLTN1RZvuvsokL X-Received: by 2002:a05:6a00:1309:b0:64d:42b9:6895 with SMTP id j9-20020a056a00130900b0064d42b96895mr27216911pfu.5.1687280583888; Tue, 20 Jun 2023 10:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687280583; cv=none; d=google.com; s=arc-20160816; b=LzNIu+q4hsUmO1JBYjRmam+DySMy0KGPLePrwie672u9ld1sLDJka4xI0ZiVugSPMs /+L++J5NmibKUXBYCCyTCwWWkx/We4TrRqpPv0bdcsdI6xARqktudfouHmA6SLFasyTO 7MDUr+a6rlz8x5qUvpSk1bfQAb3UQKwjjAitPssJliLC2fUvayk5YYAFNemgCoCYJPnc tvI0z0ds/iHL8s10N4+Ij8grxStfwd5JK1j/KfZblpqMy+p0jpABBqq5lI1ExA4iYD1+ f/y51jtYU2GJjtIwhFoxAl/zlK39g7GnW78yJs2dgFExMGZhJ0RSbZpIRXkTYEBoZXro OeyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Y9XOGuLGXhqBdh/SPGk4WJ2DXvEFR2a4aPquV+OWA5g=; b=jUedCovMxnHVEO6th+bmxSSf/hi0xIjmcvktotB0ERvkFckdnoqols2A40Lu9ZR8Uh a9hai64fqbvwloI+OOn//IuybM2QYvDTxXTp3uavJAC4vgVVdGw911xJXNeW3x7ri41K 6a2RKB//dB+dDYyqHGRM62rJqHzRx6lTSE+nFMDnzKRfYnp/j/ynczDn7d/sp4/WYggx 613M3hnfn3oophFGW9U41jE+5MqGinu2edahF5fu/SbKowKC7YA9RJiDmVgSwZPtotty MUxm5JVkhwjuFj4m423MFCeyRLJ4ddh6cklWr5VpgUigRXb3AwD0eVBwIGutJwizSsf4 poSg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a63eb45000000b0055727399652si345115pgk.577.2023.06.20.10.02.48; Tue, 20 Jun 2023 10:03:03 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbjFTQp1 (ORCPT + 99 others); Tue, 20 Jun 2023 12:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbjFTQp0 (ORCPT ); Tue, 20 Jun 2023 12:45:26 -0400 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FF141A1; Tue, 20 Jun 2023 09:45:25 -0700 (PDT) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-77e4126badcso50286339f.0; Tue, 20 Jun 2023 09:45:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687279524; x=1689871524; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Y9XOGuLGXhqBdh/SPGk4WJ2DXvEFR2a4aPquV+OWA5g=; b=OxmprRRQyd3HJzPawBTuv1y4Fkfrn3m2LyfQ2Yqvq06HHx7Lt9tb8O2k2IVrLNzz7Z L4Dv/G7YrMyzGa0CWNXV7dlmQeW1dFPc3VuVj7iuP0lErxMzrZZMwXlNkhj2vqxld8+L Jr1arEjExhJ+VPOAd1fW/4CpYsp5Nbtex9NhPF3OMHVocxQ/qR6716KK3Uv6ZITDYR2Y VD6N3S+zZWiyO0i+oDXXQrJF/b+dIOjJA8yHPZVOkhBxbXSuhi0y3xG/jvbsVr9Jhwt9 PRTpfeJ/pLx2xLvfSPSXwRcUX49Z6TwjAdIeVwu2QyMkSVKCNDP4MJEFGtjfWWWFbH2U uqYg== X-Gm-Message-State: AC+VfDzUSyj8P7RUS2AafBWeD3WEU7hhJYWGS7S5wyz0sBNfQkMivJ6v sbcWi7gKpD559RymKBFkWw== X-Received: by 2002:a05:6e02:152d:b0:340:7bba:85b4 with SMTP id i13-20020a056e02152d00b003407bba85b4mr8982202ilu.8.1687279524383; Tue, 20 Jun 2023 09:45:24 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id v2-20020a92c6c2000000b0033bc3a3ea39sm683618ilm.70.2023.06.20.09.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 09:45:23 -0700 (PDT) Received: (nullmailer pid 3798817 invoked by uid 1000); Tue, 20 Jun 2023 16:45:21 -0000 Date: Tue, 20 Jun 2023 10:45:21 -0600 From: Rob Herring To: Herve Codina 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: <20230620164521.GA3789188-robh@kernel.org> References: <20230615152631.224529-1-herve.codina@bootlin.com> <20230615152631.224529-3-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230615152631.224529-3-herve.codina@bootlin.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 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? > 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 >