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: adc: adi,ad7{124,173,192,780}: Allow specifications of a gpio for irq line

For the AD7124 chip and some of its cousins the logical irq line (R̅D̅Y̅)
is physically on the same pin as the spi MISO output (DOUT) and so
reading a register might trigger an interrupt. For correct operation
it's critical that the actual state of the pin can be read to judge if
an interrupt event is a real one or just a spurious one triggered by
toggling the line in its MISO mode.

Allow specification of an "rdy-gpios" property that references a GPIO
that can be used for that purpose. While this is typically the same GPIO
also used (implicitly) as interrupt source, it is still supposed that
the interrupt is specified as before and usual.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/7fc92a8539e55802d514332e70ee836a3ed08b66.1733504533.git.u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Uwe Kleine-König and committed by
Jonathan Cameron
fa6068fb 9ecad7f4

+51
+13
Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml
··· 37 37 description: IRQ line for the ADC 38 38 maxItems: 1 39 39 40 + rdy-gpios: 41 + description: 42 + GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but 43 + highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its 44 + DOUT aka MISO role) and so usually triggers a spurious interrupt. The 45 + distinction between such a spurious event and a real one can only be done 46 + by reading such a GPIO. (There is a register telling the same 47 + information, but accessing that one needs a SPI transfer which then 48 + triggers another interrupt event.) 49 + maxItems: 1 50 + 40 51 '#address-cells': 41 52 const: 1 42 53 ··· 122 111 123 112 examples: 124 113 - | 114 + #include <dt-bindings/gpio/gpio.h> 125 115 spi { 126 116 #address-cells = <1>; 127 117 #size-cells = <0>; ··· 133 121 spi-max-frequency = <5000000>; 134 122 interrupts = <25 2>; 135 123 interrupt-parent = <&gpio>; 124 + rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; 136 125 refin1-supply = <&adc_vref>; 137 126 clocks = <&ad7124_mclk>; 138 127 clock-names = "mclk";
+12
Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
··· 135 135 '#clock-cells': 136 136 const: 0 137 137 138 + rdy-gpios: 139 + description: 140 + GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but 141 + highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its 142 + DOUT aka MISO role) and so usually triggers a spurious interrupt. The 143 + distinction between such a spurious event and a real one can only be done 144 + by reading such a GPIO. (There is a register telling the same 145 + information, but accessing that one needs a SPI transfer which then 146 + triggers another interrupt event.) 147 + maxItems: 1 148 + 138 149 patternProperties: 139 150 "^channel@[0-9a-f]$": 140 151 type: object ··· 454 443 interrupts = <25 IRQ_TYPE_EDGE_FALLING>; 455 444 interrupt-names = "rdy"; 456 445 interrupt-parent = <&gpio>; 446 + rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; 457 447 spi-max-frequency = <5000000>; 458 448 gpio-controller; 459 449 #gpio-cells = <2>;
+15
Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml
··· 106 106 description: see Documentation/devicetree/bindings/iio/adc/adc.yaml 107 107 type: boolean 108 108 109 + rdy-gpios: 110 + description: 111 + GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but 112 + highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its 113 + DOUT aka MISO role) and so usually triggers a spurious interrupt. The 114 + distinction between such a spurious event and a real one can only be done 115 + by reading such a GPIO. (There is a register telling the same 116 + information, but accessing that one needs a SPI transfer which then 117 + triggers another interrupt event.) 118 + maxItems: 1 119 + 109 120 patternProperties: 110 121 "^channel@[0-9a-f]+$": 111 122 type: object ··· 192 181 193 182 examples: 194 183 - | 184 + #include <dt-bindings/gpio/gpio.h> 195 185 spi { 196 186 #address-cells = <1>; 197 187 #size-cells = <0>; ··· 207 195 clock-names = "mclk"; 208 196 interrupts = <25 0x2>; 209 197 interrupt-parent = <&gpio>; 198 + rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; 210 199 aincom-supply = <&aincom>; 211 200 dvdd-supply = <&dvdd>; 212 201 avdd-supply = <&avdd>; ··· 220 207 }; 221 208 }; 222 209 - | 210 + #include <dt-bindings/gpio/gpio.h> 223 211 spi { 224 212 #address-cells = <1>; 225 213 #size-cells = <0>; ··· 238 224 #clock-cells = <0>; 239 225 interrupts = <25 0x2>; 240 226 interrupt-parent = <&gpio>; 227 + rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; 241 228 aincom-supply = <&aincom>; 242 229 dvdd-supply = <&dvdd>; 243 230 avdd-supply = <&avdd>;
+11
Documentation/devicetree/bindings/iio/adc/adi,ad7780.yaml
··· 63 63 marked GPIO_ACTIVE_LOW. 64 64 maxItems: 1 65 65 66 + rdy-gpios: 67 + description: 68 + GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but 69 + highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its 70 + DOUT aka MISO role) and so usually triggers a spurious interrupt. The 71 + distinction between such a spurious event and a real one can only be done 72 + by reading such a GPIO. (There is a register telling the same 73 + information, but accessing that one needs a SPI transfer which then 74 + triggers another interrupt event.) 75 + maxItems: 1 76 + 66 77 required: 67 78 - compatible 68 79 - reg