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

dt-bindings: iio: adc: adi,ad7124: fix clocks properties

Use correct clocks properties for the AD7124 family of ADCs.

These ADCs have an internal clock along with an optional external clock
that can be connected to the CLK pin. This pin can be wired up 3 ways:
1. Not connected - the internal clock is used.
2. Connected to an external clock (input) - the external clock is used.
3. Connected to the CLK pin on another ADC (output) - the internal clock
is used on one and the other is configured for an external clock.

The new bindings describe these 3 cases by picking one of the following:
1. Omit both clocks and #clock-cells properties.
2. Include only the clocks property with a phandle to the external clock.
3. Include only the #clock-cells property on the ADC providing the output.

The clock-names property is now deprecated and should not be used. The
MCLK signal that it refers to is an internal counter in the ADC and
therefore does not make sense as a devicetree property as it can't be
connected to anything external to the ADC. Since there is only one
possible external clock, the clock-names property is not needed anyway.
Based on the implementation of the Linux driver, it looks like the
"mclk" clock was basically being used as a control to select the power
mode of the ADC, which is not something that should be done in the
devicetree.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250828-iio-adc-ad7124-proper-clock-support-v3-1-0b317b4605e5@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
a52bdee1 6c2a7d22

+16 -5
+16 -5
Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml
··· 28 28 29 29 clocks: 30 30 maxItems: 1 31 - description: phandle to the master clock (mclk) 31 + description: Optional external clock connected to the CLK pin. 32 32 33 33 clock-names: 34 + deprecated: true 35 + description: 36 + MCLK is an internal counter in the ADC. Do not use this property. 34 37 items: 35 38 - const: mclk 39 + 40 + '#clock-cells': 41 + description: 42 + The CLK pin can be used as an output. When that is the case, include 43 + this property. 44 + const: 0 36 45 37 46 interrupts: 38 47 description: IRQ line for the ADC ··· 76 67 required: 77 68 - compatible 78 69 - reg 79 - - clocks 80 - - clock-names 81 70 - interrupts 71 + 72 + # Can't have both clock input and output at the same time. 73 + not: 74 + required: 75 + - '#clock-cells' 76 + - clocks 82 77 83 78 patternProperties: 84 79 "^channel@([0-9]|1[0-5])$": ··· 149 136 interrupt-parent = <&gpio>; 150 137 rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; 151 138 refin1-supply = <&adc_vref>; 152 - clocks = <&ad7124_mclk>; 153 - clock-names = "mclk"; 154 139 155 140 #address-cells = <1>; 156 141 #size-cells = <0>;