summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/iio
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2020-10-31 19:24:21 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-12-03 20:32:45 +0100
commitb70d154d655806838ea4bae11622a82c293d1b46 (patch)
treea74368d9d4c2141db2b1defd69b17f4a1ce070ad /Documentation/devicetree/bindings/iio
parentdt-bindings:iio:health:ti,afe4404: txt to yaml conversion (diff)
downloadlinux-b70d154d655806838ea4bae11622a82c293d1b46.tar.xz
linux-b70d154d655806838ea4bae11622a82c293d1b46.zip
dt-bindings:iio:adc: convert adc.txt to yaml
Each driver that uses this will need to use a $ref We can't always enable it like most of the generic bindings due to channel@X matching far more widely than IIO. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20201031182423.742798-2-jic23@kernel.org
Diffstat (limited to 'Documentation/devicetree/bindings/iio')
-rw-r--r--Documentation/devicetree/bindings/iio/adc/adc.txt29
-rw-r--r--Documentation/devicetree/bindings/iio/adc/adc.yaml42
2 files changed, 42 insertions, 29 deletions
diff --git a/Documentation/devicetree/bindings/iio/adc/adc.txt b/Documentation/devicetree/bindings/iio/adc/adc.txt
deleted file mode 100644
index 4b37575bbddc..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/adc.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Common ADCs properties
-
-Optional properties for child nodes:
-- bipolar : Boolean, if set the channel is used in bipolar mode.
-- diff-channels : Differential channels muxed for this ADC. The first value
- specifies the positive input pin, the second value the negative
- input pin.
-- reg: The channel number.
-- label: Unique name to identify which channel this is.
-
-Example:
- adc@0 {
- compatible = "some,adc";
- ...
- channel@0 {
- reg = <0>;
- label = "channel_0_name";
- bipolar;
- diff-channels = <0 1>;
- ...
- };
-
- channel@1 {
- reg = <1>;
- label = "channel_1_name";
- diff-channels = <2 3>;
- ...
- };
- };
diff --git a/Documentation/devicetree/bindings/iio/adc/adc.yaml b/Documentation/devicetree/bindings/iio/adc/adc.yaml
new file mode 100644
index 000000000000..912a7635edc4
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/adc.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic IIO bindings for ADC channels
+
+maintainers:
+ - Jonathan Cameron <jic23@kernel.org>
+
+description:
+ A few properties are defined in a common way ADC channels.
+
+properties:
+ $nodename:
+ pattern: "^channel(@[0-9a-f]+)?$"
+ description:
+ A channel index should match reg.
+
+ reg:
+ maxItems: 1
+
+ label:
+ $ref: /schemas/types.yaml#/definitions/string
+ description: Unique name to identify which channel this is.
+
+ bipolar:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description: If provided, the channel is to be used in bipolar mode.
+
+ diff-channels:
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ maxItems: 2
+ minItems: 2
+ description:
+ Many ADCs have dual Muxes to allow different input pins to be routed
+ to both the positive and negative inputs of a differential ADC.
+ The first value specifies the positive input pin, the second
+ specifies the negative input pin.
+
+additionalProperties: true