Message ID | 20230322134654.219957-5-herve.codina@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2353197wrt; Wed, 22 Mar 2023 06:54:30 -0700 (PDT) X-Google-Smtp-Source: AK7set+a3nzWR3B8v6Fx12RqrlhAZ0UuKb/a19MQkRV5fYpmRWyTn9EhF960yaiTNuqVFincznXO X-Received: by 2002:a05:6a20:c120:b0:d4:9d94:8e7c with SMTP id bh32-20020a056a20c12000b000d49d948e7cmr5701188pzb.2.1679493270063; Wed, 22 Mar 2023 06:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679493270; cv=none; d=google.com; s=arc-20160816; b=fFgScvOOGbWEkJsPwTfzCuD75HSxwlppNgjP/Nk4fPEtp9V7+/bxZ+RxyuYQsbpJfU w9h+LIRl7gWPII3RA/aayXoQy9+p9pDgybSTwR/BKq0o04zbpP+4CFdFkUkzHfQeCrnM a7cy8yzyKFxQpp1NcPnZLpO5i4vLRcz5RB7+6uNMRPnQuwZ6RGGOW2ec4UcVYf0VWt4w urHVU1ck1xr/QF8Qr1c9Zrw9Spx+5DSWAZgQD2LmgQg+r8JpmkkV6w2pY5tjF/uwuO34 tVOTS3oBd1egSAY8gDqgDlaT/i59x+5WOpIoBX8379zVuMio2ZkNZcLYrhENUkIZh0Tf Q8Yw== 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=VwfPEx0id9lkmTqeXmonqzG+ttziM1BKTuoeNAq8HFk=; b=p3ImzVkl3Hyt6d3N822o6eio8Vn3EjFS4dTa1DTlZkxQOtlCOqg5VclY2zlz1Lsr8t DuIom2dEdjM19xVn/54wUPcnjPwuLVgyqXaz6sFLGCuA5yNFHS6OQf+fepqqPoQkkuXd fftJ363TFeRNREKrVYdLlLblc2RdwpD36fL1QdQJ0YEaTEjouDD4T4pjaMK1IYexLC5Z sK89xgu5tE6XSPZs5ruGDyw8SfJSMQMDOTDUndAa/5ShynqNphLVy3+OeC3JB2BH6Nua 5pZAJNec1oZICX3q7r3otAgM7Hk3eNBzDCpOL0SAQ63pVAJeE4leupHCljty16ogdv/w XGuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=d25XadhU; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a6540cb000000b004df18fa49aesi16079961pgp.796.2023.03.22.06.54.17; Wed, 22 Mar 2023 06:54:30 -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=d25XadhU; 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 S230471AbjCVNre (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Wed, 22 Mar 2023 09:47:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbjCVNrZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Mar 2023 09:47:25 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50DA659E75; Wed, 22 Mar 2023 06:47:19 -0700 (PDT) Received: (Authenticated sender: herve.codina@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 4382320002; Wed, 22 Mar 2023 13:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679492838; 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=VwfPEx0id9lkmTqeXmonqzG+ttziM1BKTuoeNAq8HFk=; b=d25XadhUqVTiT72yzMYftJfPojyWVTfngWDWXxlGdooZE7tDw9U5Z5lOYQbBC81ozu5e3P SRd+WBLyUOnCJAkDxSFl2Sk2DN22HLAgpKuVgk3slglRc7NmFrvYEJwJYk8/KGLxVZ+aq/ 2wH7khKxLSRU4AFiGNdenKJUqt21VrRrrHtLCgfeLhkCPs2YZq5NQUVmey0T7sDphGo+Ud iHjkz/plns1h0tYaeakO6tCUeYSUEto9yBoS90askUVzVKjmJRLKtAXAR2ox5PZrHOkhBW ql7/3H4FNk3nJ3GIzSFQ6pIGtMrU19Ypfo31ocBkaegHpXDmtUuaqLNmW0nugA== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com> Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Christophe Leroy <christophe.leroy@csgroup.eu>, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec Date: Wed, 22 Mar 2023 14:46:52 +0100 Message-Id: <20230322134654.219957-5-herve.codina@bootlin.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230322134654.219957-1-herve.codina@bootlin.com> References: <20230322134654.219957-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761076335439210278?= X-GMAIL-MSGID: =?utf-8?q?1761076335439210278?= |
Series |
Add the Lantiq PEF2256 audio support
|
|
Commit Message
Herve Codina
March 22, 2023, 1:46 p.m. UTC
The Lantiq PEF2256 is a framer and line interface component designed to
fulfill all required interfacing between an analog E1/T1/J1 line and the
digital PCM system highway/H.100 bus.
The codec support allows to use some of the PCM system highway
time-slots as audio channels to transport audio data over the E1/T1/J1
lines.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
.../bindings/sound/lantiq,pef2256-codec.yaml | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Comments
On 22/03/2023 14:46, Herve Codina wrote: > The Lantiq PEF2256 is a framer and line interface component designed to > fulfill all required interfacing between an analog E1/T1/J1 line and the > digital PCM system highway/H.100 bus. > > The codec support allows to use some of the PCM system highway > time-slots as audio channels to transport audio data over the E1/T1/J1 > lines. > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > --- > .../bindings/sound/lantiq,pef2256-codec.yaml | 54 +++++++++++++++++++ > 1 file changed, 54 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > > diff --git a/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > new file mode 100644 > index 000000000000..da35b70cda99 > --- /dev/null > +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > @@ -0,0 +1,54 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Lantiq PEF2256 codec > + > +maintainers: > + - Herve Codina <herve.codina@bootlin.com> > + > +description: | > + Codec support for PEF2256. > + > + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and > + line interface component designed to fulfill all required interfacing between > + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. > + > + The codec support allows to use some of the PCM system highway time-slots as > + audio channels to transport audio data over the E1/T1/J1 lines. > + > + The time-slots used by the codec must be set and so, the properties > + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and > + 'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for > + sub-nodes that involve the codec. The codec uses 8bit time-slots. > + 'dai-tdm-tdm-slot-with' must be set to 8. > + The tx and rx masks define the PEF2256 time-slots assigned to the codec. > + > + The PEF2256 codec node should be a child of a PEF2256 node. > + Refer to the bindings described in > + Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml > + > +allOf: > + - $ref: dai-common.yaml# > + > +properties: > + compatible: > + const: lantiq,pef2256-codec > + > + '#sound-dai-cells': > + const: 0 You do not have here any resources, so the entire binding can be dropped and merged into the parent. Best regards, Krzysztof
Hi Krzysztof On Wed, 22 Mar 2023 22:59:37 +0100 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 22/03/2023 14:46, Herve Codina wrote: > > The Lantiq PEF2256 is a framer and line interface component designed to > > fulfill all required interfacing between an analog E1/T1/J1 line and the > > digital PCM system highway/H.100 bus. > > > > The codec support allows to use some of the PCM system highway > > time-slots as audio channels to transport audio data over the E1/T1/J1 > > lines. > > > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > > --- > > .../bindings/sound/lantiq,pef2256-codec.yaml | 54 +++++++++++++++++++ > > 1 file changed, 54 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > > > > diff --git a/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > > new file mode 100644 > > index 000000000000..da35b70cda99 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > > @@ -0,0 +1,54 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Lantiq PEF2256 codec > > + > > +maintainers: > > + - Herve Codina <herve.codina@bootlin.com> > > + > > +description: | > > + Codec support for PEF2256. > > + > > + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and > > + line interface component designed to fulfill all required interfacing between > > + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. > > + > > + The codec support allows to use some of the PCM system highway time-slots as > > + audio channels to transport audio data over the E1/T1/J1 lines. > > + > > + The time-slots used by the codec must be set and so, the properties > > + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and > > + 'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for > > + sub-nodes that involve the codec. The codec uses 8bit time-slots. > > + 'dai-tdm-tdm-slot-with' must be set to 8. > > + The tx and rx masks define the PEF2256 time-slots assigned to the codec. > > + > > + The PEF2256 codec node should be a child of a PEF2256 node. > > + Refer to the bindings described in > > + Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml > > + > > +allOf: > > + - $ref: dai-common.yaml# > > + > > +properties: > > + compatible: > > + const: lantiq,pef2256-codec > > + > > + '#sound-dai-cells': > > + const: 0 > > You do not have here any resources, so the entire binding can be dropped > and merged into the parent. > > Best regards, > Krzysztof > Ok, Do you expect all these properties (except compatible) merged at the parent level or may I keep a child node with these properties including the compatible property (ie. yaml file merge). Regards, Hervé
On 23/03/2023 08:27, Herve Codina wrote: > Hi Krzysztof > > On Wed, 22 Mar 2023 22:59:37 +0100 > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >> On 22/03/2023 14:46, Herve Codina wrote: >>> The Lantiq PEF2256 is a framer and line interface component designed to >>> fulfill all required interfacing between an analog E1/T1/J1 line and the >>> digital PCM system highway/H.100 bus. >>> >>> The codec support allows to use some of the PCM system highway >>> time-slots as audio channels to transport audio data over the E1/T1/J1 >>> lines. >>> >>> Signed-off-by: Herve Codina <herve.codina@bootlin.com> >>> --- >>> .../bindings/sound/lantiq,pef2256-codec.yaml | 54 +++++++++++++++++++ >>> 1 file changed, 54 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml >>> >>> diff --git a/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml >>> new file mode 100644 >>> index 000000000000..da35b70cda99 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml >>> @@ -0,0 +1,54 @@ >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Lantiq PEF2256 codec >>> + >>> +maintainers: >>> + - Herve Codina <herve.codina@bootlin.com> >>> + >>> +description: | >>> + Codec support for PEF2256. >>> + >>> + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and >>> + line interface component designed to fulfill all required interfacing between >>> + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. >>> + >>> + The codec support allows to use some of the PCM system highway time-slots as >>> + audio channels to transport audio data over the E1/T1/J1 lines. >>> + >>> + The time-slots used by the codec must be set and so, the properties >>> + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and >>> + 'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for >>> + sub-nodes that involve the codec. The codec uses 8bit time-slots. >>> + 'dai-tdm-tdm-slot-with' must be set to 8. >>> + The tx and rx masks define the PEF2256 time-slots assigned to the codec. >>> + >>> + The PEF2256 codec node should be a child of a PEF2256 node. >>> + Refer to the bindings described in >>> + Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml >>> + >>> +allOf: >>> + - $ref: dai-common.yaml# >>> + >>> +properties: >>> + compatible: >>> + const: lantiq,pef2256-codec >>> + >>> + '#sound-dai-cells': >>> + const: 0 >> >> You do not have here any resources, so the entire binding can be dropped >> and merged into the parent. >> >> Best regards, >> Krzysztof >> > > Ok, > Do you expect all these properties (except compatible) merged at the parent You have only two properties here - dai cells and name-prefix... > level or may I keep a child node with these properties including the > compatible property (ie. yaml file merge). I was thinking that these should be merged into parent because usually you do not need child node for this. However now I started to think how the codec driver would look like. Essentially the parent MFD driver would need to register dais... Best regards, Krzysztof
On Thu, 23 Mar 2023 08:31:28 +0100 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 23/03/2023 08:27, Herve Codina wrote: > > Hi Krzysztof > > > > On Wed, 22 Mar 2023 22:59:37 +0100 > > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > > >> On 22/03/2023 14:46, Herve Codina wrote: > >>> The Lantiq PEF2256 is a framer and line interface component designed to > >>> fulfill all required interfacing between an analog E1/T1/J1 line and the > >>> digital PCM system highway/H.100 bus. > >>> > >>> The codec support allows to use some of the PCM system highway > >>> time-slots as audio channels to transport audio data over the E1/T1/J1 > >>> lines. > >>> > >>> Signed-off-by: Herve Codina <herve.codina@bootlin.com> > >>> --- > >>> .../bindings/sound/lantiq,pef2256-codec.yaml | 54 +++++++++++++++++++ > >>> 1 file changed, 54 insertions(+) > >>> create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > >>> > >>> diff --git a/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > >>> new file mode 100644 > >>> index 000000000000..da35b70cda99 > >>> --- /dev/null > >>> +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > >>> @@ -0,0 +1,54 @@ > >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >>> +%YAML 1.2 > >>> +--- > >>> +$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml# > >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >>> + > >>> +title: Lantiq PEF2256 codec > >>> + > >>> +maintainers: > >>> + - Herve Codina <herve.codina@bootlin.com> > >>> + > >>> +description: | > >>> + Codec support for PEF2256. > >>> + > >>> + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and > >>> + line interface component designed to fulfill all required interfacing between > >>> + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. > >>> + > >>> + The codec support allows to use some of the PCM system highway time-slots as > >>> + audio channels to transport audio data over the E1/T1/J1 lines. > >>> + > >>> + The time-slots used by the codec must be set and so, the properties > >>> + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and > >>> + 'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for > >>> + sub-nodes that involve the codec. The codec uses 8bit time-slots. > >>> + 'dai-tdm-tdm-slot-with' must be set to 8. > >>> + The tx and rx masks define the PEF2256 time-slots assigned to the codec. > >>> + > >>> + The PEF2256 codec node should be a child of a PEF2256 node. > >>> + Refer to the bindings described in > >>> + Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml > >>> + > >>> +allOf: > >>> + - $ref: dai-common.yaml# > >>> + > >>> +properties: > >>> + compatible: > >>> + const: lantiq,pef2256-codec > >>> + > >>> + '#sound-dai-cells': > >>> + const: 0 > >> > >> You do not have here any resources, so the entire binding can be dropped > >> and merged into the parent. > >> > >> Best regards, > >> Krzysztof > >> > > > > Ok, > > Do you expect all these properties (except compatible) merged at the parent > > You have only two properties here - dai cells and name-prefix... > > > level or may I keep a child node with these properties including the > > compatible property (ie. yaml file merge). > > I was thinking that these should be merged into parent because usually > you do not need child node for this. However now I started to think how > the codec driver would look like. Essentially the parent MFD driver > would need to register dais... > There is also something specific to audio, the slots definition 'dai-tdm-slot-tx-mask' and 'dai-tdm-slot-rx-mask'. These slots definitions are set at the ALSA sound card sub-nodes. So, I can have multiple codec in the PEF2256. For instance: framer { compatible = "lantiq,pef2256", "simple-mfd"; ... pef2256_codec0: codec0 { compatible = "lantiq,pef2256-codec"; #sound-dai-cells = <0>; }; pef2256_codec1: codec1 { compatible = "lantiq,pef2256-codec"; #sound-dai-cells = <0>; }; }; sound { compatible = "simple-audio-card"; #address-cells = <1>; #size-cells = <0>; simple-audio-card,dai-link@0 { /* CPU DAI1 - pef2256 codec 1 */ reg = <0>; cpu { sound-dai = <&cpu_dai1>; }; codec { sound-dai = <&pef2256_codec0>; dai-tdm-slot-num = <4>; dai-tdm-slot-width = <8>; /* TS 2, 3, 4, 5 */ dai-tdm-slot-tx-mask = <0 1 1 1 1>; dai-tdm-slot-rx-mask = <0 1 1 1 1>; }; simple-audio-card,dai-link@1 { /* CPU DAI2 - pef2256 codec 2 */ reg = <1>; cpu { sound-dai = <&cpu_dai2>; }; codec { sound-dai = <&pef2256_codec1>; dai-tdm-slot-num = <4>; dai-tdm-slot-width = <8>; /* TS 6, 7, 8, 9 */ dai-tdm-slot-tx-mask = <0 0 0 0 0 1 1 1 1>; dai-tdm-slot-rx-mask = <0 0 0 0 0 1 1 1 1>; }; }; }; To solve this, I can use #sound-dai-cells = <1>; but this will complicate the driver itself and is it really needed ? Having "simple-mfd" dans sub-nodes keep all things simple. Regards, Hervé
On 23/03/2023 09:10, Herve Codina wrote: > On Thu, 23 Mar 2023 08:31:28 +0100 > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >> On 23/03/2023 08:27, Herve Codina wrote: >>> Hi Krzysztof >>> >>> On Wed, 22 Mar 2023 22:59:37 +0100 >>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: >>> >>>> On 22/03/2023 14:46, Herve Codina wrote: >>>>> The Lantiq PEF2256 is a framer and line interface component designed to >>>>> fulfill all required interfacing between an analog E1/T1/J1 line and the >>>>> digital PCM system highway/H.100 bus. >>>>> >>>>> The codec support allows to use some of the PCM system highway >>>>> time-slots as audio channels to transport audio data over the E1/T1/J1 >>>>> lines. >>>>> >>>>> Signed-off-by: Herve Codina <herve.codina@bootlin.com> >>>>> --- >>>>> .../bindings/sound/lantiq,pef2256-codec.yaml | 54 +++++++++++++++++++ >>>>> 1 file changed, 54 insertions(+) >>>>> create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml >>>>> new file mode 100644 >>>>> index 000000000000..da35b70cda99 >>>>> --- /dev/null >>>>> +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml >>>>> @@ -0,0 +1,54 @@ >>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>>>> +%YAML 1.2 >>>>> +--- >>>>> +$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml# >>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>>>> + >>>>> +title: Lantiq PEF2256 codec >>>>> + >>>>> +maintainers: >>>>> + - Herve Codina <herve.codina@bootlin.com> >>>>> + >>>>> +description: | >>>>> + Codec support for PEF2256. >>>>> + >>>>> + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and >>>>> + line interface component designed to fulfill all required interfacing between >>>>> + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. >>>>> + >>>>> + The codec support allows to use some of the PCM system highway time-slots as >>>>> + audio channels to transport audio data over the E1/T1/J1 lines. >>>>> + >>>>> + The time-slots used by the codec must be set and so, the properties >>>>> + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and >>>>> + 'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for >>>>> + sub-nodes that involve the codec. The codec uses 8bit time-slots. >>>>> + 'dai-tdm-tdm-slot-with' must be set to 8. >>>>> + The tx and rx masks define the PEF2256 time-slots assigned to the codec. >>>>> + >>>>> + The PEF2256 codec node should be a child of a PEF2256 node. >>>>> + Refer to the bindings described in >>>>> + Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml >>>>> + >>>>> +allOf: >>>>> + - $ref: dai-common.yaml# >>>>> + >>>>> +properties: >>>>> + compatible: >>>>> + const: lantiq,pef2256-codec >>>>> + >>>>> + '#sound-dai-cells': >>>>> + const: 0 >>>> >>>> You do not have here any resources, so the entire binding can be dropped >>>> and merged into the parent. >>>> >>>> Best regards, >>>> Krzysztof >>>> >>> >>> Ok, >>> Do you expect all these properties (except compatible) merged at the parent >> >> You have only two properties here - dai cells and name-prefix... >> >>> level or may I keep a child node with these properties including the >>> compatible property (ie. yaml file merge). >> >> I was thinking that these should be merged into parent because usually >> you do not need child node for this. However now I started to think how >> the codec driver would look like. Essentially the parent MFD driver >> would need to register dais... >> > > There is also something specific to audio, the slots definition > 'dai-tdm-slot-tx-mask' and 'dai-tdm-slot-rx-mask'. These slots definitions > are set at the ALSA sound card sub-nodes. > So, I can have multiple codec in the PEF2256. > > For instance: > framer { > compatible = "lantiq,pef2256", "simple-mfd"; > ... > pef2256_codec0: codec0 { > compatible = "lantiq,pef2256-codec"; > #sound-dai-cells = <0>; > }; > pef2256_codec1: codec1 { > compatible = "lantiq,pef2256-codec"; > #sound-dai-cells = <0>; > }; > }; Then include it in the example. It would cut short this discussion. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file mode 100644 index 000000000000..da35b70cda99 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Lantiq PEF2256 codec + +maintainers: + - Herve Codina <herve.codina@bootlin.com> + +description: | + Codec support for PEF2256. + + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and + line interface component designed to fulfill all required interfacing between + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. + + The codec support allows to use some of the PCM system highway time-slots as + audio channels to transport audio data over the E1/T1/J1 lines. + + The time-slots used by the codec must be set and so, the properties + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and + 'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for + sub-nodes that involve the codec. The codec uses 8bit time-slots. + 'dai-tdm-tdm-slot-with' must be set to 8. + The tx and rx masks define the PEF2256 time-slots assigned to the codec. + + The PEF2256 codec node should be a child of a PEF2256 node. + Refer to the bindings described in + Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml + +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + const: lantiq,pef2256-codec + + '#sound-dai-cells': + const: 0 + +required: + - compatible + - '#sound-dai-cells' + +unevaluatedProperties: false + +examples: + - | + codec { + compatible = "lantiq,pef2256-codec"; + #sound-dai-cells = <0>; + };