From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFDA1C3F68F for ; Tue, 11 Feb 2020 18:13:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3272214DB for ; Tue, 11 Feb 2020 18:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581444805; bh=3riax90X3cB1LTgwegasbmXkNo83BsShz5HQj87AsSg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=FzW0QVzcv8CAJLIaLix9+j2+YuE3OHxwvuJYcKyW5cjXYIb47lsRd6VMk8M8hwZnB i+BPtQV9irGaZdqyEZdmXzhuTcCuuB4Kv3JqWvPaHq5iHekhAodZbTfvj9+QcCGn61 NoIBN4JKRPemoaeFO5yAIC1um1UnzMfLIqGwDsZI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729087AbgBKSNZ (ORCPT ); Tue, 11 Feb 2020 13:13:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:42644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727764AbgBKSNY (ORCPT ); Tue, 11 Feb 2020 13:13:24 -0500 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9525D20848; Tue, 11 Feb 2020 18:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581444803; bh=3riax90X3cB1LTgwegasbmXkNo83BsShz5HQj87AsSg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vKBQdf7sq8abEa5O+/jfAR/LrlO09VRq0Z8A4pR8a4/sVqTwKbBjz0b+jF4mKUjJz cbaIxk3EQNVW6V0EEQQtrPeEUrmfiWllfOzuhSsW7m9ur/R0BZ0zlVs25gOQg+kvxl W33tqbKqHX0dSPBeI6mowsfPGrsH3gclSmBnKwmI= Received: by mail-qk1-f181.google.com with SMTP id z19so7970084qkj.5; Tue, 11 Feb 2020 10:13:23 -0800 (PST) X-Gm-Message-State: APjAAAWG3QoKc+KzhcdfRy/wKBv0TJ2tG6+7dqEUajKaolfEUHHLwY+c ZLROSV2rixCO2iSyFLcyMB30ZELotSYPEYho5g== X-Google-Smtp-Source: APXvYqwRNNy+ur96m7q6c3i3fkxvIT/TIzcSWdajVPSiLV011854FY1lIs7P3ivinO4cTTgIv5XuOleMFRvHINxetz0= X-Received: by 2002:a37:6042:: with SMTP id u63mr6765137qkb.119.1581444802651; Tue, 11 Feb 2020 10:13:22 -0800 (PST) MIME-Version: 1.0 References: <20200130135040.22575-1-olivier.moysan@st.com> <20200206182125.GA23274@bogus> <843b9213-99c0-ec9f-bde6-4745a9cb6221@st.com> In-Reply-To: <843b9213-99c0-ec9f-bde6-4745a9cb6221@st.com> From: Rob Herring Date: Tue, 11 Feb 2020 12:13:11 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ASoC: dt-bindings: stm32: convert sai to json-schema To: Olivier MOYSAN Cc: "lgirdwood@gmail.com" , "broonie@kernel.org" , "perex@perex.cz" , "tiwai@suse.com" , "mcoquelin.stm32@gmail.com" , Alexandre TORGUE , "alsa-devel@alsa-project.org" , "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 7, 2020 at 7:42 AM Olivier MOYSAN wrote: > > Hi Rob, > > On 2/6/20 7:21 PM, Rob Herring wrote: > > On Thu, Jan 30, 2020 at 02:50:40PM +0100, Olivier Moysan wrote: > >> Convert the STM32 SAI bindings to DT schema format using json-schema. > >> > >> Signed-off-by: Olivier Moysan > >> --- > >> .../bindings/sound/st,stm32-sai.txt | 107 ---------- > >> .../bindings/sound/st,stm32-sai.yaml | 193 ++++++++++++++++++ > >> 2 files changed, 193 insertions(+), 107 deletions(-) > >> delete mode 100644 Documentation/devicetree/bindings/sound/st,stm32-sai.txt > >> create mode 100644 Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > > > >> diff --git a/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml b/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > >> new file mode 100644 > >> index 000000000000..33dca007fc86 > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > >> @@ -0,0 +1,193 @@ > >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >> +%YAML 1.2 > >> +--- > >> +$id: http://devicetree.org/schemas/sound/st,stm32-sai.yaml# > >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >> + > >> +title: STMicroelectronics STM32 Serial Audio Interface (SAI) > >> + > >> +maintainers: > >> + - Olivier Moysan > >> + > >> +description: > >> + The SAI interface (Serial Audio Interface) offers a wide set of audio > >> + protocols as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97. > >> + The SAI contains two independent audio sub-blocks. Each sub-block has > >> + its own clock generator and I/O lines controller. > >> + > >> +properties: > >> + compatible: > >> + enum: > >> + - st,stm32f4-sai > >> + - st,stm32h7-sai > >> + > >> + reg: > >> + items: > >> + - description: Base address and size of SAI common register set. > >> + - description: Base address and size of SAI identification register set. > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + ranges: > >> + maxItems: 1 > >> + > >> + interrupts: > >> + maxItems: 1 > >> + > >> + resets: > >> + maxItems: 1 > >> + > >> + "#address-cells": > >> + const: 1 > >> + > >> + "#size-cells": > >> + const: 1 > >> + > >> + clocks: > >> + items: > >> + - description: pclk feeds the peripheral bus interface. > >> + - description: x8k, SAI parent clock for sampling rates multiple of 8kHz. > >> + - description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz. > >> + > >> + clock-names: > >> + items: > >> + enum: [ pclk, x8k, x11k ] > >> + minItems: 3 > >> + maxItems: 3 > >> + > >> +required: > >> + - compatible > >> + - reg > >> + - ranges > >> + - "#address-cells" > >> + - "#size-cells" > >> + - clocks > >> + - clock-names > >> + > >> +patternProperties: > >> + "^audio-controller@[0-9a-f]+$": > >> + type: object > >> + description: > >> + Two subnodes corresponding to SAI sub-block instances A et B > >> + can be defined. Subnode can be omitted for unsused sub-block. > >> + > >> + properties: > >> + compatible: > >> + description: Compatible for SAI sub-block A or B. > >> + enum: > >> + - st,stm32-sai-sub-a > >> + - st,stm32-sai-sub-b > > pattern: 'st,stm32-sai-sub-[ab]' > I will change this in v2 > >> + > >> + "#sound-dai-cells": > >> + const: 0 > >> + > >> + reg: > >> + maxItems: 1 > >> + > >> + clocks: > >> + items: > >> + - description: sai_ck clock feeding the internal clock generator. > >> + - description: MCLK clock from a SAI set as master clock provider. > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + clock-names: > >> + items: > >> + - const: sai_ck > >> + - const: MCLK > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + dmas: > >> + items: > >> + - description: SAI sub-block is configured as a capture DAI. > >> + - description: SAI sub-block is configured as a playback DAI. > >> + minItems: 1 > >> + maxItems: 1 > > This is defining that dmas has 2 entries, but then limits it to the 1st > > entry only. > dma can be either "rx" or "tx", but not both. > Maybe, the following syntax is more appropriate: > > dmas: > maxItems: 1 > > dma-names: > description: | > rx: SAI sub-block is configured as a capture DAI. > tx: SAI sub-block is configured as a playback DAI. > items: > - enum: [ rx, tx ] Yes, but for a single entry you can drop 'items'. > > >> + > >> + dma-names: > >> + items: > >> + - enum: [ rx, tx ] > >> + > >> + st,sync: > >> + description: > >> + Configure the SAI sub-block as slave of another SAI sub-block. > >> + By default SAI sub-block is in asynchronous mode. > >> + Must contain the phandle and index of the SAI sub-block providing > >> + the synchronization. > >> + allOf: > >> + - $ref: /schemas/types.yaml#definitions/phandle-array > >> + - maxItems: 1 > >> + > >> + st,iec60958: > >> + description: > >> + If set, support S/PDIF IEC6958 protocol for playback. > >> + IEC60958 protocol is not available for capture. > >> + By default, custom protocol is assumed, meaning that protocol is > >> + configured according to protocol defined in related DAI link node, > >> + such as i2s, left justified, right justified, dsp and pdm protocols. > >> + allOf: > >> + - $ref: /schemas/types.yaml#definitions/flag > >> + > >> + "#clock-cells": > >> + description: Configure the SAI device as master clock provider. > >> + const: 0 > >> + > >> + required: > >> + - compatible > >> + - "#sound-dai-cells" > >> + - reg > >> + - clocks > >> + - clock-names > >> + - dmas > >> + - dma-names > > additionalProperties: false. > > > >> + > >> +allOf: > >> + - if: > >> + properties: > >> + compatible: > >> + contains: > >> + const: st,stm32f4-sai > >> + > >> + - then: > >> + properties: > >> + clocks: > >> + minItems: 2 > >> + maxItems: 2 > >> + > >> + clock-names: > >> + items: > >> + enum: [ x8k, x11k ] > > Define the order. > > > Do you mean, adding in clocks property : > items: > - description: x8k, SAI parent clock for sampling rates > multiple of 8kHz. > - description: x11k, SAI parent clock for sampling rates > multiple of 11.025kHz. That too, but for clocks you need: clock-names: items: - const: x8k - const: x11k > But, it seems to me that this is redundant with previous definition of > clocks property. It's not because it's clocks in different positions. Rob From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D834CC35242 for ; Tue, 11 Feb 2020 18:14:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D44F20708 for ; Tue, 11 Feb 2020 18:14:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="dQUaJGPB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="vKBQdf7s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D44F20708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AA8B485D; Tue, 11 Feb 2020 19:13:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AA8B485D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1581444868; bh=aL4U2NIsxHOWXhljrOZCliHgofRNS5snv4v2XlewECU=; h=References:In-Reply-To:From:Date:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dQUaJGPBDY7xlzr5OXxEXwY+1ChgwmXL05GwuFFWqfAAzihb5kDoFL2A2Qrup5hYD eItCKFj1M/p2O6Rjw1FLRUxgGUpBU1SOXeILqjkpnzbMNLcg5Z2jF1FDqkRacQOYU2 T9BNkmMhlTSKIsQq6k/nDQBIODD30bF+lNYTj6YI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 323E6F8013E; Tue, 11 Feb 2020 19:13:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F05FBF80145; Tue, 11 Feb 2020 19:13:31 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 131F4F800E7 for ; Tue, 11 Feb 2020 19:13:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 131F4F800E7 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="vKBQdf7s" Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98D882086A for ; Tue, 11 Feb 2020 18:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581444803; bh=3riax90X3cB1LTgwegasbmXkNo83BsShz5HQj87AsSg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vKBQdf7sq8abEa5O+/jfAR/LrlO09VRq0Z8A4pR8a4/sVqTwKbBjz0b+jF4mKUjJz cbaIxk3EQNVW6V0EEQQtrPeEUrmfiWllfOzuhSsW7m9ur/R0BZ0zlVs25gOQg+kvxl W33tqbKqHX0dSPBeI6mowsfPGrsH3gclSmBnKwmI= Received: by mail-qk1-f173.google.com with SMTP id v2so6103521qkj.2 for ; Tue, 11 Feb 2020 10:13:23 -0800 (PST) X-Gm-Message-State: APjAAAUEjjmQX14x7tLWZrEd1ExXXQYtKMe+o/QwyagBIf+RXNJLm93C 6GqUfo5MfCOwGzNg3MP1G+UwJ5nyvyebgIp9WA== X-Google-Smtp-Source: APXvYqwRNNy+ur96m7q6c3i3fkxvIT/TIzcSWdajVPSiLV011854FY1lIs7P3ivinO4cTTgIv5XuOleMFRvHINxetz0= X-Received: by 2002:a37:6042:: with SMTP id u63mr6765137qkb.119.1581444802651; Tue, 11 Feb 2020 10:13:22 -0800 (PST) MIME-Version: 1.0 References: <20200130135040.22575-1-olivier.moysan@st.com> <20200206182125.GA23274@bogus> <843b9213-99c0-ec9f-bde6-4745a9cb6221@st.com> In-Reply-To: <843b9213-99c0-ec9f-bde6-4745a9cb6221@st.com> From: Rob Herring Date: Tue, 11 Feb 2020 12:13:11 -0600 X-Gmail-Original-Message-ID: Message-ID: To: Olivier MOYSAN Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "alsa-devel@alsa-project.org" , Alexandre TORGUE , "linux-kernel@vger.kernel.org" , "tiwai@suse.com" , "lgirdwood@gmail.com" , "broonie@kernel.org" , "mcoquelin.stm32@gmail.com" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [alsa-devel] [PATCH] ASoC: dt-bindings: stm32: convert sai to json-schema X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, Feb 7, 2020 at 7:42 AM Olivier MOYSAN wrote: > > Hi Rob, > > On 2/6/20 7:21 PM, Rob Herring wrote: > > On Thu, Jan 30, 2020 at 02:50:40PM +0100, Olivier Moysan wrote: > >> Convert the STM32 SAI bindings to DT schema format using json-schema. > >> > >> Signed-off-by: Olivier Moysan > >> --- > >> .../bindings/sound/st,stm32-sai.txt | 107 ---------- > >> .../bindings/sound/st,stm32-sai.yaml | 193 ++++++++++++++++++ > >> 2 files changed, 193 insertions(+), 107 deletions(-) > >> delete mode 100644 Documentation/devicetree/bindings/sound/st,stm32-sai.txt > >> create mode 100644 Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > > > >> diff --git a/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml b/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > >> new file mode 100644 > >> index 000000000000..33dca007fc86 > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > >> @@ -0,0 +1,193 @@ > >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >> +%YAML 1.2 > >> +--- > >> +$id: http://devicetree.org/schemas/sound/st,stm32-sai.yaml# > >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >> + > >> +title: STMicroelectronics STM32 Serial Audio Interface (SAI) > >> + > >> +maintainers: > >> + - Olivier Moysan > >> + > >> +description: > >> + The SAI interface (Serial Audio Interface) offers a wide set of audio > >> + protocols as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97. > >> + The SAI contains two independent audio sub-blocks. Each sub-block has > >> + its own clock generator and I/O lines controller. > >> + > >> +properties: > >> + compatible: > >> + enum: > >> + - st,stm32f4-sai > >> + - st,stm32h7-sai > >> + > >> + reg: > >> + items: > >> + - description: Base address and size of SAI common register set. > >> + - description: Base address and size of SAI identification register set. > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + ranges: > >> + maxItems: 1 > >> + > >> + interrupts: > >> + maxItems: 1 > >> + > >> + resets: > >> + maxItems: 1 > >> + > >> + "#address-cells": > >> + const: 1 > >> + > >> + "#size-cells": > >> + const: 1 > >> + > >> + clocks: > >> + items: > >> + - description: pclk feeds the peripheral bus interface. > >> + - description: x8k, SAI parent clock for sampling rates multiple of 8kHz. > >> + - description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz. > >> + > >> + clock-names: > >> + items: > >> + enum: [ pclk, x8k, x11k ] > >> + minItems: 3 > >> + maxItems: 3 > >> + > >> +required: > >> + - compatible > >> + - reg > >> + - ranges > >> + - "#address-cells" > >> + - "#size-cells" > >> + - clocks > >> + - clock-names > >> + > >> +patternProperties: > >> + "^audio-controller@[0-9a-f]+$": > >> + type: object > >> + description: > >> + Two subnodes corresponding to SAI sub-block instances A et B > >> + can be defined. Subnode can be omitted for unsused sub-block. > >> + > >> + properties: > >> + compatible: > >> + description: Compatible for SAI sub-block A or B. > >> + enum: > >> + - st,stm32-sai-sub-a > >> + - st,stm32-sai-sub-b > > pattern: 'st,stm32-sai-sub-[ab]' > I will change this in v2 > >> + > >> + "#sound-dai-cells": > >> + const: 0 > >> + > >> + reg: > >> + maxItems: 1 > >> + > >> + clocks: > >> + items: > >> + - description: sai_ck clock feeding the internal clock generator. > >> + - description: MCLK clock from a SAI set as master clock provider. > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + clock-names: > >> + items: > >> + - const: sai_ck > >> + - const: MCLK > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + dmas: > >> + items: > >> + - description: SAI sub-block is configured as a capture DAI. > >> + - description: SAI sub-block is configured as a playback DAI. > >> + minItems: 1 > >> + maxItems: 1 > > This is defining that dmas has 2 entries, but then limits it to the 1st > > entry only. > dma can be either "rx" or "tx", but not both. > Maybe, the following syntax is more appropriate: > > dmas: > maxItems: 1 > > dma-names: > description: | > rx: SAI sub-block is configured as a capture DAI. > tx: SAI sub-block is configured as a playback DAI. > items: > - enum: [ rx, tx ] Yes, but for a single entry you can drop 'items'. > > >> + > >> + dma-names: > >> + items: > >> + - enum: [ rx, tx ] > >> + > >> + st,sync: > >> + description: > >> + Configure the SAI sub-block as slave of another SAI sub-block. > >> + By default SAI sub-block is in asynchronous mode. > >> + Must contain the phandle and index of the SAI sub-block providing > >> + the synchronization. > >> + allOf: > >> + - $ref: /schemas/types.yaml#definitions/phandle-array > >> + - maxItems: 1 > >> + > >> + st,iec60958: > >> + description: > >> + If set, support S/PDIF IEC6958 protocol for playback. > >> + IEC60958 protocol is not available for capture. > >> + By default, custom protocol is assumed, meaning that protocol is > >> + configured according to protocol defined in related DAI link node, > >> + such as i2s, left justified, right justified, dsp and pdm protocols. > >> + allOf: > >> + - $ref: /schemas/types.yaml#definitions/flag > >> + > >> + "#clock-cells": > >> + description: Configure the SAI device as master clock provider. > >> + const: 0 > >> + > >> + required: > >> + - compatible > >> + - "#sound-dai-cells" > >> + - reg > >> + - clocks > >> + - clock-names > >> + - dmas > >> + - dma-names > > additionalProperties: false. > > > >> + > >> +allOf: > >> + - if: > >> + properties: > >> + compatible: > >> + contains: > >> + const: st,stm32f4-sai > >> + > >> + - then: > >> + properties: > >> + clocks: > >> + minItems: 2 > >> + maxItems: 2 > >> + > >> + clock-names: > >> + items: > >> + enum: [ x8k, x11k ] > > Define the order. > > > Do you mean, adding in clocks property : > items: > - description: x8k, SAI parent clock for sampling rates > multiple of 8kHz. > - description: x11k, SAI parent clock for sampling rates > multiple of 11.025kHz. That too, but for clocks you need: clock-names: items: - const: x8k - const: x11k > But, it seems to me that this is redundant with previous definition of > clocks property. It's not because it's clocks in different positions. Rob _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBD2FC352A3 for ; Tue, 11 Feb 2020 18:21:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA6F7206D6 for ; Tue, 11 Feb 2020 18:21:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RXtcIy+R"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="vKBQdf7s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA6F7206D6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z9WltrdPjJgOKDnjqgx4ZxqSG688d4/zFP0c7iLqELg=; b=RXtcIy+RRFp3Ds NqErY44452MRVkAlM89pZj+P+lsaJZG+nFYiJxPsvP+kO7Nvb8lTkDurcTVI/oW9ON/At0XLQJYhm CjYqv7fsu/rktzqbMvQ//HXjPHLOIpvs7ry+QNkxr3L+ocUQOH6hHV87Fw5siksHVBrtULlJ8qjzf MHGD51fIMkJohLBOIS1VOWvPPf4Pb7Tk5AsuiCNLc1tlBVNBc97bTr1z8xlisku+ITv3QTam2h1fg UsfxBwJMkfZRhcIXU/y4P2lCGNnQSY5LE9g9bPbMqmBSIHZ9l6TSioo1F7/JaIEQc1RLuXhbMZFid u6YekEMy9pGqZiKsOwgQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1aA2-0008H3-Fw; Tue, 11 Feb 2020 18:21:26 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1a2G-0008Pd-6U for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2020 18:13:26 +0000 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9C3E520870 for ; Tue, 11 Feb 2020 18:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581444803; bh=3riax90X3cB1LTgwegasbmXkNo83BsShz5HQj87AsSg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vKBQdf7sq8abEa5O+/jfAR/LrlO09VRq0Z8A4pR8a4/sVqTwKbBjz0b+jF4mKUjJz cbaIxk3EQNVW6V0EEQQtrPeEUrmfiWllfOzuhSsW7m9ur/R0BZ0zlVs25gOQg+kvxl W33tqbKqHX0dSPBeI6mowsfPGrsH3gclSmBnKwmI= Received: by mail-qk1-f176.google.com with SMTP id q15so10997301qke.9 for ; Tue, 11 Feb 2020 10:13:23 -0800 (PST) X-Gm-Message-State: APjAAAUZj4DktLbd+eoB9rh/ktIft7J4qA8rLmd9OogR9pCrfcZbPt6W bwsUzlXa+ad4Hm4pHv1ShWfvfcyN8pz7bNKhYQ== X-Google-Smtp-Source: APXvYqwRNNy+ur96m7q6c3i3fkxvIT/TIzcSWdajVPSiLV011854FY1lIs7P3ivinO4cTTgIv5XuOleMFRvHINxetz0= X-Received: by 2002:a37:6042:: with SMTP id u63mr6765137qkb.119.1581444802651; Tue, 11 Feb 2020 10:13:22 -0800 (PST) MIME-Version: 1.0 References: <20200130135040.22575-1-olivier.moysan@st.com> <20200206182125.GA23274@bogus> <843b9213-99c0-ec9f-bde6-4745a9cb6221@st.com> In-Reply-To: <843b9213-99c0-ec9f-bde6-4745a9cb6221@st.com> From: Rob Herring Date: Tue, 11 Feb 2020 12:13:11 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ASoC: dt-bindings: stm32: convert sai to json-schema To: Olivier MOYSAN X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_101324_390512_396B844D X-CRM114-Status: GOOD ( 24.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "alsa-devel@alsa-project.org" , Alexandre TORGUE , "linux-kernel@vger.kernel.org" , "tiwai@suse.com" , "lgirdwood@gmail.com" , "broonie@kernel.org" , "mcoquelin.stm32@gmail.com" , "perex@perex.cz" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 7, 2020 at 7:42 AM Olivier MOYSAN wrote: > > Hi Rob, > > On 2/6/20 7:21 PM, Rob Herring wrote: > > On Thu, Jan 30, 2020 at 02:50:40PM +0100, Olivier Moysan wrote: > >> Convert the STM32 SAI bindings to DT schema format using json-schema. > >> > >> Signed-off-by: Olivier Moysan > >> --- > >> .../bindings/sound/st,stm32-sai.txt | 107 ---------- > >> .../bindings/sound/st,stm32-sai.yaml | 193 ++++++++++++++++++ > >> 2 files changed, 193 insertions(+), 107 deletions(-) > >> delete mode 100644 Documentation/devicetree/bindings/sound/st,stm32-sai.txt > >> create mode 100644 Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > > > >> diff --git a/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml b/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > >> new file mode 100644 > >> index 000000000000..33dca007fc86 > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/sound/st,stm32-sai.yaml > >> @@ -0,0 +1,193 @@ > >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >> +%YAML 1.2 > >> +--- > >> +$id: http://devicetree.org/schemas/sound/st,stm32-sai.yaml# > >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >> + > >> +title: STMicroelectronics STM32 Serial Audio Interface (SAI) > >> + > >> +maintainers: > >> + - Olivier Moysan > >> + > >> +description: > >> + The SAI interface (Serial Audio Interface) offers a wide set of audio > >> + protocols as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97. > >> + The SAI contains two independent audio sub-blocks. Each sub-block has > >> + its own clock generator and I/O lines controller. > >> + > >> +properties: > >> + compatible: > >> + enum: > >> + - st,stm32f4-sai > >> + - st,stm32h7-sai > >> + > >> + reg: > >> + items: > >> + - description: Base address and size of SAI common register set. > >> + - description: Base address and size of SAI identification register set. > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + ranges: > >> + maxItems: 1 > >> + > >> + interrupts: > >> + maxItems: 1 > >> + > >> + resets: > >> + maxItems: 1 > >> + > >> + "#address-cells": > >> + const: 1 > >> + > >> + "#size-cells": > >> + const: 1 > >> + > >> + clocks: > >> + items: > >> + - description: pclk feeds the peripheral bus interface. > >> + - description: x8k, SAI parent clock for sampling rates multiple of 8kHz. > >> + - description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz. > >> + > >> + clock-names: > >> + items: > >> + enum: [ pclk, x8k, x11k ] > >> + minItems: 3 > >> + maxItems: 3 > >> + > >> +required: > >> + - compatible > >> + - reg > >> + - ranges > >> + - "#address-cells" > >> + - "#size-cells" > >> + - clocks > >> + - clock-names > >> + > >> +patternProperties: > >> + "^audio-controller@[0-9a-f]+$": > >> + type: object > >> + description: > >> + Two subnodes corresponding to SAI sub-block instances A et B > >> + can be defined. Subnode can be omitted for unsused sub-block. > >> + > >> + properties: > >> + compatible: > >> + description: Compatible for SAI sub-block A or B. > >> + enum: > >> + - st,stm32-sai-sub-a > >> + - st,stm32-sai-sub-b > > pattern: 'st,stm32-sai-sub-[ab]' > I will change this in v2 > >> + > >> + "#sound-dai-cells": > >> + const: 0 > >> + > >> + reg: > >> + maxItems: 1 > >> + > >> + clocks: > >> + items: > >> + - description: sai_ck clock feeding the internal clock generator. > >> + - description: MCLK clock from a SAI set as master clock provider. > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + clock-names: > >> + items: > >> + - const: sai_ck > >> + - const: MCLK > >> + minItems: 1 > >> + maxItems: 2 > >> + > >> + dmas: > >> + items: > >> + - description: SAI sub-block is configured as a capture DAI. > >> + - description: SAI sub-block is configured as a playback DAI. > >> + minItems: 1 > >> + maxItems: 1 > > This is defining that dmas has 2 entries, but then limits it to the 1st > > entry only. > dma can be either "rx" or "tx", but not both. > Maybe, the following syntax is more appropriate: > > dmas: > maxItems: 1 > > dma-names: > description: | > rx: SAI sub-block is configured as a capture DAI. > tx: SAI sub-block is configured as a playback DAI. > items: > - enum: [ rx, tx ] Yes, but for a single entry you can drop 'items'. > > >> + > >> + dma-names: > >> + items: > >> + - enum: [ rx, tx ] > >> + > >> + st,sync: > >> + description: > >> + Configure the SAI sub-block as slave of another SAI sub-block. > >> + By default SAI sub-block is in asynchronous mode. > >> + Must contain the phandle and index of the SAI sub-block providing > >> + the synchronization. > >> + allOf: > >> + - $ref: /schemas/types.yaml#definitions/phandle-array > >> + - maxItems: 1 > >> + > >> + st,iec60958: > >> + description: > >> + If set, support S/PDIF IEC6958 protocol for playback. > >> + IEC60958 protocol is not available for capture. > >> + By default, custom protocol is assumed, meaning that protocol is > >> + configured according to protocol defined in related DAI link node, > >> + such as i2s, left justified, right justified, dsp and pdm protocols. > >> + allOf: > >> + - $ref: /schemas/types.yaml#definitions/flag > >> + > >> + "#clock-cells": > >> + description: Configure the SAI device as master clock provider. > >> + const: 0 > >> + > >> + required: > >> + - compatible > >> + - "#sound-dai-cells" > >> + - reg > >> + - clocks > >> + - clock-names > >> + - dmas > >> + - dma-names > > additionalProperties: false. > > > >> + > >> +allOf: > >> + - if: > >> + properties: > >> + compatible: > >> + contains: > >> + const: st,stm32f4-sai > >> + > >> + - then: > >> + properties: > >> + clocks: > >> + minItems: 2 > >> + maxItems: 2 > >> + > >> + clock-names: > >> + items: > >> + enum: [ x8k, x11k ] > > Define the order. > > > Do you mean, adding in clocks property : > items: > - description: x8k, SAI parent clock for sampling rates > multiple of 8kHz. > - description: x11k, SAI parent clock for sampling rates > multiple of 11.025kHz. That too, but for clocks you need: clock-names: items: - const: x8k - const: x11k > But, it seems to me that this is redundant with previous definition of > clocks property. It's not because it's clocks in different positions. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel