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.
They share the same features, but in the MAX14001 the inrush trigger
threshold, current magnitude, and current duration are all programmable,
whereas in the MAX14002 these parameters are fixed.
Co-developed-by: Kim Seer Paller <kimseer.paller@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Signed-off-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
---
I have addressed almost all of the comments, thank you very much for the
review. I would like to highlight some of them:
Changes since v10:
- Changed the name to refin-supply.
- Added interrupt-names property.
- Added minItems in the interrupt property and shortened the descriptions.
- Added the fallback in the compatible property.
Change I was not able to do:
- Add the spi-lsb-first required property, even though I totally agree that
it needs to be used. However, the SPI controller that I am using does not
support SPI_LSB_FIRST, and this was leading to errors. Therefore, I suggest
keeping it without the property for now and using bitrev16 in the driver
code. As soon as I finish working on this driver, I intend to submit
patches to the SPI kernel code to handle bit reverse operation when the SPI
controller does not support it. Once that is integrated into the kernel, I
will update the driver code accordingly; I have left a TODO message in the
ADC driver code about it.
Notes:
Since v10, I have not used exactly the same approach as Kim did in v9, nor
the same approach as in my v1. Instead, I merged both implementations, and
this v11 is quite different from both. Therefore, I have dropped the review
by Krzysztof Kozlowski. I am not very familiar with the kernel’s review
process, should I add it back? Should I list your names as Reviewed-by?
Thanks.
The MAX14001 and MAX14002 both have the COUT output pin and the FAULT
output pin, and work the same. I have decided to declare them as interrupts
because I think some action should be done when they are hit. However, the
implementation of these features is not present in the v11 driver code, as
it was not in v9. But I plan to submit it in the next steps.
.../bindings/iio/adc/adi,max14001.yaml | 87 +++++++++++++++++++
MAINTAINERS | 8 ++
2 files changed, 95 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..c61119b16cf5
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml
@@ -0,0 +1,87 @@
+# 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:
+ oneOf:
+ - const: adi,max14002
+ - items:
+ - const: adi,max14001
+ - const: 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.
+
+ refin-supply:
+ description:
+ ADC voltage reference supply.
+
+ interrupts:
+ minItems: 1
+ items:
+ - description: |
+ Asserts high when ADC readings exceed the upper threshold and low
+ when below the lower threshold. Must be connected to the COUT pin.
+ - description: |
+ Alert output that asserts low during a number of different error
+ conditions. The interrupt source must be attached to FAULT pin.
+
+ interrupt-names:
+ minItems: 1
+ items:
+ - const: cout
+ - const: fault
+
+required:
+ - compatible
+ - reg
+ - vdd-supply
+ - vddl-supply
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ max14001: adc@0 {
+ compatible = "adi,max14001", "adi,max14002";
+ reg = <0>;
+ spi-max-frequency = <5000000>;
+ vdd-supply = <&vdd>;
+ vddl-supply = <&vddl>;
+ };
+ };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index d53a536288ca..0bae420caa63 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14991,6 +14991,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
On 9/15/25 5:16 PM, Marilene Andrade Garcia wrote: ... > Notes: > Since v10, I have not used exactly the same approach as Kim did in v9, nor > the same approach as in my v1. Instead, I merged both implementations, and > this v11 is quite different from both. Therefore, I have dropped the review > by Krzysztof Kozlowski. I am not very familiar with the kernel’s review > process, should I add it back? Should I list your names as Reviewed-by? > Thanks. I think you made the right judgement call here. The changes are significant enough to deserve another look. And you did the right thing by explaining why you dropped the review tags. > > The MAX14001 and MAX14002 both have the COUT output pin and the FAULT > output pin, and work the same. I have decided to declare them as interrupts > because I think some action should be done when they are hit. However, the > implementation of these features is not present in the v11 driver code, as > it was not in v9. But I plan to submit it in the next steps. The devicetree bindings should be as complete as possible and not care if the driver doesn't use everything. So adding them now is the right thing to do. > > > .../bindings/iio/adc/adi,max14001.yaml | 87 +++++++++++++++++++ > MAINTAINERS | 8 ++ > 2 files changed, 95 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..c61119b16cf5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/adi,max14001.yaml > @@ -0,0 +1,87 @@ > +# 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: > + oneOf: > + - const: adi,max14002 > + - items: > + - const: adi,max14001 > + - const: 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. > + > + refin-supply: > + description: > + ADC voltage reference supply. > + > + interrupts: > + minItems: 1 > + items: > + - description: | > + Asserts high when ADC readings exceed the upper threshold and low > + when below the lower threshold. Must be connected to the COUT pin. > + - description: | > + Alert output that asserts low during a number of different error > + conditions. The interrupt source must be attached to FAULT pin. > + I don't think the `|` is needed here. It is only needed when formatting should be preserved, e.g. you have paragraphs or a list. Or when there are certain characters like `:` in the text. But neither are the case here. > + interrupt-names: > + minItems: 1 > + items: > + - const: cout > + - const: fault > + > +required: > + - compatible > + - reg > + - vdd-supply > + - vddl-supply > + > +unevaluatedProperties: false > + > +examples: > + - | > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + max14001: adc@0 { > + compatible = "adi,max14001", "adi,max14002"; > + reg = <0>; > + spi-max-frequency = <5000000>; I would add: spi-lsb-first; to this example so that people know it is a possibility. I don't think we need to list it in the properties though since it is included by $ref: /schemas/spi/spi-peripheral-props.yaml#. > + vdd-supply = <&vdd>; > + vddl-supply = <&vddl>; > + }; > + }; > +...
On Tue, Sep 16, 2025 at 11:40:47AM -0500, David Lechner wrote: > On 9/15/25 5:16 PM, Marilene Andrade Garcia wrote: > > > > The MAX14001 and MAX14002 both have the COUT output pin and the FAULT > > output pin, and work the same. I have decided to declare them as interrupts > > because I think some action should be done when they are hit. However, the > > implementation of these features is not present in the v11 driver code, as > > it was not in v9. But I plan to submit it in the next steps. > > The devicetree bindings should be as complete as possible and not care > if the driver doesn't use everything. So adding them now is the right > thing to do. > > + interrupts: > > + minItems: 1 > > + items: > > + - description: | > > + Asserts high when ADC readings exceed the upper threshold and low > > + when below the lower threshold. Must be connected to the COUT pin. > > + - description: | > > + Alert output that asserts low during a number of different error > > + conditions. The interrupt source must be attached to FAULT pin. These descriptions read wrong to me. They __are__ the COUT and FAULT pins, given what David responded to above, not something that can be connected to these pins (if they were, they would be represented as -gpios rather than interrupts most likely). Unless you mean that these pins can have some other use and are only available on the COUT/FAULT pins when some register value is set - but even in that case saying "must be" doesn't fit since the interrupt property could be used to configure the device accordingly.
© 2016 - 2025 Red Hat, Inc.