Message ID | 20230316122741.577663-6-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 j10csp453223wrt; Thu, 16 Mar 2023 05:31:23 -0700 (PDT) X-Google-Smtp-Source: AK7set/dcYlJ4lPUQe2sBAinSB7170Ca1pBODMsdLZEkD3GXxzorhQv400V3h31zo/n9+XqUOfrt X-Received: by 2002:a05:6a20:1d6:b0:d6:97e8:c3ec with SMTP id 22-20020a056a2001d600b000d697e8c3ecmr3336504pzz.44.1678969883191; Thu, 16 Mar 2023 05:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678969883; cv=none; d=google.com; s=arc-20160816; b=Wf3IYM1ZcmgMUom3cPBxdolAjJsXylvwdjmVrCScOwFlPO2kTxkFVUSYYbGGt+siqj Nm9HY/jQuz40zDXFoKpiQlbGXnwofF25J2anfj3LrHzOO/3/8CwZG+oxy8ZBggbWIuom G4EFSUpx7znyqjJyQ8IsxHNJeQK9b0lSDt5iYz4Ulv1NAB2IUrai1TbdJ9Wv/K7Q5Ewn kPb15bqjzof/foBTPH59Eiv1SnzfvLiC1CMUcnxigK7hMPMjhGOF4dRZOam9J7VkRKTB BPBEl4Rlivf3OLSFuBRvFq4WPELD5N+D6K9ZrV7zye0ppAOWtNHSqrc6Wv3G4QjyXNz9 doGA== 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=nSK6QmzgFgboixiIAQGzqWb/rCb1DitwrXgQXi+UVkQ=; b=ZXQc3XtSD+36HqULfKl9+f8BtJVAMXq1SJg+6vLSFSjnjpKjMCSuAYT+6JZrbSrBc1 ht9MM3qeOVeR/v82Avgy1Yl8YplKWdcZH9j98Yvipye5oXBF6U1CIkvA+DqZCBqPc7ld 1bH3UleRcmtYs/lxM9U1s6lu+m0YP4VPZV/3DnLG6BTC13GrCXQ0ickAUbxDcoEN2nTT W4D+zXpW3X6gvV8GHP5X/0Vt5VmGuYlPINuDyioHQ6edQtKdDe5456osmczRVnknMddg pidTrZSzZbj/22Jc/fHrThlR2ha/zaER8wr9qFbz3CwUdVCXDjfH0MWExvBo3VU0/WUv wEeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Nbi7TrkL; 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 v10-20020a63f20a000000b0050be719abc9si3312224pgh.167.2023.03.16.05.31.06; Thu, 16 Mar 2023 05:31:23 -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=Nbi7TrkL; 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 S230306AbjCPM2X (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Thu, 16 Mar 2023 08:28:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbjCPM2I (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Mar 2023 08:28:08 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62E4BBB27; Thu, 16 Mar 2023 05:28:05 -0700 (PDT) Received: (Authenticated sender: herve.codina@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 99B131BF213; Thu, 16 Mar 2023 12:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678969684; 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=nSK6QmzgFgboixiIAQGzqWb/rCb1DitwrXgQXi+UVkQ=; b=Nbi7TrkLkYJVMDTy7OyTKmYnRLxHrnx4sCdvuefGXrQkz7tjz9ZGk1Yiv4POn8l8J2Z4PL KsmdLKcxC64YiJKkbx7oKXF5LDWaYWPz9sWgK+ZExCqGchCF4Yei07leAanl68MUavJz0u RmTefd4l5Ooa0ukzfh/RFHRm5VN0G4hu9krzH0sPz0xhkuQlCZcoyNJDgmYwIlpudR1wzY XV+SKwlffdNMRuSp5pTWbiPvCK5JT5rN5wwIbm2bf7EMYwLjipUEnK8CYxYgpzIijSEywI x6DvWbaddlUh07zBVg5x8uHC0O9nPeq0dhhUP/ckGRwDIEj1BGST03skyeR3eA== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Derek Kiernan <derek.kiernan@xilinx.com>, Dragan Cvetic <dragan.cvetic@xilinx.com>, Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.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 v2 5/7] dt-bindings: sound: Add support for the Lantiq PEF2256 codec Date: Thu, 16 Mar 2023 13:27:39 +0100 Message-Id: <20230316122741.577663-6-herve.codina@bootlin.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230316122741.577663-1-herve.codina@bootlin.com> References: <20230316122741.577663-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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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: <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?1760527524712485922?= X-GMAIL-MSGID: =?utf-8?q?1760527524712485922?= |
Series |
Add the Lantiq PEF2256 audio support
|
|
Commit Message
Herve Codina
March 16, 2023, 12:27 p.m. UTC
The Lantiq PEF2256, also known as Infineon PEF2256 or FALC256, 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 | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Comments
On 16/03/2023 13:27, Herve Codina wrote: > The Lantiq PEF2256, also known as Infineon PEF2256 or FALC256, 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. > Your other file should also have specific compatible, unless this codec is actually part of the framer. Did not look like this in the binding - not $ref. > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > --- > .../bindings/sound/lantiq,pef2256-codec.yaml | 57 +++++++++++++++++++ > 1 file changed, 57 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..acba3a0ccd1b > --- /dev/null > +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > @@ -0,0 +1,57 @@ > +# 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 device Drop "device". Everything is "device". > + > +maintainers: > + - Herve Codina <herve.codina@bootlin.com> > + > +description: | > + Codec support for PEF2256. > + > + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC256, 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. > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > + - $ref: dai-common.yaml# > + > +properties: > + compatible: > + const: lantiq,pef2256-codec > + > + lantiq,pef2256: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + phandle to the PEF2256 Why not its child? Why this is in parallel ? > + > + '#sound-dai-cells': > + const: 0 > + Best regards, Krzysztof
Hi Krzysztof On Fri, 17 Mar 2023 09:57:11 +0100 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 16/03/2023 13:27, Herve Codina wrote: > > The Lantiq PEF2256, also known as Infineon PEF2256 or FALC256, 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. > > > > Your other file should also have specific compatible, unless this codec > is actually part of the framer. Did not look like this in the binding - > not $ref. No sure to understand what you mean. Anyway, I plan to use a MFD device for pef2256 and reference this yaml from the lantiq,pef2256.yaml in the node related to the codec. One question related to bindings and related checks: Is there a way to check the compatible property of the parent node. I mean, here is the binding of a child node of a MFD node. From this binding, I would like to be sure that the parent is really a pef2256 MFD node. May be something like: parent-properties: allOf: compatible: contains: const: lantiq,pef2256 The idea is to have dtbs_check raise an error if the parent's compatible property is not 'lantiq,pef2256'. From parent, the link is checked using: properties: codec: $ref: /schemas/sound/lantiq,pef2256-codec.yaml but nothing prevent to use this 'lantiq,pef2256-codec' binding from a node that has nothing to do with pef2256. > > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > > --- > > .../bindings/sound/lantiq,pef2256-codec.yaml | 57 +++++++++++++++++++ > > 1 file changed, 57 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..acba3a0ccd1b > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml > > @@ -0,0 +1,57 @@ > > +# 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 device > > Drop "device". Everything is "device". Will be dropped in v3 series. > > > + > > +maintainers: > > + - Herve Codina <herve.codina@bootlin.com> > > + > > +description: | > > + Codec support for PEF2256. > > + > > + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC256, 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. > > + > > +allOf: > > + - $ref: /schemas/spi/spi-peripheral-props.yaml# Oups, This device is not on a SPI bus -> will be dropped in v3 series. > > + - $ref: dai-common.yaml# > > + > > +properties: > > + compatible: > > + const: lantiq,pef2256-codec > > + > > + lantiq,pef2256: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: > > + phandle to the PEF2256 > > Why not its child? Why this is in parallel ? Indeed, I will move to MFD, remove this phandle and use the lantiq,pef2256-codec node as a child node of lantiq,pef2256. > > > + > > + '#sound-dai-cells': > > + const: 0 > > + > > > Best regards, > Krzysztof > Thanks for the review, Best regards, Hervé
On 20/03/2023 19:17, Herve Codina wrote: > Hi Krzysztof > > On Fri, 17 Mar 2023 09:57:11 +0100 > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >> On 16/03/2023 13:27, Herve Codina wrote: >>> The Lantiq PEF2256, also known as Infineon PEF2256 or FALC256, 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. >>> >> >> Your other file should also have specific compatible, unless this codec >> is actually part of the framer. Did not look like this in the binding - >> not $ref. > > No sure to understand what you mean. Compatible "lantiq,pef2256" in the context of this file is confusing. Two devices without parent-child having similar but different compatibles, of which one is generic (covers entire device) and one is function (codec) specific. > > Anyway, I plan to use a MFD device for pef2256 and reference this yaml > from the lantiq,pef2256.yaml in the node related to the codec. It should be part of these series. Submit complete bindings. > > One question related to bindings and related checks: > Is there a way to check the compatible property of the parent node. > I mean, here is the binding of a child node of a MFD node. > From this binding, I would like to be sure that the parent is really a > pef2256 MFD node. You cannot and you shouldn't. Parent checks children, not vice-versa. > > May be something like: > parent-properties: > allOf: > compatible: > contains: > const: lantiq,pef2256 > > The idea is to have dtbs_check raise an error if the parent's compatible > property is not 'lantiq,pef2256'. But it does not matter. Why your device cannot be used in lantiq,foobar-9999? 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..acba3a0ccd1b --- /dev/null +++ b/Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml @@ -0,0 +1,57 @@ +# 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 device + +maintainers: + - Herve Codina <herve.codina@bootlin.com> + +description: | + Codec support for PEF2256. + + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC256, 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. + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + - $ref: dai-common.yaml# + +properties: + compatible: + const: lantiq,pef2256-codec + + lantiq,pef2256: + $ref: /schemas/types.yaml#/definitions/phandle + description: + phandle to the PEF2256 + + '#sound-dai-cells': + const: 0 + +required: + - compatible + - lantiq,pef2256 + - '#sound-dai-cells' + +unevaluatedProperties: false + +examples: + - | + audio-codec { + compatible = "lantiq,pef2256-codec"; + lantiq,pef2256 = <&pef2256>; + #sound-dai-cells = <0>; + };