Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1117837yba; Sun, 31 Mar 2019 23:14:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqqOrxFk+iDeqsJazmpAXyZt5zARBy9K7myan3LYxinOKcER7TURlA7ABKydgm7OSX9dHV X-Received: by 2002:a63:ef0d:: with SMTP id u13mr36433946pgh.450.1554099298148; Sun, 31 Mar 2019 23:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554099298; cv=none; d=google.com; s=arc-20160816; b=j7Z1PsYuErGTuNgoqWUPuERGDGdyZfHuGGjxPlvj9XL5/p4MgG/r8MT80JkJFrn32A iI0jiqHqLfFjfg1+pjRHsXrQkcxnmp0g8HwO4/oyzBHI1ivkcrLHBSkOtUylZsBgBpOj bUfLGMufRgGAc3tJiXthsGPk4sCS6ygPjsnKuFeRYb01utNFYM3m6gv5vyNSJoWTyvCB 6AaQ17DIzFUzj8AOzRebxJmuYb9a8NiN8Gv2izhOJ1KAAzXbAqsKVItNZBAm4KG1RYNH BtszIvh2HnDZZs/06EQpLIa6YztaYahlUlWBmLfwrlz5OSufUXqxY5l4pt3D2YVirTeF LAJg== 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=6VV54e1vKjaJts3Kl6qVPovV0flkSP+7ofCfsB9oYxs=; b=kwe9i/NDOWmcoUxio5YsatqHRh4gTIBTdIKtj4pSxwVyLiULxaUJJpMPYuOYrbOnE+ w+KX+eH9l5qyow5guanEsdVLxIVSFH6jR4S+SO+O30hxpsPJGR40p2YtX1lNWPcPeuWU Cc8G92Emhx2dg3aFq1TWk6IxCRDJgZ0yHTeeU3N3yhZWrHee1RkXDBrMcwuQ/HyP07hx MJQiEVKTKEbKqvOCfv5FbJJ8zSnEYgvuPxveb1iooiXwD1HjmJwsdC/F4C/RNpg6bXZA 1YCZlzDtWeJirtLZxSNJTKCdGkjn/KQZ4Xw29V5uj5eLPGFq7J665Per7i/S7A+Focn2 N17g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Uyq1dgPE; 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 p13si8548252pll.324.2019.03.31.23.14.41; Sun, 31 Mar 2019 23:14:58 -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=Uyq1dgPE; 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 S1731601AbfDAGN6 (ORCPT + 99 others); Mon, 1 Apr 2019 02:13:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:57600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfDAGN5 (ORCPT ); Mon, 1 Apr 2019 02:13:57 -0400 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 1B00B21841; Mon, 1 Apr 2019 06:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554099236; bh=LCqdFB722rt9ET0SZqdXzeglVUMGIIAgBansj7hQHq4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Uyq1dgPELcGqLbNFjKDDZmPh6eGjhgNt6scuO8cM/ONyvAI0Fw6Z+DKrqdXsBoopc b+jeGuB4ltJM0R+KURrdkPIm1KJsFYKsn7TGPLChk6yi9qZ6AIbQJD38RbzB5YWnX5 bidzuPZd2m5aRoEBOoECWk0XLCZBbm4fIP4iqkfk= Received: by mail-qk1-f181.google.com with SMTP id c20so4896023qkc.10; Sun, 31 Mar 2019 23:13:56 -0700 (PDT) X-Gm-Message-State: APjAAAWfSBcCWBUC9I4TgM9IR6NZlrAnTFVretX0f3oBV03ZyBlUFnLv CfmFG0KJUAix4EP0m54x0IZkNLzH/7JWn83R5A== X-Received: by 2002:a37:d285:: with SMTP id f127mr49230127qkj.147.1554099235271; Sun, 31 Mar 2019 23:13:55 -0700 (PDT) MIME-Version: 1.0 References: <20190331152717.j3b3aggx674zrcko@arbad> In-Reply-To: <20190331152717.j3b3aggx674zrcko@arbad> From: Rob Herring Date: Mon, 1 Apr 2019 01:13:44 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] avia-hx711.yaml: transform DT binding to YAML To: Andreas Klinger Cc: Jonathan Cameron , Mark Rutland , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , "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 Sun, Mar 31, 2019 at 10:27 AM Andreas Klinger wrote: > > replace avia-hx711.txt by avia-hx711.yaml as yaml devicetree documentation > for avia hx711 iio adc sensor > > Signed-off-by: Andreas Klinger > --- > .../devicetree/bindings/iio/adc/avia-hx711.txt | 24 -------- > .../devicetree/bindings/iio/adc/avia-hx711.yaml | 67 ++++++++++++++++++++++ > 2 files changed, 67 insertions(+), 24 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/iio/adc/avia-hx711.txt > create mode 100644 Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml > > diff --git a/Documentation/devicetree/bindings/iio/adc/avia-hx711.txt b/Documentation/devicetree/bindings/iio/adc/avia-hx711.txt > deleted file mode 100644 > index 7222328a3d0d..000000000000 > --- a/Documentation/devicetree/bindings/iio/adc/avia-hx711.txt > +++ /dev/null > @@ -1,24 +0,0 @@ > -* AVIA HX711 ADC chip for weight cells > - Bit-banging driver > - > -Required properties: > - - compatible: Should be "avia,hx711" > - - sck-gpios: Definition of the GPIO for the clock > - - dout-gpios: Definition of the GPIO for data-out > - See Documentation/devicetree/bindings/gpio/gpio.txt > - - avdd-supply: Definition of the regulator used as analog supply > - > -Optional properties: > - - clock-frequency: Frequency of PD_SCK in Hz > - Minimum value allowed is 10 kHz because of maximum > - high time of 50 microseconds. > - > -Example: > -weight { > - compatible = "avia,hx711"; > - sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>; > - dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; > - avdd-suppy = <&avdd>; > - clock-frequency = <100000>; > -}; > - > diff --git a/Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml b/Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml > new file mode 100644 > index 000000000000..e4fee0f877ee > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml > @@ -0,0 +1,67 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: "http://devicetree.org/schemas/iio/adc/avia-hx711.yaml#" > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > + > +title: AVIA HX711 ADC chip for weight cells > + > +maintainers: > + - Andreas Klinger > + > +description: | > + Bit-banging driver using two GPIOs: > + - sck-gpio gives a clock to the sensor with 24 cycles for data retrieval > + and up to 3 cycles for selection of the input channel and gain for the > + next measurement > + - dout-gpio is the sensor data the sensor responds to the clock > + > + Specifications about the driver can be found at: > + http://www.aviaic.com/ENProducts.aspx > + > +properties: > + compatible: > + oneOf: > + - items: > + - const: avia,hx711 You don't need oneOf here unless you expect to have compatible with a variable number of compatible strings. If there are other similar chips which could be added, then using enum will be more future proof (So is 'oneOf' arguably, but it makes for more cryptic error messages). > + > + sck-gpios: > + description: > + Definition of the GPIO for the clock (output). In the datasheet it is > + named PD_SCK > + maxItems: 1 > + > + dout-gpios: > + description: > + Definition of the GPIO for the data-out sent by the sensor in > + response to the clock (input). > + See Documentation/devicetree/bindings/gpio/gpio.txt for information > + on how to specify a consumer gpio. > + maxItems: 1 > + > + avdd-supply: > + description: > + Definition of the regulator used as analog supply > + maxItems: 1 > + > + clock-frequency: > + minimum: 20000 > + maximum: 2500000 > + default: 400000 > + > +required: > + - compatible > + - sck-gpios > + - dout-gpios > + - avdd-supply > + > +examples: > + - | > + #include > + weight { > + compatible = "avia,hx711"; > + sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>; > + dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; > + avdd-suppy = <&avdd>; > + clock-frequency = <100000>; > + }; > -- > 2.11.0