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: dfsdm: move to backend framework

Change the DFSDM binding to use the new IIO backend framework,
along with the adoption of IIO generic channels.
This binding change allows to add scaling support to the DFSDM.

Keep the legacy binding as deprecated for backward compatibility.

The io-backends property is supported only in generic IIO channel
binding.

- Channel description with the generic binding (Audio and Analog):

Properties superseded by generic properties:
st,adc-channels: becomes "reg" property in channel node
st,adc-channel-names: becomes "label" property in channel node
Properties moved to channel child node:
st,adc-channel-types: becomes st,adc-channel-type
st,adc-channel-clk-src, st,adc-alt-channel

- Analog binding:

DFSDM filter channel is configured as an IIO backend consumer.
Add io-backends property in channel child nodes.

DFSDM is no more configured as a channel consumer from SD modulator.
Use of io-channels in DFSDM node is deprecated.

- Audio binding:

DFSDM audio DAI is configured as a channel consumer from DFSDM filter.
No change compare to legacy.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240730084640.1307938-5-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Olivier Moysan and committed by
Jonathan Cameron
b8f31b1d c464cc61

+107 -15
+107 -15
Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
··· 102 102 items: 103 103 minimum: 0 104 104 maximum: 7 105 + deprecated: true 105 106 106 107 st,adc-channel-names: 107 108 description: List of single-ended channel names. 109 + deprecated: true 108 110 109 111 st,filter-order: 110 112 description: | ··· 120 118 "#io-channel-cells": 121 119 const: 1 122 120 121 + '#address-cells': 122 + const: 1 123 + 124 + '#size-cells': 125 + const: 0 126 + 123 127 st,adc-channel-types: 124 128 description: | 125 129 Single-ended channel input type. ··· 136 128 items: 137 129 enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ] 138 130 $ref: /schemas/types.yaml#/definitions/non-unique-string-array 131 + deprecated: true 139 132 140 133 st,adc-channel-clk-src: 141 134 description: | ··· 148 139 items: 149 140 enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ] 150 141 $ref: /schemas/types.yaml#/definitions/non-unique-string-array 142 + deprecated: true 151 143 152 144 st,adc-alt-channel: 153 145 description: ··· 157 147 If not set, channel n is connected to SPI input n. 158 148 If set, channel n is connected to SPI input n + 1. 159 149 type: boolean 150 + deprecated: true 160 151 161 152 st,filter0-sync: 162 153 description: ··· 176 165 - compatible 177 166 - reg 178 167 - interrupts 179 - - st,adc-channels 180 - - st,adc-channel-names 181 168 - st,filter-order 182 169 - "#io-channel-cells" 170 + 171 + patternProperties: 172 + "^channel@[0-7]$": 173 + type: object 174 + $ref: adc.yaml 175 + unevaluatedProperties: false 176 + description: Represents the external channels which are connected to the DFSDM. 177 + 178 + properties: 179 + reg: 180 + maximum: 7 181 + 182 + label: 183 + description: 184 + Unique name to identify which channel this is. 185 + 186 + st,adc-channel-type: 187 + description: | 188 + Single-ended channel input type. 189 + - "SPI_R": SPI with data on rising edge (default) 190 + - "SPI_F": SPI with data on falling edge 191 + - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1 192 + - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0 193 + $ref: /schemas/types.yaml#/definitions/string 194 + enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ] 195 + 196 + st,adc-channel-clk-src: 197 + description: | 198 + Conversion clock source. 199 + - "CLKIN": external SPI clock (CLKIN x) 200 + - "CLKOUT": internal SPI clock (CLKOUT) (default) 201 + - "CLKOUT_F": internal SPI clock divided by 2 (falling edge). 202 + - "CLKOUT_R": internal SPI clock divided by 2 (rising edge). 203 + $ref: /schemas/types.yaml#/definitions/string 204 + enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ] 205 + 206 + st,adc-alt-channel: 207 + description: 208 + Must be defined if two sigma delta modulators are 209 + connected on same SPI input. 210 + If not set, channel n is connected to SPI input n. 211 + If set, channel n is connected to SPI input n + 1. 212 + type: boolean 213 + 214 + io-backends: 215 + description: 216 + Used to pipe external sigma delta modulator or internal ADC backend to DFSDM channel. 217 + maxItems: 1 218 + 219 + required: 220 + - reg 183 221 184 222 allOf: 185 223 - if: ··· 259 199 description: 260 200 From common IIO binding. Used to pipe external sigma delta 261 201 modulator or internal ADC output to DFSDM channel. 202 + deprecated: true 262 203 263 - required: 264 - - io-channels 204 + if: 205 + required: 206 + - st,adc-channels 207 + then: 208 + required: 209 + - io-channels 210 + 211 + patternProperties: 212 + "^channel@[0-7]$": 213 + required: 214 + - io-backends 265 215 266 216 - if: 267 217 properties: ··· 368 298 #address-cells = <1>; 369 299 #size-cells = <0>; 370 300 301 + // Example 1: Audio use case with generic binding 371 302 dfsdm0: filter@0 { 372 303 compatible = "st,stm32-dfsdm-dmic"; 373 304 reg = <0>; ··· 376 305 dmas = <&dmamux1 101 0x400 0x01>; 377 306 dma-names = "rx"; 378 307 #io-channel-cells = <1>; 379 - st,adc-channels = <1>; 380 - st,adc-channel-names = "dmic0"; 381 - st,adc-channel-types = "SPI_R"; 382 - st,adc-channel-clk-src = "CLKOUT"; 308 + #address-cells = <1>; 309 + #size-cells = <0>; 383 310 st,filter-order = <5>; 311 + 312 + channel@1 { 313 + reg = <1>; 314 + label = "dmic0"; 315 + st,adc-channel-type = "SPI_R"; 316 + st,adc-channel-clk-src = "CLKOUT"; 317 + st,adc-alt-channel; 318 + }; 384 319 385 320 asoc_pdm0: dfsdm-dai { 386 321 compatible = "st,stm32h7-dfsdm-dai"; ··· 395 318 }; 396 319 }; 397 320 398 - dfsdm_pdm1: filter@1 { 321 + // Example 2: Analog use case with generic binding 322 + dfsdm1: filter@1 { 399 323 compatible = "st,stm32-dfsdm-adc"; 400 324 reg = <1>; 401 325 interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>; 402 326 dmas = <&dmamux1 102 0x400 0x01>; 403 327 dma-names = "rx"; 404 - #io-channel-cells = <1>; 405 - st,adc-channels = <2 3>; 406 - st,adc-channel-names = "in2", "in3"; 407 - st,adc-channel-types = "SPI_R", "SPI_R"; 408 - st,adc-channel-clk-src = "CLKOUT_F", "CLKOUT_F"; 409 - io-channels = <&sd_adc2 &sd_adc3>; 410 328 st,filter-order = <1>; 329 + #io-channel-cells = <1>; 330 + #address-cells = <1>; 331 + #size-cells = <0>; 332 + 333 + channel@2 { 334 + reg = <2>; 335 + label = "in2"; 336 + st,adc-channel-type = "SPI_F"; 337 + st,adc-channel-clk-src = "CLKOUT"; 338 + st,adc-alt-channel; 339 + io-backends = <&sd_adc2>; 340 + }; 341 + 342 + channel@3 { 343 + reg = <3>; 344 + label = "in3"; 345 + st,adc-channel-type = "SPI_R"; 346 + st,adc-channel-clk-src = "CLKOUT"; 347 + io-backends = <&sd_adc3>; 348 + }; 411 349 }; 412 350 }; 413 351