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

dt-bindings: iio: hmc425a: add conditional GPIO array size constraints

ADRF5740 and HMC540S have a 4 bit parallel interface.
Update ctrl-gpios description and min/maxItems values depending on the
matched compatible to correctly reflect the hardware properties.

Fixes: 79f2ff6461e7 ("dt-bindings: iio: hmc425a: add entry for ADRF5740 Attenuator")
Fixes: 20f87a9a26be ("dt-bindings: iio: hmc425a: add entry for HMC540S")
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
Link: https://lore.kernel.org/r/20240220153553.2432-3-mitrutzceclan@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Dumitru Ceclan and committed by
Jonathan Cameron
5c7403ab 506d7e3a

+30 -3
+30 -3
Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml
··· 33 33 34 34 ctrl-gpios: 35 35 description: 36 - Must contain an array of 6 GPIO specifiers, referring to the GPIO pins 37 - connected to the control pins V1-V6. 38 - minItems: 6 36 + Must contain an array of GPIO specifiers, referring to the GPIO pins 37 + connected to the control pins. 38 + ADRF5740 - 4 GPIO connected to D2-D5 39 + HMC540S - 4 GPIO connected to V1-V4 40 + HMC425A - 6 GPIO connected to V1-V6 41 + minItems: 1 39 42 maxItems: 6 43 + 44 + allOf: 45 + - if: 46 + properties: 47 + compatible: 48 + contains: 49 + const: adi,hmc425a 50 + then: 51 + properties: 52 + ctrl-gpios: 53 + minItems: 6 54 + maxItems: 6 55 + - if: 56 + properties: 57 + compatible: 58 + contains: 59 + anyOf: 60 + - const: adi,adrf5740 61 + - const: adi,hmc540s 62 + then: 63 + properties: 64 + ctrl-gpios: 65 + minItems: 4 66 + maxItems: 4 40 67 41 68 required: 42 69 - compatible