[PATCH v10 1/2] dt-bindings: iio: adc: add max14001

Marilene Andrade Garcia posted 2 patches 1 month ago
There is a newer version of this series
[PATCH v10 1/2] dt-bindings: iio: adc: add max14001
Posted by Marilene Andrade Garcia 1 month ago
Add device-tree documentation for MAX14001/MAX14002 ADCs.
The MAX14001/MAX14002 are isolated, single-channel analog-to-digital
converters with programmable voltage comparators and inrush current
control optimized for configurable binary input applications.

Co-developed-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
Signed-off-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
---
 .../bindings/iio/adc/adi,max14001.yaml        | 79 +++++++++++++++++++
 MAINTAINERS                                   |  8 ++
 2 files changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
new file mode 100644
index 000000000000..ff9a41f04300
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2023-2025 Analog Devices Inc.
+# Copyright 2023 Kim Seer Paller
+# Copyright 2025 Marilene Andrade Garcia
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/adi,max14001.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices MAX14001-MAX14002 ADC
+
+maintainers:
+  - Kim Seer Paller <kimseer.paller@analog.com>
+  - Marilene Andrade Garcia <marilene.agarcia@gmail.com>
+
+description: |
+    Single channel 10 bit ADC with SPI interface.
+    Datasheet can be found here
+      https://www.analog.com/media/en/technical-documentation/data-sheets/MAX14001-MAX14002.pdf
+
+$ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    enum:
+      - adi,max14001
+      - adi,max14002
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 5000000
+
+  vdd-supply:
+    description:
+      Isolated DC-DC power supply input voltage.
+
+  vddl-supply:
+    description:
+      Logic power supply.
+
+  vrefin-supply:
+    description:
+      ADC voltage reference supply.
+
+  interrupts:
+    items:
+      - description: |
+          Interrupt for signaling when conversion results exceed the configured
+          upper threshold for ADC readings or fall below the lower threshold for
+          them. Interrupt source must be attached to COUT pin.
+      - description: |
+          Alert output that asserts low during a number of different error
+          conditions. The interrupt source must be attached to FAULT pin.
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+  - vddl-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      max14001: adc@0 {
+        compatible = "adi,max14001";
+        reg = <0>;
+        spi-max-frequency = <5000000>;
+        vdd-supply = <&vdd>;
+        vddl-supply = <&vddl>;
+      };
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index af1c8d2bfb3d..f145f0204407 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14969,6 +14969,14 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/sound/max9860.txt
 F:	sound/soc/codecs/max9860.*
 
+MAX14001/MAX14002 IIO ADC DRIVER
+M:	Kim Seer Paller <kimseer.paller@analog.com>
+M:	Marilene Andrade Garcia <marilene.agarcia@gmail.com>
+L:	linux-iio@vger.kernel.org
+S:	Maintained
+W:	https://ez.analog.com/linux-software-drivers
+F:	Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
+
 MAXBOTIX ULTRASONIC RANGER IIO DRIVER
 M:	Andreas Klinger <ak@it-klinger.de>
 L:	linux-iio@vger.kernel.org
-- 
2.34.1
Re: [PATCH v10 1/2] dt-bindings: iio: adc: add max14001
Posted by David Lechner 1 month ago
On 9/2/25 8:15 AM, Marilene Andrade Garcia wrote:
> Add device-tree documentation for MAX14001/MAX14002 ADCs.
> The MAX14001/MAX14002 are isolated, single-channel analog-to-digital
> converters with programmable voltage comparators and inrush current
> control optimized for configurable binary input applications.

When there are multiple devices, DT maintainers like to know
what is the difference between the devices.

> 
> Co-developed-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
> Signed-off-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>

Sine the patch is From: M.A.G., according to [1], this should be:

Co-developed-by: K.S.P.
Signed-off-by: K.S.P.
Signed-off-by: M.A.G.

(hopefully obvious, but don't use the abbreviations - I just did
that for brevity)

[1]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by

> ---
>  .../bindings/iio/adc/adi,max14001.yaml        | 79 +++++++++++++++++++
>  MAINTAINERS                                   |  8 ++
>  2 files changed, 87 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
> new file mode 100644
> index 000000000000..ff9a41f04300
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
> @@ -0,0 +1,79 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2023-2025 Analog Devices Inc.
> +# Copyright 2023 Kim Seer Paller
> +# Copyright 2025 Marilene Andrade Garcia
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/adi,max14001.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices MAX14001-MAX14002 ADC
> +
> +maintainers:
> +  - Kim Seer Paller <kimseer.paller@analog.com>
> +  - Marilene Andrade Garcia <marilene.agarcia@gmail.com>
> +
> +description: |
> +    Single channel 10 bit ADC with SPI interface.
> +    Datasheet can be found here
> +      https://www.analog.com/media/en/technical-documentation/data-sheets/MAX14001-MAX14002.pdf
> +
> +$ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,max14001
> +      - adi,max14002
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency:
> +    maximum: 5000000
> +
> +  vdd-supply:
> +    description:
> +      Isolated DC-DC power supply input voltage.
> +
> +  vddl-supply:
> +    description:
> +      Logic power supply.
> +
> +  vrefin-supply:

The actual pin name is REFIN, so refin-supply would make more sense.

> +    description:
> +      ADC voltage reference supply.
> +
> +  interrupts:

Likely needs `minItems: 1` in case only one interrupt is wired.

> +    items:
> +      - description: |
> +          Interrupt for signaling when conversion results exceed the configured
> +          upper threshold for ADC readings or fall below the lower threshold for
> +          them. Interrupt source must be attached to COUT pin.

We could shorten these descriptions. The important part is which pin
it is connected to.

> +      - description: |
> +          Alert output that asserts low during a number of different error
> +          conditions. The interrupt source must be attached to FAULT pin.
> +

And also `interrupt-names:` makes sense so we know which one is
is wired if only one is given.

> +required:
> +  - compatible
> +  - reg
> +  - vdd-supply
> +  - vddl-supply
> +
Re: [PATCH v10 1/2] dt-bindings: iio: adc: add max14001
Posted by Conor Dooley 1 month ago
On Tue, Sep 02, 2025 at 09:29:04AM -0500, David Lechner wrote:
> On 9/2/25 8:15 AM, Marilene Andrade Garcia wrote:
> > Add device-tree documentation for MAX14001/MAX14002 ADCs.
> > The MAX14001/MAX14002 are isolated, single-channel analog-to-digital
> > converters with programmable voltage comparators and inrush current
> > control optimized for configurable binary input applications.
> 
> When there are multiple devices, DT maintainers like to know
> what is the difference between the devices.

Looking at the driver, I don't really buy that there even is a
meaningful one, at least at first glance. What even is different between
them other than the name?

> 
> > 
> > Co-developed-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
> > Signed-off-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
> > Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> 
> Sine the patch is From: M.A.G., according to [1], this should be:
> 
> Co-developed-by: K.S.P.
> Signed-off-by: K.S.P.
> Signed-off-by: M.A.G.
> 
> (hopefully obvious, but don't use the abbreviations - I just did
> that for brevity)

Prob also worth putting a note under the --- line as to why the r-b from
Krzysztof got dropped that was on v9.

> 
> [1]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by
> 
> > ---
> >  .../bindings/iio/adc/adi,max14001.yaml        | 79 +++++++++++++++++++
> >  MAINTAINERS                                   |  8 ++
> >  2 files changed, 87 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
> > new file mode 100644
> > index 000000000000..ff9a41f04300
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
> > @@ -0,0 +1,79 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +# Copyright 2023-2025 Analog Devices Inc.
> > +# Copyright 2023 Kim Seer Paller
> > +# Copyright 2025 Marilene Andrade Garcia
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/adc/adi,max14001.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices MAX14001-MAX14002 ADC
> > +
> > +maintainers:
> > +  - Kim Seer Paller <kimseer.paller@analog.com>
> > +  - Marilene Andrade Garcia <marilene.agarcia@gmail.com>
> > +
> > +description: |
> > +    Single channel 10 bit ADC with SPI interface.
> > +    Datasheet can be found here
> > +      https://www.analog.com/media/en/technical-documentation/data-sheets/MAX14001-MAX14002.pdf
> > +
> > +$ref: /schemas/spi/spi-peripheral-props.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,max14001
> > +      - adi,max14002
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  spi-max-frequency:
> > +    maximum: 5000000
> > +
> > +  vdd-supply:
> > +    description:
> > +      Isolated DC-DC power supply input voltage.
> > +
> > +  vddl-supply:
> > +    description:
> > +      Logic power supply.
> > +
> > +  vrefin-supply:
> 
> The actual pin name is REFIN, so refin-supply would make more sense.
> 
> > +    description:
> > +      ADC voltage reference supply.
> > +
> > +  interrupts:
> 
> Likely needs `minItems: 1` in case only one interrupt is wired.
> 
> > +    items:
> > +      - description: |
> > +          Interrupt for signaling when conversion results exceed the configured
> > +          upper threshold for ADC readings or fall below the lower threshold for
> > +          them. Interrupt source must be attached to COUT pin.
> 
> We could shorten these descriptions. The important part is which pin
> it is connected to.
> 
> > +      - description: |
> > +          Alert output that asserts low during a number of different error
> > +          conditions. The interrupt source must be attached to FAULT pin.
> > +
> 
> And also `interrupt-names:` makes sense so we know which one is
> is wired if only one is given.

Additionally, v9 had no interrupts at all but only serviced once device.
Do both devices have the interrupts or should these only be permitted on
the 140002?

> 
> > +required:
> > +  - compatible
> > +  - reg
> > +  - vdd-supply
> > +  - vddl-supply
> > +
Re: [PATCH v10 1/2] dt-bindings: iio: adc: add max14001
Posted by David Lechner 1 month ago
On 9/2/25 9:29 AM, David Lechner wrote:
> On 9/2/25 8:15 AM, Marilene Andrade Garcia wrote:
>> Add device-tree documentation for MAX14001/MAX14002 ADCs.
>> The MAX14001/MAX14002 are isolated, single-channel analog-to-digital
>> converters with programmable voltage comparators and inrush current
>> control optimized for configurable binary input applications.
> 
> When there are multiple devices, DT maintainers like to know
> what is the difference between the devices.
> 
>>
>> Co-developed-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
>> Signed-off-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
>> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> 
> Sine the patch is From: M.A.G., according to [1], this should be:
> 
> Co-developed-by: K.S.P.
> Signed-off-by: K.S.P.
> Signed-off-by: M.A.G.
> 
> (hopefully obvious, but don't use the abbreviations - I just did
> that for brevity)
> 
> [1]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by
> 
>> ---
>>  .../bindings/iio/adc/adi,max14001.yaml        | 79 +++++++++++++++++++
>>  MAINTAINERS                                   |  8 ++
>>  2 files changed, 87 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
>> new file mode 100644
>> index 000000000000..ff9a41f04300
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
>> @@ -0,0 +1,79 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +# Copyright 2023-2025 Analog Devices Inc.
>> +# Copyright 2023 Kim Seer Paller
>> +# Copyright 2025 Marilene Andrade Garcia
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/iio/adc/adi,max14001.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Analog Devices MAX14001-MAX14002 ADC
>> +
>> +maintainers:
>> +  - Kim Seer Paller <kimseer.paller@analog.com>
>> +  - Marilene Andrade Garcia <marilene.agarcia@gmail.com>
>> +
>> +description: |
>> +    Single channel 10 bit ADC with SPI interface.
>> +    Datasheet can be found here
>> +      https://www.analog.com/media/en/technical-documentation/data-sheets/MAX14001-MAX14002.pdf
>> +
>> +$ref: /schemas/spi/spi-peripheral-props.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - adi,max14001
>> +      - adi,max14002

It looks like we could have a fallback here since it looks like
the only difference between the chips is:

	The inrush trigger threshold, current magnitude, and
	current duration are all programmable in the MAX14001
	but are fixed in the MAX14002.

Which would look like this:

    compatible:
      oneOf:
        - const: adi,max14002
        - items:
            - const: adi,max14001
            - const: adi,max14002

And

	compatible = "adi,max14001", "adi,max14002";

>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  spi-max-frequency:
>> +    maximum: 5000000

After reading the driver, I see that we should also have:

	spi-lsb-first: true

as a required property.