Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings:iio:dac:ad5592r: txt to yaml format conversion.

This is a more complex binding. Whilst conversion is straight forward
I am unsure if the full nature of required properties has been captured.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20201031184854.745828-39-jic23@kernel.org

+204 -155
-155
Documentation/devicetree/bindings/iio/dac/ad5592r.txt
··· 1 - Analog Devices AD5592R/AD5593R DAC/ADC device driver 2 - 3 - Required properties for the AD5592R: 4 - - compatible: Must be "adi,ad5592r" 5 - - reg: SPI chip select number for the device 6 - - spi-max-frequency: Max SPI frequency to use (< 30000000) 7 - - spi-cpol: The AD5592R requires inverse clock polarity (CPOL) mode 8 - 9 - Required properties for the AD5593R: 10 - - compatible: Must be "adi,ad5593r" 11 - - reg: I2C address of the device 12 - 13 - Required properties for all supported chips: 14 - - #address-cells: Should be 1. 15 - - #size-cells: Should be 0. 16 - - channel nodes: 17 - Each child node represents one channel and has the following 18 - Required properties: 19 - * reg: Pin on which this channel is connected to. 20 - * adi,mode: Mode or function of this channel. 21 - Macros specifying the valid values 22 - can be found in <dt-bindings/iio/adi,ad5592r.h>. 23 - 24 - The following values are currently supported: 25 - * CH_MODE_UNUSED (the pin is unused) 26 - * CH_MODE_ADC (the pin is ADC input) 27 - * CH_MODE_DAC (the pin is DAC output) 28 - * CH_MODE_DAC_AND_ADC (the pin is DAC output 29 - but can be monitored by an ADC, since 30 - there is no disadvantage this 31 - this should be considered as the 32 - preferred DAC mode) 33 - * CH_MODE_GPIO (the pin is registered 34 - with GPIOLIB) 35 - Optional properties: 36 - * adi,off-state: State of this channel when unused or the 37 - device gets removed. Macros specifying the 38 - valid values can be found in 39 - <dt-bindings/iio/adi,ad5592r.h>. 40 - 41 - * CH_OFFSTATE_PULLDOWN (the pin is pulled down) 42 - * CH_OFFSTATE_OUT_LOW (the pin is output low) 43 - * CH_OFFSTATE_OUT_HIGH (the pin is output high) 44 - * CH_OFFSTATE_OUT_TRISTATE (the pin is 45 - tristated output) 46 - 47 - 48 - Optional properties: 49 - - vref-supply: Phandle to the external reference voltage supply. This should 50 - only be set if there is an external reference voltage connected to the VREF 51 - pin. If the property is not set the internal 2.5V reference is used. 52 - - reset-gpios : GPIO spec for the RESET pin. If specified, it will be 53 - asserted during driver probe. 54 - - gpio-controller: Marks the device node as a GPIO controller. 55 - - #gpio-cells: Should be 2. The first cell is the GPIO number and the second 56 - cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. 57 - 58 - AD5592R Example: 59 - 60 - #include <dt-bindings/iio/adi,ad5592r.h> 61 - 62 - vref: regulator-vref { 63 - compatible = "regulator-fixed"; 64 - regulator-name = "vref-ad559x"; 65 - regulator-min-microvolt = <3300000>; 66 - regulator-max-microvolt = <3300000>; 67 - regulator-always-on; 68 - }; 69 - 70 - ad5592r@0 { 71 - #size-cells = <0>; 72 - #address-cells = <1>; 73 - #gpio-cells = <2>; 74 - compatible = "adi,ad5592r"; 75 - reg = <0>; 76 - 77 - spi-max-frequency = <1000000>; 78 - spi-cpol; 79 - 80 - vref-supply = <&vref>; /* optional */ 81 - reset-gpios = <&gpio0 86 0>; /* optional */ 82 - gpio-controller; 83 - 84 - channel@0 { 85 - reg = <0>; 86 - adi,mode = <CH_MODE_DAC>; 87 - }; 88 - channel@1 { 89 - reg = <1>; 90 - adi,mode = <CH_MODE_ADC>; 91 - }; 92 - channel@2 { 93 - reg = <2>; 94 - adi,mode = <CH_MODE_DAC_AND_ADC>; 95 - }; 96 - channel@3 { 97 - reg = <3>; 98 - adi,mode = <CH_MODE_DAC_AND_ADC>; 99 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 100 - }; 101 - channel@4 { 102 - reg = <4>; 103 - adi,mode = <CH_MODE_UNUSED>; 104 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 105 - }; 106 - channel@5 { 107 - reg = <5>; 108 - adi,mode = <CH_MODE_GPIO>; 109 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 110 - }; 111 - channel@6 { 112 - reg = <6>; 113 - adi,mode = <CH_MODE_GPIO>; 114 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 115 - }; 116 - channel@7 { 117 - reg = <7>; 118 - adi,mode = <CH_MODE_GPIO>; 119 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 120 - }; 121 - }; 122 - 123 - AD5593R Example: 124 - 125 - #include <dt-bindings/iio/adi,ad5592r.h> 126 - 127 - ad5593r@10 { 128 - #size-cells = <0>; 129 - #address-cells = <1>; 130 - #gpio-cells = <2>; 131 - compatible = "adi,ad5593r"; 132 - reg = <0x10>; 133 - gpio-controller; 134 - 135 - channel@0 { 136 - reg = <0>; 137 - adi,mode = <CH_MODE_DAC>; 138 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 139 - }; 140 - channel@1 { 141 - reg = <1>; 142 - adi,mode = <CH_MODE_ADC>; 143 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 144 - }; 145 - channel@2 { 146 - reg = <2>; 147 - adi,mode = <CH_MODE_DAC_AND_ADC>; 148 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 149 - }; 150 - channel@6 { 151 - reg = <6>; 152 - adi,mode = <CH_MODE_GPIO>; 153 - adi,off-state = <CH_OFFSTATE_PULLDOWN>; 154 - }; 155 - };
+204
Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD5592R/AD5593R DAC/ADC 8 + 9 + maintainers: 10 + - Michael Hennerich <michael.hennerich@analog.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - adi,ad5592r 16 + - adi,ad5593r 17 + 18 + reg: 19 + maxItems: 1 20 + 21 + spi-max-frequency: 22 + maximum: 30000000 23 + 24 + spi-cpol: true 25 + 26 + "#address-cells": 27 + const: 1 28 + 29 + "#size-cells": 30 + const: 0 31 + 32 + "#io-channel-cells": 33 + const: 1 34 + 35 + vref-supply: 36 + description: If not set internal 2.5V reference used. 37 + 38 + reset-gpios: 39 + maxItems: 1 40 + 41 + gpio-controller: 42 + description: Marks the device node as a GPIO controller. 43 + 44 + "#gpio-cells": 45 + const: 2 46 + description: 47 + The first cell is the GPIO number and the second cell specifies 48 + GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. 49 + 50 + required: 51 + - compatible 52 + - reg 53 + - "#address-cells" 54 + - "#size-cells" 55 + 56 + allOf: 57 + - if: 58 + properties: 59 + compatible: 60 + contains: 61 + const: adi,ad5592r 62 + then: 63 + required: 64 + - spi-cpol 65 + else: 66 + properties: 67 + spi-cpol: false 68 + 69 + additionalProperties: false 70 + 71 + patternProperties: 72 + "^(channel@)[0-7]$": 73 + type: object 74 + description: Child node to describe a channel 75 + properties: 76 + reg: 77 + minimum: 0 78 + maximum: 7 79 + 80 + adi,mode: 81 + $ref: /schemas/types.yaml#/definitions/uint32 82 + enum: [0, 1, 2, 3, 8] 83 + description: | 84 + Mode or function of this channel. 85 + Macros specifying the valid values can be found in 86 + <dt-bindings/iio/adi,ad5592r.h>. 87 + 88 + The following values are currently supported: 89 + * CH_MODE_UNUSED (the pin is unused) 90 + * CH_MODE_ADC (the pin is ADC input) 91 + * CH_MODE_DAC (the pin is DAC output) 92 + * CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored 93 + by an ADC, since there is no disadvantage this should be 94 + considered as the preferred DAC mode) 95 + * CH_MODE_GPIO (the pin is registered with GPIOLIB) 96 + 97 + adi,off-state: 98 + $ref: /schemas/types.yaml#/definitions/uint32 99 + enum: [0, 1, 2, 3] 100 + description: | 101 + State of this channel when unused or the device gets removed. 102 + Macros specifying the valid values can be found in 103 + <dt-bindings/iio/adi,ad5592r.h>. 104 + * CH_OFFSTATE_PULLDOWN (the pin is pulled down) 105 + * CH_OFFSTATE_OUT_LOW (the pin is output low) 106 + * CH_OFFSTATE_OUT_HIGH (the pin is output high) 107 + * CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output) 108 + 109 + required: 110 + - reg 111 + - adi,mode 112 + 113 + additionalProperties: false 114 + 115 + examples: 116 + - | 117 + #include <dt-bindings/iio/adi,ad5592r.h> 118 + spi { 119 + #address-cells = <1>; 120 + #size-cells = <0>; 121 + 122 + addac@0 { 123 + compatible = "adi,ad5592r"; 124 + #size-cells = <0>; 125 + #address-cells = <1>; 126 + #gpio-cells = <2>; 127 + reg = <0>; 128 + 129 + spi-max-frequency = <1000000>; 130 + spi-cpol; 131 + 132 + vref-supply = <&vref>; 133 + reset-gpios = <&gpio0 86 0>; 134 + gpio-controller; 135 + 136 + channel@0 { 137 + reg = <0>; 138 + adi,mode = <CH_MODE_DAC>; 139 + }; 140 + channel@1 { 141 + reg = <1>; 142 + adi,mode = <CH_MODE_ADC>; 143 + }; 144 + channel@2 { 145 + reg = <2>; 146 + adi,mode = <CH_MODE_DAC_AND_ADC>; 147 + }; 148 + channel@3 { 149 + reg = <3>; 150 + adi,mode = <CH_MODE_DAC_AND_ADC>; 151 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 152 + }; 153 + channel@4 { 154 + reg = <4>; 155 + adi,mode = <CH_MODE_UNUSED>; 156 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 157 + }; 158 + channel@5 { 159 + reg = <5>; 160 + adi,mode = <CH_MODE_GPIO>; 161 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 162 + }; 163 + channel@6 { 164 + reg = <6>; 165 + adi,mode = <CH_MODE_GPIO>; 166 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 167 + }; 168 + channel@7 { 169 + reg = <7>; 170 + adi,mode = <CH_MODE_GPIO>; 171 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 172 + }; 173 + }; 174 + ad5593r@10 { 175 + compatible = "adi,ad5593r"; 176 + #size-cells = <0>; 177 + #address-cells = <1>; 178 + #gpio-cells = <2>; 179 + reg = <0x10>; 180 + gpio-controller; 181 + 182 + channel@0 { 183 + reg = <0>; 184 + adi,mode = <CH_MODE_DAC>; 185 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 186 + }; 187 + channel@1 { 188 + reg = <1>; 189 + adi,mode = <CH_MODE_ADC>; 190 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 191 + }; 192 + channel@2 { 193 + reg = <2>; 194 + adi,mode = <CH_MODE_DAC_AND_ADC>; 195 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 196 + }; 197 + channel@6 { 198 + reg = <6>; 199 + adi,mode = <CH_MODE_GPIO>; 200 + adi,off-state = <CH_OFFSTATE_PULLDOWN>; 201 + }; 202 + }; 203 + }; 204 + ...