Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5325933ybv; Tue, 11 Feb 2020 13:33:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwPfK8cgn/XM6+CoREFIdDVZqOjBSrvzKaxn1+jSuWkFcUou89etF76Ev6RiXsavKhcbfSP X-Received: by 2002:aca:814:: with SMTP id 20mr4224665oii.159.1581456819127; Tue, 11 Feb 2020 13:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581456819; cv=none; d=google.com; s=arc-20160816; b=GY/veO8x3Sita3z9IsUEyuYTqNzxu43gUTcH/+lPwZstRmPxEne84eAYyAjOG1pJlV 6hEPRqwOKlfwMye2HqrQtuD3MOPsYRezm8m7L4OXl6R8psZOd5UOZcrcCYxv+W8e7CaD jZtHxtZ4lxdjm7uwYorIHdmA9N+vPf/VlNtXGMj/FbXLkXqawDk0KLksma/npTMrkexy KKsRjDAFD2RS/BwjDCJce/mdbNW/x+EmN83Y3pjbIZUMUtTlTCzu39C4WKwpnqQu2LSj wlivrJ7yQhg7yaG/tMlZc1FsCSAIPrWby/GJYYlTprsrNP8nt+48Y9t8V3WhBURusK2X Pdbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LaDG/7IwIiMksSVsJowokRJ5xeSB/ls/oE1kcwqDcG4=; b=YaSVc17QO5PicMG5Xa+JzdOy2juIj3cSeffdPuSXKPlsL4T21QqhXT97KJ0TeWH49I gsOu3BnIrKmhORgrHyDWImfompUBJnA6KWf8ELApiSR+d8BwOE8AJtUVcO5W7iJ6PfX5 tVN/mr2Y4LpMGApnYQ8UouQ0dlSBv7X7CnHImg0mBv+Hp3mShEQlNV+nozl8g/m3hyp4 RZyvQqiNlYyE1GEYQTHR0X9PHYhqOxupvI38ZDYdSo+VTyW2NZx2LbttyBRg0mY5EWbJ S41Pt8EgeTVdofdGRQEuBt71cMMnz6ByhyFGlNFyPMR2NbWWhdZe2hNdSrJPQAjFTCLL nUog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vKBQdf7s; 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=pass (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 w4si2648862otl.214.2020.02.11.13.33.27; Tue, 11 Feb 2020 13:33:39 -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; dkim=pass header.i=@kernel.org header.s=default header.b=vKBQdf7s; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728873AbgBKSNZ (ORCPT + 99 others); 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-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