Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp20517yba; Tue, 23 Apr 2019 18:36:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9OFhY0JSmhCfbOxTzrIuiz8DA6qkqCq0bJj0/Tc2m/BrhDAySgtX1jiT79CuSgLplLGfh X-Received: by 2002:a65:60c7:: with SMTP id r7mr22348584pgv.191.1556069787654; Tue, 23 Apr 2019 18:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556069787; cv=none; d=google.com; s=arc-20160816; b=j/jBFKYncu9kjZcz5jQBGyxKlANj5fqbPy2tdqck+3jUeb/SR0CjEAVgZ1nVAGnelj v/dJk8tybl2Ac813MrEiP2kYbjaj5Azg8lGuyNj1nIra+o8509HZIu6m0d58pCgE5uJK eyHTgBZ2EdsdAgmSVlrhyX+pmLRzCGRBvMJWfq4SVR2Z+xu8tumAQzksDTDCTOYGvwji TOE242EpJ3u9B+YPTp28bEjNqH6L8GXHhKYahKiw8MyMhGu760JZ2/hrqx4oMU/k33FQ Sd0nqssmr9cWpo0V5cVizdJZRK9X1+2GpA74HekC3xF7VxrIzOxJRM9NEy3YZOstP34U d4jg== 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=16vFMpuLlB7SkDmRtj+dvfKRg7bBuRBtKwjD82tNAG0=; b=CL9VJlzCohwhtcexHw2ToUZ4Q7ZeIMUlWDi4BHqWOE/QlS/oWCCXApWIpjid9QkHv+ oawfMfItLvrYEzP+TTdFHCtx86s156f5g2Z5UkayBAXG0a3ePa3ufNj7zKReGGg18lre mrRNjpQ7DOxqW4ZJPPkNt90RpZ3LM55aoETsIY0TESNjw9dscc5kngIyisea9EwfRKgP 2nREz1PN/4nwt3khBTVnCfvRH2W6eo7/IB7Wj0CMAxocbnYS1TzOEuN79an4qelWdd0a iU5ndHLGT7Aatla0c5o9mschCYuw0bNEKLLyTBpQkhV109mbbTq0MrPLXl8DSqgGIWaU EJtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Lif1nmu8; 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 f69si16127531pgc.103.2019.04.23.18.36.11; Tue, 23 Apr 2019 18:36:27 -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=Lif1nmu8; 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 S1729420AbfDXBe2 (ORCPT + 99 others); Tue, 23 Apr 2019 21:34:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:44456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729286AbfDXBe2 (ORCPT ); Tue, 23 Apr 2019 21:34:28 -0400 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 AF810218D2; Wed, 24 Apr 2019 01:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556069666; bh=q0AR+xmHRqNIkXPP4AddehGqwV7G2543yzfYGghtAqw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Lif1nmu86A5TXzEbCS2u7dDSnpkbIo/rPgx97nyY2UjEpLHh+7lwmqBVGCiCEOhmQ 4KBL1XyrzHM1UiV9ni1N2FXyd7FxzlhtiyMJFCBGduVQfa6tIeeSplnrte5xSEYtGU ruX+goByjLLgDafvwjJkGElEmlGUWFlFRocWB+QQ= Received: by mail-qt1-f174.google.com with SMTP id h16so8176354qtk.6; Tue, 23 Apr 2019 18:34:26 -0700 (PDT) X-Gm-Message-State: APjAAAUGPuKM8LbZud4JTmcTz1QQlvd/8Zsfn6U05fak/p6exynS6r4y xhv16V5qMa8bdlhJKf7sW9l7dlq82JqqOgKtRw== X-Received: by 2002:a0c:d2f2:: with SMTP id x47mr23216877qvh.90.1556069665869; Tue, 23 Apr 2019 18:34:25 -0700 (PDT) MIME-Version: 1.0 References: <20190416084552.1538-1-masneyb@onstation.org> <20190422135238.27b9892d@archlinux> In-Reply-To: <20190422135238.27b9892d@archlinux> From: Rob Herring Date: Tue, 23 Apr 2019 20:34:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: iio: tsl2772: convert bindings to YAML format To: Jonathan Cameron Cc: Brian Masney , Lars-Peter Clausen , Peter Meerwald , Mark Rutland , "open list:IIO SUBSYSTEM AND DRIVERS" , devicetree@vger.kernel.org, "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 Mon, Apr 22, 2019 at 7:52 AM Jonathan Cameron wrote: > > 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.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) Do you have the rights on the original file to add BSD license? > > +%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 No need for description on common properties unless you have something unique to add. > > + 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. The uint32-array definition is loose to avoid lots of warnings on common properties where we can't define the exact size. Over time we need to tighten up the dts syntax to be consistent (I have a dtc patch which can spew out lots of warnings to fix these). So this case is correct. '<0, 1>' means a single array with 2 elements. '<0>, <1>' means 2 arrays each with a single element. There shouldn't be lots of occurrences. > > + > > + interrupts: > > + description: Interrupt generated by the device No need for description. > > + maxItems: 1 > > + > > + led-max-microamp: > > + description: Current for the proximity LED This device only has proximity LEDs, right? > > + allOf: > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > + - enum: [13000, 25000, 50000, 100000] We should assume a common schema for 'led-max-microamp', so we just need the enum. > > + > > + vdd-supply: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: Regulator that provides power to the sensor Same here for '*-supply'. So just the description is enough. > > + > > + 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 { proximity-sensor@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>; > > + }; > > + }; > > +... >