Re: [PATCH v1 1/4] dt-bindings: iio: adc: Add ltc2378

From: Conor Dooley

Date: Mon May 18 2026 - 13:12:32 EST


On Mon, May 18, 2026 at 12:21:01PM -0300, Marcelo Schmitt wrote:
> From: Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx>
>
> Document how to describe LTC2378-20 and similar ADCs in device tree.
>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx>
> ---
> .../bindings/iio/adc/adi,ltc2378.yaml | 131 ++++++++++++++++++
> MAINTAINERS | 7 +
> 2 files changed, 138 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml
> new file mode 100644
> index 000000000000..56e59bcd7306
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml
> @@ -0,0 +1,131 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/adi,ltc2378.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices LTC2378 and similar Analog to Digital Converters
> +
> +maintainers:
> + - Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx>
> +
> +description: |
> + Analog Devices LTC2378 series of ADCs.
> + Specifications can be found at:
> + https://www.analog.com/media/en/technical-documentation/data-sheets/233818fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/236416fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/236418f.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/236716fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/236718f.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/236816f.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/236818f.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/236918fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237016fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237616fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237618fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237620fb.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237716fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237718fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237720fb.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237816fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237818fa.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237820fb.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/237918fb.pdf
> + https://www.analog.com/media/en/technical-documentation/data-sheets/238016fb.pdf
> +
> +$ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +properties:
> + compatible:
> + oneOf:
> + - enum:
> + - adi,ltc2338-18
> + - adi,ltc2369-18
> + - adi,ltc2370-16
> + - adi,ltc2379-18
> + - adi,ltc2380-16
> + - items:
> + - enum:
> + - adi,ltc2364-18
> + - adi,ltc2364-16 # fallback compatible
> + - items:
> + - enum:
> + - adi,ltc2367-18
> + - adi,ltc2367-16 # fallback compatible
> + - items:
> + - enum:
> + - adi,ltc2368-18
> + - adi,ltc2368-16 # fallback compatible
> + - items:
> + - enum:
> + - adi,ltc2376-18
> + - adi,ltc2376-20
> + - adi,ltc2376-16 # fallback compatible
> + - items:
> + - enum:
> + - adi,ltc2377-18
> + - adi,ltc2377-20
> + - adi,ltc2377-16 # fallback compatible
> + - items:
> + - enum:
> + - adi,ltc2378-18
> + - adi,ltc2378-20
> + - adi,ltc2378-16 # fallback compatible

All of these are wrong.

Firstly, your "fallback" setups don't work, because they only permit a
single compatible. Secondly, if they did work, you still need to define
the fallback compatible in isolation for it to be permitted for use when
it isn't a fallback.
And thirdly, your driver appears to show that these devices aren't
actually compatible at all, given there's unique match data for each
one.
+static const struct of_device_id ltc2378_of_match[] = {
+ { .compatible = "adi,ltc2338-18", .data = &ltc2378_chip_info[ID_LTC2338_18] },
+ { .compatible = "adi,ltc2364-16", .data = &ltc2378_chip_info[ID_LTC2364_16] },
+ { .compatible = "adi,ltc2364-18", .data = &ltc2378_chip_info[ID_LTC2364_18] },
+ { .compatible = "adi,ltc2367-16", .data = &ltc2378_chip_info[ID_LTC2367_16] },
+ { .compatible = "adi,ltc2367-18", .data = &ltc2378_chip_info[ID_LTC2367_18] },
+ { .compatible = "adi,ltc2368-16", .data = &ltc2378_chip_info[ID_LTC2368_16] },
+ { .compatible = "adi,ltc2368-18", .data = &ltc2378_chip_info[ID_LTC2368_18] },
+ { .compatible = "adi,ltc2369-18", .data = &ltc2378_chip_info[ID_LTC2369_18] },
+ { .compatible = "adi,ltc2370-16", .data = &ltc2378_chip_info[ID_LTC2370_16] },
+ { .compatible = "adi,ltc2376-16", .data = &ltc2378_chip_info[ID_LTC2376_16] },
+ { .compatible = "adi,ltc2376-18", .data = &ltc2378_chip_info[ID_LTC2376_18] },
+ { .compatible = "adi,ltc2376-20", .data = &ltc2378_chip_info[ID_LTC2376_20] },
+ { .compatible = "adi,ltc2377-16", .data = &ltc2378_chip_info[ID_LTC2377_16] },
+ { .compatible = "adi,ltc2377-18", .data = &ltc2378_chip_info[ID_LTC2377_18] },
+ { .compatible = "adi,ltc2377-20", .data = &ltc2378_chip_info[ID_LTC2377_20] },
+ { .compatible = "adi,ltc2378-16", .data = &ltc2378_chip_info[ID_LTC2378_16] },
+ { .compatible = "adi,ltc2378-18", .data = &ltc2378_chip_info[ID_LTC2378_18] },
+ { .compatible = "adi,ltc2378-20", .data = &ltc2378_chip_info[ID_LTC2378_20] },
+ { .compatible = "adi,ltc2379-18", .data = &ltc2378_chip_info[ID_LTC2379_18] },
+ { .compatible = "adi,ltc2380-16", .data = &ltc2378_chip_info[ID_LTC2380_16] },
+ { },
+};
+MODULE_DEVICE_TABLE(of, ltc2378_of_match);

Why do you have fallbacks here? Is it because a limited set of channels
could be used in the fallback case? At the very least, the rationale for
fallbacks should be explained.

pw-bot: changes-requested

> +
> + reg:
> + maxItems: 1
> +
> + spi-max-frequency:
> + maximum: 100000000
> +
> + vdd-supply:
> + description: A 2.5V supply that powers the chip (VDD).
> +
> + ovdd-supply:
> + description:
> + A 1.71V to 5.25V supply that sets the logic level for digital interface.
> +
> + ref-supply:
> + description:
> + A 2.5V to 5.1V supply for the reference input (REF).
> +
> + cnv-gpios:
> + description:
> + When provided, this property indicates the GPIO that is connected to the
> + CNV pin.
> + maxItems: 1
> +
> + interrupts:
> + description:
> + Interrupt for signaling the completion of conversion results. The active
> + low signal provided on the BUSY pin asserts when ADC conversions finish.
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - vdd-supply
> + - ovdd-supply
> + - ref-supply
> +
> +additionalProperties: false

As sashiko pointed out, this is not correct if you want to permit spi
properties other than spi-max-frequency (although I could definitely see
how this would be correct).

Cheers,
Conor.

> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + adc@0 {
> + compatible = "adi,ltc2378-20";
> + reg = <0>;
> + spi-max-frequency = <71000000>;
> + vdd-supply = <&supply_2_5V>;
> + ovdd-supply = <&supply_3_3V>;
> + ref-supply = <&supply_5V>;
> + cnv-gpios = <&gpio0 88 GPIO_ACTIVE_HIGH>;
> + interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
> + interrupt-parent = <&gpio>;
> + };
> + };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0de74503df08..768f56eea476 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -15195,6 +15195,13 @@ S: Maintained
> F: Documentation/devicetree/bindings/iio/dac/lltc,ltc1660.yaml
> F: drivers/iio/dac/ltc1660.c
>
> +LTC2378 IIO ADC DRIVER
> +M: Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx>
> +L: linux-iio@xxxxxxxxxxxxxxx
> +S: Supported
> +W: https://ez.analog.com/linux-software-drivers
> +F: Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml
> +
> LTC2664 IIO DAC DRIVER
> M: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
> M: Kim Seer Paller <kimseer.paller@xxxxxxxxxx>
> --
> 2.53.0
>

Attachment: signature.asc
Description: PGP signature