Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2380021yba; Mon, 22 Apr 2019 05:53:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuM6HNYQ9I3ZX8fJt+lDf8zCZ4+n8N5kNXETRvVbIyjn3H4+8ZYnXmG1O9kSaA0uh+dIeh X-Received: by 2002:a17:902:8a81:: with SMTP id p1mr20369139plo.106.1555937637391; Mon, 22 Apr 2019 05:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555937637; cv=none; d=google.com; s=arc-20160816; b=rMtdeip42R3WLWQ1U6tvhoR11XeqeTqV+MS1l7aOY7kqPhDZgVeWZEfmotEcWu3sZ4 KGglDMIYt+U5BH8TMNBfebjZy5R/Vmp65oCIPzapk+ig1nvp7zPAjKAEehLXnAGIyCZr 8w/ZE665XYrJ36W72sE4XNw18IabqVbsfALhekXkZpSeuvi7xrPuscItLCNRtRsgSYbm 4p88VMr2frKEXMu4stgwDn1JDiYUOUexvP8vASmDMiUZyBacRMWZF6xuUx7LEQisUxIX 4Al5vny1A0W5x3Xwqh7gaXBfJKCc+LTVVHrZYa4yy13EZGPP4z5+vuw1qSGKPnfdqZST qH1A== 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=LRMIdfghrJzsQAmJjkWqeQzjKijxM477dPaN75u703o=; b=x86+EmN59wc8NSAE9RXaEwfTHIH5wRqpz1vSCs+vbCjE2ZfDp0MAuzbHzYRABfhffP aARKB28FnPkCOpNDeGhYMyTvS+46oprCbSzitrjvdGbRKxlIAuRnEqfm9qPS/Pl8dfWU u8OSJX7CInwEDxPr/I2RQHENp6D0JdxTRXJBA43HrMqd7EcJmPo5UB1DL2cRqyZ+1NA+ 2W3HZod4OR4RHk7lDhqx/ylP++BDmzbXR9HOgE1RQoRT79j4GJshLf80s49Lfa9h9Z+0 nGHIKLAkFsvzioT+zWe1AaHS92zkT23Ngz1WKf+qG1ASooYz3XMLlQsqEYnrOirrDkz7 dtBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AcNMM4M6; 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 12si12329197pgn.67.2019.04.22.05.53.40; Mon, 22 Apr 2019 05:53:57 -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=AcNMM4M6; 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 S1727330AbfDVMwq (ORCPT + 99 others); Mon, 22 Apr 2019 08:52:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:42810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfDVMwp (ORCPT ); Mon, 22 Apr 2019 08:52:45 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 ABDF02077C; Mon, 22 Apr 2019 12:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555937564; bh=el5Z1PfhoB/P6yOS7WEN7W06+yOjjEAa5i4h/mTQtww=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AcNMM4M66qUgHtlqbctGc1Rp2yuDobZXVJ16nG2BAavJxbqwWSSRv/9/pAFJ5vjfo qISpfJmjoa3fckAsFLijE+ge1o5pfgTdjpkxm9RWmE3Q8+SCqZHJ9tUrk0cyESoMZV ggEDwocCVKvjm4WvPN2yfVnBxcGw+tsAXVk8s7AM= Date: Mon, 22 Apr 2019 13:52:38 +0100 From: Jonathan Cameron To: Brian Masney Cc: robh+dt@kernel.org, lars@metafoo.de, pmeerw@pmeerw.net, mark.rutland@arm.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dt-bindings: iio: tsl2772: convert bindings to YAML format Message-ID: <20190422135238.27b9892d@archlinux> In-Reply-To: <20190416084552.1538-1-masneyb@onstation.org> References: <20190416084552.1538-1-masneyb@onstation.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Apr 2019 04:45:51 -0400 Brian Masney wrote: > Convert the tsl2772 device tree bindings to the new YAML format. > > Signed-off-by: Brian Masney Hi Brian, Good to see this. I'm afraid it's all a bit new to me so what I haven't yet understood is how prescriptive we should be. For example, are the phandle references below needed or not? So for a while yet I'm going to be relying on Rob and others to review these and put me on the right track. Jonathan > --- > .../devicetree/bindings/iio/light/tsl2772.txt | 42 --------- > .../bindings/iio/light/tsl2772.yaml | 85 +++++++++++++++++++ > 2 files changed, 85 insertions(+), 42 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/iio/light/tsl2772.txt > create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2772.yaml > > diff --git a/Documentation/devicetree/bindings/iio/light/tsl2772.txt b/Documentation/devicetree/bindings/iio/light/tsl2772.txt > deleted file mode 100644 > index 1c5e6f17a1df..000000000000 > --- a/Documentation/devicetree/bindings/iio/light/tsl2772.txt > +++ /dev/null > @@ -1,42 +0,0 @@ > -* AMS/TAOS ALS and proximity sensor > - > -Required properties: > - > - - compatible: Should be one of > - "amstaos,tsl2571" > - "amstaos,tsl2671" > - "amstaos,tmd2671" > - "amstaos,tsl2771" > - "amstaos,tmd2771" > - "amstaos,tsl2572" > - "amstaos,tsl2672" > - "amstaos,tmd2672" > - "amstaos,tsl2772" > - "amstaos,tmd2772" > - "avago,apds9930" > - - reg: the I2C address of the device > - > -Optional properties: > - > - - amstaos,proximity-diodes - proximity diodes to enable. <0>, <1>, or <0 1> > - are the only valid values. > - - led-max-microamp - current for the proximity LED. Must be 100000, 50000, > - 25000, or 13000. > - - vdd-supply: phandle to the regulator that provides power to the sensor. > - - vddio-supply: phandle to the regulator that provides power to the bus. > - - interrupts: the sole interrupt generated by the device > - > - Refer to interrupt-controller/interrupts.txt for generic interrupt client > - node bindings. > - > -Example: > - > -tsl2772@39 { > - compatible = "amstaos,tsl2772"; > - reg = <0x39>; > - interrupts-extended = <&msmgpio 61 IRQ_TYPE_EDGE_FALLING>; > - vdd-supply = <&pm8941_l17>; > - vddio-supply = <&pm8941_lvs1>; > - amstaos,proximity-diodes = <0>; > - led-max-microamp = <100000>; > -}; > diff --git a/Documentation/devicetree/bindings/iio/light/tsl2772.yaml b/Documentation/devicetree/bindings/iio/light/tsl2772.yaml > new file mode 100644 > index 000000000000..b3ac182288d2 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/light/tsl2772.yaml > @@ -0,0 +1,85 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/light/tsl2772.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: AMS/TAOS Ambient Light Sensor (ALS) and Proximity Detector > + > +maintainers: > + - Brian Masney > + > +description: | > + Ambient light sensing and proximity detection with an i2c interface. > + https://ams.com/documents/20143/36005/TSL2772_DS000181_2-00.pdf > + > +properties: > + compatible: > + enum: > + - amstaos,tsl2571 > + - amstaos,tsl2671 > + - amstaos,tmd2671 > + - amstaos,tsl2771 > + - amstaos,tmd2771 > + - amstaos,tsl2572 > + - amstaos,tsl2672 > + - amstaos,tmd2672 > + - amstaos,tsl2772 > + - amstaos,tmd2772 > + - avago,apds9930 > + > + reg: > + description: The I2C address of the device > + maxItems: 1 > + > + amstaos,proximity-diodes: > + description: Proximity diodes to enable > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32-array > + - minItems: 1 > + maxItems: 2 > + items: > + minimum: 0 > + maximum: 1 Do we need to represent that these can't be <1 0> ? (specified in old docs) We also have a tighter spec than the uint32-array format in types.yaml as don't allow <0>, <1> under the current binding where only <0, 1> is allowed. > + > + interrupts: > + description: Interrupt generated by the device > + maxItems: 1 > + > + led-max-microamp: > + description: Current for the proximity LED > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32 > + - enum: [13000, 25000, 50000, 100000] > + > + vdd-supply: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: Regulator that provides power to the sensor > + > + vddio-supply: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: Regulator that provides power to the bus > + > +required: > + - compatible > + - reg > + > +examples: > + - | > + #include > + > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + tsl2772@39 { > + compatible = "amstaos,tsl2772"; > + reg = <0x39>; > + interrupts-extended = <&msmgpio 61 IRQ_TYPE_EDGE_FALLING>; > + vdd-supply = <&pm8941_l17>; > + vddio-supply = <&pm8941_lvs1>; > + amstaos,proximity-diodes = <0>; > + led-max-microamp = <100000>; > + }; > + }; > +...