From patchwork Wed Sep 9 17:59:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 249540 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp57368ilk; Wed, 9 Sep 2020 11:06:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQYHG2su2/ZCh6B/lu62gyjouJfVa6F2gHmrTWWeQt7ktWS/TkuLzKxw4E35rezMSmlQtk X-Received: by 2002:a17:906:4f8d:: with SMTP id o13mr4775561eju.20.1599674763054; Wed, 09 Sep 2020 11:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599674763; cv=none; d=google.com; s=arc-20160816; b=UVFFIZSbrFfu1th8y33KBCv9OaLmMMdf34Y4M+JFfJxf5kftZH8imH2GPMwz+Vj5r/ I+AB76tQHqUX+dujH4Ge9bFh4EHfMGLK+b0MTRrRETzWQzubmgFxqAY/JRFo4i0lU0Ce B90IkqbgKJ6bOUS7KwwA4xpVLkG/1/QTJJ3QnaoYy4SQW4bGO6nX6wIwV8Y2/nbxNmUi UvUUd5hpyy4urYrdCsHMvQsBX3t+GsqM+5zyQ6pO3TJan670FxYH0k/X9P6IpWLxV2sJ uUiGj+TPhBAY5NwwzEejiNqIY+zlsgKBpgtgOQMckreQVbgbabguG911TvG2u1zdf8q3 eT2g== 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:date:subject:cc:to:from :dkim-signature; bh=he9HxgsC7oBSgWg4ldOfGLklYYOvwE3bhcAKpb7nMUQ=; b=TXOU8EZcMxz5WLosatF353BlBYh9HELAdYds369QGyTunhx6lldSs7CU5JaMeM8aks HS7Xrpo9kjZkKGE1UhSenaQL4h47iK08oLBrxNtYF2JhIWw1o00paQ5rm3ChZRS4IkSy 16r+kOqukZONxVgs/HVOWGs7u9uNea34CqGs0SqmpLXsGJXYaT+F3s0P89U2go5JwkjE sokxeQ+GOAU8QFLnC6FQ7N40I4YPuRFc4ujNmsZo6bmeD61BVZX6fs+R+kJKHs2AQ0ks KxzQ+wJUHp9SUxjf8Ud0A3MsMODJCqqQij/ilYpkYJCtCwfCzJe0wrcUqulAwToKZwRc yctA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wEBWPEWp; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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. [23.128.96.18]) by mx.google.com with ESMTP id g1si2010474ejz.637.2020.09.09.11.06.02; Wed, 09 Sep 2020 11:06:03 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wEBWPEWp; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S1730021AbgIISF6 (ORCPT + 6 others); Wed, 9 Sep 2020 14:05:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:59332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729692AbgIISEd (ORCPT ); Wed, 9 Sep 2020 14:04:33 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (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 D1DC9221F0; Wed, 9 Sep 2020 18:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599674571; bh=EUvGSJXR4DV422/EfdQe9chtpD8V1CVrITsxwOrFfEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wEBWPEWpbnUsohxqr7tDQNtDJS0xZrqi7jd7S9JWmaUu6s6DCR7m44cWazoNoULTf YdmDMjEN88jqIt7di4XJoIy40h4LMJx8XvkHTYFvG1p1QOKlSd9aov19iC76cSseBm GTrLZGavHdnSJND1QKJ+tBdXMc/NqCQeKReM+r3M= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Rob Herring , devicetree@vger.kernel.org, Jonathan Cameron , Markus Pargmann , Shawn Guo , Sascha Hauer Subject: [PATCH v2 20/20] dt-bindings:iio:adc:fsl,imx25-gcq yaml conversion Date: Wed, 9 Sep 2020 18:59:46 +0100 Message-Id: <20200909175946.395313-21-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909175946.395313-1-jic23@kernel.org> References: <20200909175946.395313-1-jic23@kernel.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron This binding has a few corners that would have been done different today but hopefully the yaml schema captures the constraints correctly. The child node names are not constrained hence the fairly open regexp. I've also documented the defaults for the two references that the driver seems to use and copied the value descriptions from the header because I think they should be in the dt-binding itself. This is part of a general effort to convert all the IIO bindings over to yaml Signed-off-by: Jonathan Cameron Cc: Markus Pargmann Cc: Shawn Guo Cc: Sascha Hauer --- .../bindings/iio/adc/fsl,imx25-gcq.txt | 57 -------- .../bindings/iio/adc/fsl,imx25-gcq.yaml | 129 ++++++++++++++++++ 2 files changed, 129 insertions(+), 57 deletions(-) -- 2.28.0 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/iio/adc/fsl,imx25-gcq.txt b/Documentation/devicetree/bindings/iio/adc/fsl,imx25-gcq.txt deleted file mode 100644 index eebdcec3dab5..000000000000 --- a/Documentation/devicetree/bindings/iio/adc/fsl,imx25-gcq.txt +++ /dev/null @@ -1,57 +0,0 @@ -Freescale i.MX25 ADC GCQ device - -This is a generic conversion queue device that can convert any of the -analog inputs using the ADC unit of the i.MX25. - -Required properties: - - compatible: Should be "fsl,imx25-gcq". - - reg: Should be the register range of the module. - - interrupts: Should be the interrupt number of the module. - Typically this is <1>. - - #address-cells: Should be <1> (setting for the subnodes) - - #size-cells: Should be <0> (setting for the subnodes) - -Optional properties: - - vref-ext-supply: The regulator supplying the ADC reference voltage. - Required when at least one subnode uses the this reference. - - vref-xp-supply: The regulator supplying the ADC reference voltage on pin XP. - Required when at least one subnode uses this reference. - - vref-yp-supply: The regulator supplying the ADC reference voltage on pin YP. - Required when at least one subnode uses this reference. - -Sub-nodes: -Optionally you can define subnodes which define the reference voltage -for the analog inputs. - -Required properties for subnodes: - - reg: Should be the number of the analog input. - 0: xp - 1: yp - 2: xn - 3: yn - 4: wiper - 5: inaux0 - 6: inaux1 - 7: inaux2 -Optional properties for subnodes: - - fsl,adc-refp: specifies the positive reference input as defined in - - - fsl,adc-refn: specifies the negative reference input as defined in - - -Example: - - adc: adc@50030800 { - compatible = "fsl,imx25-gcq"; - reg = <0x50030800 0x60>; - interrupt-parent = <&tscadc>; - interrupts = <1>; - #address-cells = <1>; - #size-cells = <0>; - - inaux@5 { - reg = <5>; - fsl,adc-refp = ; - fsl,adc-refn = ; - }; - }; diff --git a/Documentation/devicetree/bindings/iio/adc/fsl,imx25-gcq.yaml b/Documentation/devicetree/bindings/iio/adc/fsl,imx25-gcq.yaml new file mode 100644 index 000000000000..6c4e3ef0862c --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/fsl,imx25-gcq.yaml @@ -0,0 +1,129 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/fsl,imx25-gcq.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale ADC GCQ device + +description: + This is a generic conversion queue device that can convert any of the + analog inputs using the ADC unit of the i.MX25. + +maintainers: + - Markus Pargmann + +properties: + compatible: + const: fsl,imx25-gcq + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vref-ext-supply: + description: + The regulator supplying the ADC reference voltage. + Required when at least one subnode uses the this reference. + + vref-xp-supply: + description: + The regulator supplying the ADC reference voltage on pin XP. + Required when at least one subnode uses this reference. + + vref-yp-supply: + description: + The regulator supplying the ADC reference voltage on pin YP. + Required when at least one subnode uses this reference. + + "#io-channel-cells": + const: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +required: + - compatible + - reg + - interrupts + - "#address-cells" + - "#size-cells" + +patternProperties: + "[a-z][a-z0-9]+@[0-9a-f]+$": + type: object + description: + Child nodes used to define the reference voltages used for each channel + + properties: + reg: + description: | + Number of the analog input. + 0: xp + 1: yp + 2: xn + 3: yn + 4: wiper + 5: inaux0 + 6: inaux1 + 7: inaux2 + items: + - minimum: 0 + maximum: 7 + + fsl,adc-refp: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Specifies the positive reference input as defined in + + 0: YP voltage reference + 1: XP voltage reference + 2: External voltage reference + 3: Internal voltage reference (default) + minimum: 0 + maximum: 3 + + fsl,adc-refn: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Specifies the negative reference input as defined in + + 0: XN ground reference + 1: YN ground reference + 2: Internal ground reference + 3: External ground reference (default) + minimum: 0 + maximum: 3 + + required: + - reg + +additionalProperties: false + +examples: + - | + #include + soc { + #address-cells = <1>; + #size-cells = <1>; + adc@50030800 { + compatible = "fsl,imx25-gcq"; + reg = <0x50030800 0x60>; + interrupt-parent = <&tscadc>; + interrupts = <1>; + #address-cells = <1>; + #size-cells = <0>; + + inaux@5 { + reg = <5>; + fsl,adc-refp = ; + fsl,adc-refn = ; + }; + }; + }; +...