Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1638028ybh; Sun, 15 Mar 2020 07:31:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vssW1cMNzXQt9KVijyB6wg+CVk/z1c8AyUv6saUOVzx67fP291JYP5+l0iQ80T6kT50V6um X-Received: by 2002:a05:6830:1410:: with SMTP id v16mr15428303otp.315.1584282706195; Sun, 15 Mar 2020 07:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584282706; cv=none; d=google.com; s=arc-20160816; b=w6lnrp1JbhGGWc5oU/2ehKiDSGPcQSNYoyhjCtNIN/pKQ289pIA3enyHF2fw5wl2hq ktBM9jXZ0dlRv+PJD8R4M9GdjOdVMGrFVyWWPeKrFfwVNz+/pfyI9ZaMvtH6UTRI8QTQ Kpe+DgC6+LGU3sb8fPChKLjfdlNdSFZh7qarFug9eu50zM9MICxrBpchUVH7wRQvZ8H7 P61twsE1lfZe/YKSgkGZuSe+/G90fe3a8Ro5BvT/RpnCWIujciR/GiZsUgEiJ7LRZTcg guju8kkTj8+wpPSLf8FfkdhLWwT8/tE4RpYIq/0qy+O8Ks0MQnSLymKHvi+FIg2vfU95 jeew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=V0sFZLLa1jJHG4bYpcsKNTw9rojMu/iVs+wCMo9tzhI=; b=rc5wPmjHK35Z5peZuEs+/xa5qf8jCP7dN2vxiVMLMu+o/wNut4CloGqk74hM1auhb+ Ha/0CXSsZAk8RHU/0VMLmup/pcVR/gr2SXgNWjpXfElST87zcIMGbvp49Zdzo7kATqln ecqT7SkcIrJ0robmfzHymL+tLnHVuGNyLrhEAb4xvjgIAezhvreE69qLLj1YboVaO/7L lyEB4SCaAijjOQkZ4jI0CzHOLQNBbP5cttSk+AkdALVQf3xSlNNIeQ2l1IUjzUW2VuMs SeG2w/6+o6czcXcj1u94MB2gPXKZSMPfkEd+GpKkC/ZskCqokKdiQ2GPZjODF/+2x8uw WaxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mzbxtbpM; 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 c21si8891606otp.0.2020.03.15.07.31.33; Sun, 15 Mar 2020 07:31:46 -0700 (PDT) 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=mzbxtbpM; 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 S1728478AbgCOObP (ORCPT + 99 others); Sun, 15 Mar 2020 10:31:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:41592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727399AbgCOObP (ORCPT ); Sun, 15 Mar 2020 10:31:15 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B26720637; Sun, 15 Mar 2020 14:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584282673; bh=VG1H2hK8Z+Tq6QUiuOXTEyN4DkZAx/5eFNMyDpjsQmU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mzbxtbpMAoJ/LQoVF7t8Tn/h/YFZG8GqCSFXewiyj3agXU0MJplie5lon9ACw5tBf 9+k04ZgzM2Vn+ukWvtOdVG3y8t0LRJ+SxnzW0eytW2/4ZIT+nDDh1VEIe/P4aw1cRx 1N+pXuLbjgaEXyzPv3PACHUPBZ9NwSW7mEm9v960= Date: Sun, 15 Mar 2020 14:31:09 +0000 From: Jonathan Cameron To: Heiko =?UTF-8?B?U3TDvGJuZXI=?= Cc: Johan Jonker , knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/3] dt-bindings: iio: adc: convert rockchip saradc bindings to yaml Message-ID: <20200315143109.5474434b@archlinux> In-Reply-To: <1892398.6xOoJH07Ba@diego> References: <20200313132926.10543-1-jbx6244@gmail.com> <20200315112223.07dd863b@archlinux> <1892398.6xOoJH07Ba@diego> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 15 Mar 2020 15:09:56 +0100 Heiko St=C3=BCbner wrote: > Hi Jonathan, >=20 > Am Sonntag, 15. M=C3=A4rz 2020, 12:22:23 CET schrieb Jonathan Cameron: > > On Fri, 13 Mar 2020 14:29:24 +0100 > > Johan Jonker wrote: > >=20 > > > Current dts files with 'saradc' nodes are manually verified. > > > In order to automate this process rockchip-saradc.txt > > > has to be converted to yaml. > > >=20 > > > Signed-off-by: Johan Jonker > >=20 > > Hi Johan, > >=20 > > A question inline which may just be my lack of yaml knowledge > > showing itself! > >=20 > > Jonathan > >=20 > > > --- > > > .../bindings/iio/adc/rockchip-saradc.txt | 37 ---------- > > > .../bindings/iio/adc/rockchip-saradc.yaml | 79 ++++++++++++= ++++++++++ > > > 2 files changed, 79 insertions(+), 37 deletions(-) > > > delete mode 100644 Documentation/devicetree/bindings/iio/adc/rockchi= p-saradc.txt > > > create mode 100644 Documentation/devicetree/bindings/iio/adc/rockchi= p-saradc.yaml > > >=20 > > > diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-sarad= c.txt b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt > > > deleted file mode 100644 > > > index c2c50b598..000000000 > > > --- a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt > > > +++ /dev/null > > > @@ -1,37 +0,0 @@ > > > -Rockchip Successive Approximation Register (SAR) A/D Converter bindi= ngs > > > - > > > -Required properties: > > > -- compatible: should be "rockchip,-saradc" or "rockchip,rk3066= -tsadc" > > > - - "rockchip,saradc": for rk3188, rk3288 > > > - - "rockchip,rk3066-tsadc": for rk3036 > > > - - "rockchip,rk3328-saradc", "rockchip,rk3399-saradc": for rk3328 > > > - - "rockchip,rk3399-saradc": for rk3399 > > > - - "rockchip,rv1108-saradc", "rockchip,rk3399-saradc": for rv1108 > > > - > > > -- reg: physical base address of the controller and length of memory = mapped > > > - region. > > > -- interrupts: The interrupt number to the cpu. The interrupt specifi= er format > > > - depends on the interrupt controller. > > > -- clocks: Must contain an entry for each entry in clock-names. > > > -- clock-names: Shall be "saradc" for the converter-clock, and "apb_p= clk" for > > > - the peripheral clock. > > > -- vref-supply: The regulator supply ADC reference voltage. > > > -- #io-channel-cells: Should be 1, see ../iio-bindings.txt > > > - > > > -Optional properties: > > > -- resets: Must contain an entry for each entry in reset-names if nee= d support > > > - this option. See ../reset/reset.txt for details. > > > -- reset-names: Must include the name "saradc-apb". > > > - > > > -Example: > > > - saradc: saradc@2006c000 { > > > - compatible =3D "rockchip,saradc"; > > > - reg =3D <0x2006c000 0x100>; > > > - interrupts =3D ; > > > - clocks =3D <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; > > > - clock-names =3D "saradc", "apb_pclk"; > > > - resets =3D <&cru SRST_SARADC>; > > > - reset-names =3D "saradc-apb"; > > > - #io-channel-cells =3D <1>; > > > - vref-supply =3D <&vcc18>; > > > - }; > > > diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-sarad= c.yaml b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml > > > new file mode 100644 > > > index 000000000..2908788b3 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml > > > @@ -0,0 +1,79 @@ > > > +# SPDX-License-Identifier: GPL-2.0 > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/iio/adc/rockchip-saradc.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Rockchip Successive Approximation Register (SAR) A/D Converter > > > + > > > +maintainers: > > > + - Heiko Stuebner > > > + > > > +properties: > > > + compatible: > > > + oneOf: > > > + - const: rockchip,saradc > > > + - const: rockchip,rk3066-tsadc > > > + - const: rockchip,rk3399-saradc > > > + - items: > > > + - enum: > > > + - rockchip,rk3328-saradc > > > + - rockchip,rv1108-saradc > > > + - const: rockchip,rk3399-saradc > >=20 > > My yaml knowledge isn't great. Why do we have this nested > > structure rather than a straight forward list? >=20 > That should be the > - one of rk3328-saradc / rv1108-saradc > - plus always rk3399-saradc >=20 > i.e. both rk3328 and rv1108 are compatible with the rk3399-saradc variant > (at least if no flaws get found at some point) so have the double compati= ble >=20 > compatible =3D "rockchip,rk3328-saradc", "rockchip,rk3399-saradc" > compatible =3D "rockchip,rv1108-saradc", "rockchip,rk3399-saradc" Ah. That makes sense. Thanks to Johan as well for the explanation he sent Thanks, Jonathan >=20 >=20 > Heiko >=20 >=20 > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + interrupts: > > > + maxItems: 1 > > > + > > > + clocks: > > > + items: > > > + - description: converter clock > > > + - description: peripheral clock > > > + > > > + clock-names: > > > + items: > > > + - const: saradc > > > + - const: apb_pclk > > > + > > > + resets: > > > + maxItems: 1 > > > + > > > + reset-names: > > > + const: saradc-apb > > > + > > > + vref-supply: > > > + description: > > > + The regulator supply for the ADC reference voltage. > > > + > > > + "#io-channel-cells": > > > + const: 1 > > > + > > > +required: > > > + - compatible > > > + - reg > > > + - interrupts > > > + - clocks > > > + - clock-names > > > + - vref-supply > > > + - "#io-channel-cells" > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + #include > > > + #include > > > + #include > > > + saradc: saradc@2006c000 { > > > + compatible =3D "rockchip,saradc"; > > > + reg =3D <0x2006c000 0x100>; > > > + interrupts =3D ; > > > + clocks =3D <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; > > > + clock-names =3D "saradc", "apb_pclk"; > > > + resets =3D <&cru SRST_SARADC>; > > > + reset-names =3D "saradc-apb"; > > > + vref-supply =3D <&vcc18>; > > > + #io-channel-cells =3D <1>; > > > + }; > >=20 > >=20 >=20 >=20 >=20 >=20