Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1945591ybv; Thu, 6 Feb 2020 12:49:02 -0800 (PST) X-Google-Smtp-Source: APXvYqywyhaaQVa4q8NEA6lJrN6fA9i1jHbSx/kjJIHABg3OHzCgQocud99Z8L6YbIpWgPih07pv X-Received: by 2002:a05:6808:315:: with SMTP id i21mr7889734oie.139.1581022142754; Thu, 06 Feb 2020 12:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581022142; cv=none; d=google.com; s=arc-20160816; b=ORAK6p2BCEU66/WNAE24N5FxdGMDeZ7bFXIK+XDMNVjRbrY7tcP14su0RZ/V5s6y4N gwAZKtAY5fR7pTEE9wN8y6vuKswX1qkFBTDDsK0x3nKKvP5a4wmk/BdK1Lj+u7LOhAt7 NNwrvA/qVOavgnicuyrtmJT9ErAX5OG7q4XSaKj+87IjRy5mYYf5rPC+wpncNag1YL8u UGR75ihlL+Ten9lj0D7EpQMWJmcbYfJmitLY+XEoI/yEvCnUcop0jG8R0reYW0Gxgw6E oL/hi2TJJ5CeYijsJklHV/KthWDHXKGYPxvAS8uFfQL6QPHin8q47b8rtEZIV7G4roxW PSzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+JpCejRz9cTdKzvN/s1Lqz/r+3bLOvKPVHP2ixVIjaA=; b=Nij5fpyXUwp12ZqCHbsy3O8gtuFhzEnGnz/Z83qydSnVGVZSnuy9d20ZR/zVcmh1/b C6iKO8EWdUGgsw/6tUnDdMm9C457Ut5yASwTcZoO1edQ717hKgHf1XQxnaYIoYDZoIpO SAx+Yb8Xy5Q9R/qV4psqimgQDB2HxT2B1jYkakCyGG75PT0ySkV/t+FqE3toU256PgAZ C58+FvVjqF50vpAPiLkjsDvHlX9Zjdgoh601wvk3U8DtTXitwYw7fCQn3XrTzwadzRcD 4Q+yZtuNINC0s5os75/Tf5HRDnWcgJbugiGHCEyCcQ8PviqHiNN5E1Uq+QtGLKX63PDF yGbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d192si2831136oig.21.2020.02.06.12.48.50; Thu, 06 Feb 2020 12:49:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728274AbgBFUqf (ORCPT + 99 others); Thu, 6 Feb 2020 15:46:35 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:34089 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728259AbgBFUqb (ORCPT ); Thu, 6 Feb 2020 15:46:31 -0500 Received: by mail-pj1-f66.google.com with SMTP id f2so655852pjq.1; Thu, 06 Feb 2020 12:46:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+JpCejRz9cTdKzvN/s1Lqz/r+3bLOvKPVHP2ixVIjaA=; b=mVWTbWIJa+9uidc0xClrpGq9nebOy0fSzasU8gzahG9t41Yn4VFswlgqSbhU5hj6rd Ik1hXM3UrpI6Ageki0wRLXtXr/w2zWiv8nvcZ1qnK6YzaTtDffuxvFyek3aIKQJoeYwH s2ihrvUJh4y/xB9GD/Z11gWOqEIwwTPtp69Rwb8PV2eK/GjDk1pJmZdJ5VAAF+hTW9LJ PB3kzlEZgeUTI5qY1X9mf6v7J0u7JwFNKmfZQuGKaRLmL4dnWRxptCezKnSa5a7BQ5E7 uUlpkGOANciVIccMdRUS3uMg7DNLJnOMHMuF4Ll+rmmmLUwyDYBpI9YAuK01dVTA+PJW J/mQ== X-Gm-Message-State: APjAAAWe+rYTGAk6zO/sy77vc4uvnmEfNP0yeQwuHW7wxKaCKKBOtBP2 TEFJMvI7YdqInvEjeKKX3w== X-Received: by 2002:a17:902:504:: with SMTP id 4mr5425237plf.276.1581021989698; Thu, 06 Feb 2020 12:46:29 -0800 (PST) Received: from rob-hp-laptop (63-158-47-182.dia.static.qwest.net. [63.158.47.182]) by smtp.gmail.com with ESMTPSA id g7sm288861pfq.33.2020.02.06.12.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 12:46:29 -0800 (PST) Received: (nullmailer pid 9682 invoked by uid 1000); Thu, 06 Feb 2020 18:21:25 -0000 Date: Thu, 6 Feb 2020 18:21:25 +0000 From: Rob Herring To: Olivier Moysan Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, 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 Subject: Re: [PATCH] ASoC: dt-bindings: stm32: convert sai to json-schema Message-ID: <20200206182125.GA23274@bogus> References: <20200130135040.22575-1-olivier.moysan@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200130135040.22575-1-olivier.moysan@st.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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]' > + > + "#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-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. > + minItems: 2 > + maxItems: 2 > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + #include > + sai1: sai@4400a000 { > + compatible = "st,stm32h7-sai"; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges = <0 0x4400a000 0x400>; > + reg = <0x4400a000 0x4>, <0x4400a3f0 0x10>; > + interrupts = ; > + clocks = <&rcc SAI1>, <&rcc PLL1_Q>, <&rcc PLL2_P>; > + clock-names = "pclk", "x8k", "x11k"; > + resets = <&rcc SAI1_R>; > + > + sai1a: audio-controller@4400a004 { > + compatible = "st,stm32-sai-sub-a"; > + #sound-dai-cells = <0>; > + reg = <0x4 0x1c>; > + clocks = <&rcc SAI1_K>; > + clock-names = "sai_ck"; > + dmas = <&dmamux1 87 0x400 0x01>; > + dma-names = "tx"; > + }; > + }; > + > +... > -- > 2.17.1 >