Add documentation for Texas Instruments ADS1018 and ADS1118
analog-to-digital converters.
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
.../devicetree/bindings/iio/adc/ti,ads1118.yaml | 132 +++++++++++++++++++++
1 file changed, 132 insertions(+)
diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml
new file mode 100644
index 000000000000..eb7228ed6ddb
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml
@@ -0,0 +1,132 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/ti,ads1118.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI ADS1018/ADS1118 SPI analog to digital converter
+
+maintainers:
+ - Kurt Borja <kuurtb@gmail.com>
+
+description: |
+ The ADS1018/ADS1118 is a precision, low-power, 12-bit or 16-bit, noise-free,
+ analog-to-digital converter (ADC). It integrates a programmable gain amplifier
+ (PGA), voltage reference, oscillator and high-accuracy temperature sensor.
+
+ Datasheets:
+ - ADS1018: https://www.ti.com/lit/ds/symlink/ads1018.pdf
+ - ADS1118: https://www.ti.com/lit/ds/symlink/ads1118.pdf
+
+properties:
+ compatible:
+ enum:
+ - ti,ads1018
+ - ti,ads1118
+
+ reg:
+ maxitems: 1
+
+ interrupts:
+ description: DOUT/DRDY (Data Out/Data Ready) line.
+ maxitems: 1
+
+ drdy-gpios:
+ description:
+ Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows
+ distinguishing between latched and real DRDY IRQs.
+ maxitems: 1
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ '#io-channel-cells':
+ const: 1
+
+required:
+ - compatible
+ - reg
+ - drdy-gpios
+ - '#address-cells'
+ - '#size-cells'
+
+patternProperties:
+ "^channel@[0-7]$":
+ type: object
+ $ref: /schemas/iio/adc/adc.yaml#
+ description: Properties for a single ADC channel.
+
+ properties:
+ reg:
+ minimum: 0
+ maximum: 7
+ description: The channel index (0-7).
+
+ ti,gain:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 0
+ maximum: 5
+ description:
+ Programmable gain amplifier configuration, as described in the PGA
+ Config Register Field description. If not present, the default is
+ used.
+
+ ti,datarate:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 0
+ maximum: 7
+ description:
+ Data rate configuration, as described in the DR Config Register Field
+ description. If not present, the default is used.
+
+ required:
+ - reg
+
+ additionalProperties: false
+
+allOf:
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,ads1018
+ then:
+ patternProperties:
+ "^channel@[0-7]$":
+ properties:
+ ti,datarate:
+ maximum: 6
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ spi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ads1118@0 {
+ compatible = "ti,ads1118";
+ reg = <0>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ spi-max-frequency = <4000000>;
+ spi-cpha;
+
+ interrupts-extended = <&gpio 14 IRQ_TYPE_EDGE_FALLING>;
+ drdy-gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+
+ channel@4 {
+ reg = <4>;
+ ti,gain = <0>;
+ ti,datarate = <7>;
+ };
+ };
+ };
--
2.52.0
On 11/21/25 11:16 AM, Kurt Borja wrote: > Add documentation for Texas Instruments ADS1018 and ADS1118 > analog-to-digital converters. > > Signed-off-by: Kurt Borja <kuurtb@gmail.com> > --- > .../devicetree/bindings/iio/adc/ti,ads1118.yaml | 132 +++++++++++++++++++++ > 1 file changed, 132 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml > new file mode 100644 > index 000000000000..eb7228ed6ddb > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml I like to make the file name match the lowest number. That way it matches the first item in the compatible list. > @@ -0,0 +1,132 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) Better to be specific with GPL-2.0-only or GPL-2.0-or-later (your choice). > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/adc/ti,ads1118.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: TI ADS1018/ADS1118 SPI analog to digital converter > + > +maintainers: > + - Kurt Borja <kuurtb@gmail.com> > + > +description: | > + The ADS1018/ADS1118 is a precision, low-power, 12-bit or 16-bit, noise-free, > + analog-to-digital converter (ADC). It integrates a programmable gain amplifier > + (PGA), voltage reference, oscillator and high-accuracy temperature sensor. > + > + Datasheets: > + - ADS1018: https://www.ti.com/lit/ds/symlink/ads1018.pdf > + - ADS1118: https://www.ti.com/lit/ds/symlink/ads1118.pdf > + > +properties: > + compatible: > + enum: > + - ti,ads1018 > + - ti,ads1118 > + > + reg: > + maxitems: 1 We know the max SCLK rate from the datasheet, so we can add: spi-max-frequency: maximum: 4000000 And we need to explicitly mention this one (it isn't part of spi-peripheral-props.yaml but rather comes from spi-controller.yaml): spi-cpha: true > + > + interrupts: > + description: DOUT/DRDY (Data Out/Data Ready) line. > + maxitems: 1 > + > + drdy-gpios: > + description: > + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows > + distinguishing between latched and real DRDY IRQs. > + maxitems: 1 > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > + '#io-channel-cells': > + const: 1 > + All chips need power, so we should have: vdd-supply: true and make it required. > +required: > + - compatible > + - reg > + - drdy-gpios The chip can be used without needing the DRDY signal, so drdy-gpios and interrupts should not be required. > + - '#address-cells' > + - '#size-cells' > + > +patternProperties: > + "^channel@[0-7]$": > + type: object > + $ref: /schemas/iio/adc/adc.yaml# > + description: Properties for a single ADC channel. > + > + properties: > + reg: > + minimum: 0 > + maximum: 7 > + description: The channel index (0-7). > + > + ti,gain: > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 0 > + maximum: 5 > + description: > + Programmable gain amplifier configuration, as described in the PGA > + Config Register Field description. If not present, the default is > + used. The gain is programmable, so normally, we would set that by writing to the in_voltageY_scale attribute rather than hard-coding it in the devicetree. > + > + ti,datarate: > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 0 > + maximum: 7 > + description: > + Data rate configuration, as described in the DR Config Register Field > + description. If not present, the default is used. Likewise, the data rate should be set at runtime using a sampling_frequency attribute rather than being hard-coded in the devicetree. > + > + required: > + - reg > + > + additionalProperties: false > + So we shouldn't need explicit channel properties at this time.
On Fri Nov 21, 2025 at 5:32 PM -05, David Lechner wrote: > On 11/21/25 11:16 AM, Kurt Borja wrote: >> Add documentation for Texas Instruments ADS1018 and ADS1118 >> analog-to-digital converters. >> >> Signed-off-by: Kurt Borja <kuurtb@gmail.com> >> --- >> .../devicetree/bindings/iio/adc/ti,ads1118.yaml | 132 +++++++++++++++++++++ >> 1 file changed, 132 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml >> new file mode 100644 >> index 000000000000..eb7228ed6ddb >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml > > I like to make the file name match the lowest number. That way it matches > the first item in the compatible list. > >> @@ -0,0 +1,132 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > Better to be specific with GPL-2.0-only or GPL-2.0-or-later (your choice). I will go for GPL-2.0-only on both files. > >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/iio/adc/ti,ads1118.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: TI ADS1018/ADS1118 SPI analog to digital converter >> + >> +maintainers: >> + - Kurt Borja <kuurtb@gmail.com> >> + >> +description: | >> + The ADS1018/ADS1118 is a precision, low-power, 12-bit or 16-bit, noise-free, >> + analog-to-digital converter (ADC). It integrates a programmable gain amplifier >> + (PGA), voltage reference, oscillator and high-accuracy temperature sensor. >> + >> + Datasheets: >> + - ADS1018: https://www.ti.com/lit/ds/symlink/ads1018.pdf >> + - ADS1118: https://www.ti.com/lit/ds/symlink/ads1118.pdf >> + >> +properties: >> + compatible: >> + enum: >> + - ti,ads1018 >> + - ti,ads1118 >> + >> + reg: >> + maxitems: 1 > > We know the max SCLK rate from the datasheet, so we can add: > > spi-max-frequency: > maximum: 4000000 > > And we need to explicitly mention this one (it isn't part of > spi-peripheral-props.yaml but rather comes from spi-controller.yaml): > > spi-cpha: true > >> + >> + interrupts: >> + description: DOUT/DRDY (Data Out/Data Ready) line. >> + maxitems: 1 >> + >> + drdy-gpios: >> + description: >> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows >> + distinguishing between latched and real DRDY IRQs. >> + maxitems: 1 >> + >> + '#address-cells': >> + const: 1 >> + >> + '#size-cells': >> + const: 0 >> + >> + '#io-channel-cells': >> + const: 1 >> + > > All chips need power, so we should have: > > vdd-supply: true > > and make it required. > >> +required: >> + - compatible >> + - reg >> + - drdy-gpios > > The chip can be used without needing the DRDY signal, so drdy-gpios and > interrupts should not be required. > >> + - '#address-cells' >> + - '#size-cells' >> + >> +patternProperties: >> + "^channel@[0-7]$": >> + type: object >> + $ref: /schemas/iio/adc/adc.yaml# >> + description: Properties for a single ADC channel. >> + >> + properties: >> + reg: >> + minimum: 0 >> + maximum: 7 >> + description: The channel index (0-7). >> + >> + ti,gain: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + minimum: 0 >> + maximum: 5 >> + description: >> + Programmable gain amplifier configuration, as described in the PGA >> + Config Register Field description. If not present, the default is >> + used. > > The gain is programmable, so normally, we would set that by writing > to the in_voltageY_scale attribute rather than hard-coding it in the > devicetree. > >> + >> + ti,datarate: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + minimum: 0 >> + maximum: 7 >> + description: >> + Data rate configuration, as described in the DR Config Register Field >> + description. If not present, the default is used. > > Likewise, the data rate should be set at runtime using a > sampling_frequency attribute rather than being hard-coded > in the devicetree. I actually took this approach from ti-ads1015. I was debating this myself. I'll gladly drop these. > >> + >> + required: >> + - reg >> + >> + additionalProperties: false >> + > So we shouldn't need explicit channel properties at this time. Ack for the rest of comments. -- ~ Kurt
On 21/11/2025 18:16, Kurt Borja wrote:
> Add documentation for Texas Instruments ADS1018 and ADS1118
> analog-to-digital converters.
>
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
You did not test it before sending, so no full review but few nits to
save you one round of reviews:
> ---
> .../devicetree/bindings/iio/adc/ti,ads1118.yaml | 132 +++++++++++++++++++++
> 1 file changed, 132 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml
> new file mode 100644
> index 000000000000..eb7228ed6ddb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml
> @@ -0,0 +1,132 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/ti,ads1118.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TI ADS1018/ADS1118 SPI analog to digital converter
> +
> +maintainers:
> + - Kurt Borja <kuurtb@gmail.com>
> +
> +description: |
> + The ADS1018/ADS1118 is a precision, low-power, 12-bit or 16-bit, noise-free,
> + analog-to-digital converter (ADC). It integrates a programmable gain amplifier
> + (PGA), voltage reference, oscillator and high-accuracy temperature sensor.
> +
> + Datasheets:
> + - ADS1018: https://www.ti.com/lit/ds/symlink/ads1018.pdf
> + - ADS1118: https://www.ti.com/lit/ds/symlink/ads1118.pdf
> +
> +properties:
> + compatible:
> + enum:
> + - ti,ads1018
> + - ti,ads1118
> +
> + reg:
> + maxitems: 1
> +
> + interrupts:
> + description: DOUT/DRDY (Data Out/Data Ready) line.
> + maxitems: 1
> +
> + drdy-gpios:
> + description:
> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows
> + distinguishing between latched and real DRDY IRQs.
I have feeling that you miss proper handling of IRQs (e.g. active level)
on your board.
> + maxitems: 1
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + '#io-channel-cells':
> + const: 1
> +
> +required:
This goes after patternProperties.
> + - compatible
> + - reg
> + - drdy-gpios
> + - '#address-cells'
> + - '#size-cells'
> +
> +patternProperties:
> + "^channel@[0-7]$":
> + type: object
> + $ref: /schemas/iio/adc/adc.yaml#
> + description: Properties for a single ADC channel.
> +
> + properties:
> + reg:
> + minimum: 0
> + maximum: 7
> + description: The channel index (0-7).
> +
> + ti,gain:
Use common property units.
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 0
> + maximum: 5
> + description:
> + Programmable gain amplifier configuration, as described in the PGA
> + Config Register Field description. If not present, the default is
> + used.
> +
> + ti,datarate:
Use common property units.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 0
> + maximum: 7
> + description:
> + Data rate configuration, as described in the DR Config Register Field
> + description. If not present, the default is used.
default:
> +
> + required:
> + - reg
> +
> + additionalProperties: false
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: ti,ads1018
> + then:
> + patternProperties:
> + "^channel@[0-7]$":
> + properties:
> + ti,datarate:
> + maximum: 6
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + spi0 {
spi
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ads1118@0 {
Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel
sources for similar cases or you can grow the spec (via pull request to
DT spec repo).
e.g. adc
> + compatible = "ti,ads1118";
Best regards,
Krzysztof
Hi Krzysztof,
On Fri Nov 21, 2025 at 2:10 PM -05, Krzysztof Kozlowski wrote:
> On 21/11/2025 18:16, Kurt Borja wrote:
>> Add documentation for Texas Instruments ADS1018 and ADS1118
>> analog-to-digital converters.
>>
>> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
>
> You did not test it before sending, so no full review but few nits to
> save you one round of reviews:
My bad! I will fix the errors. Thanks!
>
>> ---
>> .../devicetree/bindings/iio/adc/ti,ads1118.yaml | 132 +++++++++++++++++++++
>> 1 file changed, 132 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml
>> new file mode 100644
>> index 000000000000..eb7228ed6ddb
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml
>> @@ -0,0 +1,132 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/iio/adc/ti,ads1118.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: TI ADS1018/ADS1118 SPI analog to digital converter
>> +
>> +maintainers:
>> + - Kurt Borja <kuurtb@gmail.com>
>> +
>> +description: |
>> + The ADS1018/ADS1118 is a precision, low-power, 12-bit or 16-bit, noise-free,
>> + analog-to-digital converter (ADC). It integrates a programmable gain amplifier
>> + (PGA), voltage reference, oscillator and high-accuracy temperature sensor.
>> +
>> + Datasheets:
>> + - ADS1018: https://www.ti.com/lit/ds/symlink/ads1018.pdf
>> + - ADS1118: https://www.ti.com/lit/ds/symlink/ads1118.pdf
>> +
>> +properties:
>> + compatible:
>> + enum:
>> + - ti,ads1018
>> + - ti,ads1118
>> +
>> + reg:
>> + maxitems: 1
>> +
>> + interrupts:
>> + description: DOUT/DRDY (Data Out/Data Ready) line.
>> + maxitems: 1
>> +
>> + drdy-gpios:
>> + description:
>> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows
>> + distinguishing between latched and real DRDY IRQs.
>
> I have feeling that you miss proper handling of IRQs (e.g. active level)
> on your board.
Can you elaborate? Should I specify active level here?
>
>> + maxitems: 1
>> +
>> + '#address-cells':
>> + const: 1
>> +
>> + '#size-cells':
>> + const: 0
>> +
>> + '#io-channel-cells':
>> + const: 1
>> +
>> +required:
>
> This goes after patternProperties.
>
>> + - compatible
>> + - reg
>> + - drdy-gpios
>> + - '#address-cells'
>> + - '#size-cells'
>> +
>> +patternProperties:
>> + "^channel@[0-7]$":
>> + type: object
>> + $ref: /schemas/iio/adc/adc.yaml#
>> + description: Properties for a single ADC channel.
>> +
>> + properties:
>> + reg:
>> + minimum: 0
>> + maximum: 7
>> + description: The channel index (0-7).
>> +
>> + ti,gain:
>
> Use common property units.
>
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
>
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + minimum: 0
>> + maximum: 5
>> + description:
>> + Programmable gain amplifier configuration, as described in the PGA
>> + Config Register Field description. If not present, the default is
>> + used.
>> +
>> + ti,datarate:
>
> Use common property units.
>
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + minimum: 0
>> + maximum: 7
>> + description:
>> + Data rate configuration, as described in the DR Config Register Field
>> + description. If not present, the default is used.
>
> default:
>
>> +
>> + required:
>> + - reg
>> +
>> + additionalProperties: false
>> +
>> +allOf:
>> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
>> +
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + const: ti,ads1018
>> + then:
>> + patternProperties:
>> + "^channel@[0-7]$":
>> + properties:
>> + ti,datarate:
>> + maximum: 6
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> + - |
>> + spi0 {
>
> spi
>
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + ads1118@0 {
>
>
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> If you cannot find a name matching your device, please check in kernel
> sources for similar cases or you can grow the spec (via pull request to
> DT spec repo).
>
> e.g. adc
>
>
>> + compatible = "ti,ads1118";
> Best regards,
> Krzysztof
Ack for the rest. Thank you!
--
~ Kurt
On 11/21/25 2:56 PM, Kurt Borja wrote: > Hi Krzysztof, > > On Fri Nov 21, 2025 at 2:10 PM -05, Krzysztof Kozlowski wrote: >> On 21/11/2025 18:16, Kurt Borja wrote: >>> Add documentation for Texas Instruments ADS1018 and ADS1118 >>> analog-to-digital converters. >>> >>> Signed-off-by: Kurt Borja <kuurtb@gmail.com> >> >> You did not test it before sending, so no full review but few nits to >> save you one round of reviews: > > My bad! I will fix the errors. Thanks! > ... >>> + interrupts: >>> + description: DOUT/DRDY (Data Out/Data Ready) line. >>> + maxitems: 1 >>> + >>> + drdy-gpios: >>> + description: >>> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows >>> + distinguishing between latched and real DRDY IRQs. >> >> I have feeling that you miss proper handling of IRQs (e.g. active level) >> on your board. > > Can you elaborate? Should I specify active level here? > >> The problem is not about the levels. It is rather that the behavior of the interrupt when disabled/masked is different on different interrupt controllers. On some controllers, if an event happens while disabled/masked, it "remembers" that and will trigger the interrupt as soon as it is enabled even if the condition doesn't exist anymore. Not a great hardware design IMHO, but there is real hardware that does this. I think a better wording would be to leave out "latched" and say that it is needed to be able to distinguish between an interrupt triggered by the DRDY signal vs. an interrupt triggered by SPI data.
On 21/11/2025 23:40, David Lechner wrote: > On 11/21/25 2:56 PM, Kurt Borja wrote: >> Hi Krzysztof, >> >> On Fri Nov 21, 2025 at 2:10 PM -05, Krzysztof Kozlowski wrote: >>> On 21/11/2025 18:16, Kurt Borja wrote: >>>> Add documentation for Texas Instruments ADS1018 and ADS1118 >>>> analog-to-digital converters. >>>> >>>> Signed-off-by: Kurt Borja <kuurtb@gmail.com> >>> >>> You did not test it before sending, so no full review but few nits to >>> save you one round of reviews: >> >> My bad! I will fix the errors. Thanks! >> > > ... > >>>> + interrupts: >>>> + description: DOUT/DRDY (Data Out/Data Ready) line. >>>> + maxitems: 1 >>>> + >>>> + drdy-gpios: >>>> + description: >>>> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows >>>> + distinguishing between latched and real DRDY IRQs. >>> >>> I have feeling that you miss proper handling of IRQs (e.g. active level) >>> on your board. >> >> Can you elaborate? Should I specify active level here? >> >>> > The problem is not about the levels. It is rather that the behavior of the > interrupt when disabled/masked is different on different interrupt controllers. > > On some controllers, if an event happens while disabled/masked, it "remembers" > that and will trigger the interrupt as soon as it is enabled even if the > condition doesn't exist anymore. Not a great hardware design IMHO, but there > is real hardware that does this. Isn't it misconfiguration of trigger as I said before? It should be for example edge, instead of level? Best regards, Krzysztof
On 11/22/25 3:34 AM, Krzysztof Kozlowski wrote: > On 21/11/2025 23:40, David Lechner wrote: >> On 11/21/25 2:56 PM, Kurt Borja wrote: >>> Hi Krzysztof, >>> >>> On Fri Nov 21, 2025 at 2:10 PM -05, Krzysztof Kozlowski wrote: >>>> On 21/11/2025 18:16, Kurt Borja wrote: >>>>> Add documentation for Texas Instruments ADS1018 and ADS1118 >>>>> analog-to-digital converters. >>>>> >>>>> Signed-off-by: Kurt Borja <kuurtb@gmail.com> >>>> >>>> You did not test it before sending, so no full review but few nits to >>>> save you one round of reviews: >>> >>> My bad! I will fix the errors. Thanks! >>> >> >> ... >> >>>>> + interrupts: >>>>> + description: DOUT/DRDY (Data Out/Data Ready) line. >>>>> + maxitems: 1 >>>>> + >>>>> + drdy-gpios: >>>>> + description: >>>>> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows >>>>> + distinguishing between latched and real DRDY IRQs. >>>> >>>> I have feeling that you miss proper handling of IRQs (e.g. active level) >>>> on your board. >>> >>> Can you elaborate? Should I specify active level here? >>> >>>> >> The problem is not about the levels. It is rather that the behavior of the >> interrupt when disabled/masked is different on different interrupt controllers. >> >> On some controllers, if an event happens while disabled/masked, it "remembers" >> that and will trigger the interrupt as soon as it is enabled even if the >> condition doesn't exist anymore. Not a great hardware design IMHO, but there >> is real hardware that does this. > > Isn't it misconfiguration of trigger as I said before? It should be for > example edge, instead of level? > > Best regards, > Krzysztof No. It it still works like this for edge triggers.
On 22/11/2025 16:09, David Lechner wrote: >>> ... >>> >>>>>> + interrupts: >>>>>> + description: DOUT/DRDY (Data Out/Data Ready) line. >>>>>> + maxitems: 1 >>>>>> + >>>>>> + drdy-gpios: >>>>>> + description: >>>>>> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows >>>>>> + distinguishing between latched and real DRDY IRQs. >>>>> >>>>> I have feeling that you miss proper handling of IRQs (e.g. active level) >>>>> on your board. >>>> >>>> Can you elaborate? Should I specify active level here? >>>> >>>>> >>> The problem is not about the levels. It is rather that the behavior of the >>> interrupt when disabled/masked is different on different interrupt controllers. >>> >>> On some controllers, if an event happens while disabled/masked, it "remembers" >>> that and will trigger the interrupt as soon as it is enabled even if the >>> condition doesn't exist anymore. Not a great hardware design IMHO, but there >>> is real hardware that does this. >> >> Isn't it misconfiguration of trigger as I said before? It should be for >> example edge, instead of level? >> >> Best regards, >> Krzysztof > > No. It it still works like this for edge triggers. OK, I still have doubts because it feels like we are adding workaround for controller issues in device bindings. I don't recall how this was solved (or if it was at all) in other cases, so fine for now for me. Best regards, Krzysztof
On Fri Nov 21, 2025 at 5:40 PM -05, David Lechner wrote: > On 11/21/25 2:56 PM, Kurt Borja wrote: >> Hi Krzysztof, >> >> On Fri Nov 21, 2025 at 2:10 PM -05, Krzysztof Kozlowski wrote: >>> On 21/11/2025 18:16, Kurt Borja wrote: >>>> Add documentation for Texas Instruments ADS1018 and ADS1118 >>>> analog-to-digital converters. >>>> >>>> Signed-off-by: Kurt Borja <kuurtb@gmail.com> >>> >>> You did not test it before sending, so no full review but few nits to >>> save you one round of reviews: >> >> My bad! I will fix the errors. Thanks! >> > > ... > >>>> + interrupts: >>>> + description: DOUT/DRDY (Data Out/Data Ready) line. >>>> + maxitems: 1 >>>> + >>>> + drdy-gpios: >>>> + description: >>>> + Extra GPIO line connected to DOUT/DRDY (Data Out/Data Ready). This allows >>>> + distinguishing between latched and real DRDY IRQs. >>> >>> I have feeling that you miss proper handling of IRQs (e.g. active level) >>> on your board. >> >> Can you elaborate? Should I specify active level here? >> >>> > The problem is not about the levels. It is rather that the behavior of the > interrupt when disabled/masked is different on different interrupt controllers. > > On some controllers, if an event happens while disabled/masked, it "remembers" > that and will trigger the interrupt as soon as it is enabled even if the > condition doesn't exist anymore. Not a great hardware design IMHO, but there > is real hardware that does this. I can attest to that. My hardware (RPI 5) does this haha. > > I think a better wording would be to leave out "latched" and say that > it is needed to be able to distinguish between an interrupt triggered > by the DRDY signal vs. an interrupt triggered by SPI data. I'll take this wording, thanks. -- ~ Kurt
On Fri, 21 Nov 2025 12:16:14 -0500, Kurt Borja wrote:
> Add documentation for Texas Instruments ADS1018 and ADS1118
> analog-to-digital converters.
>
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> .../devicetree/bindings/iio/adc/ti,ads1118.yaml | 132 +++++++++++++++++++++
> 1 file changed, 132 insertions(+)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
./Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml:93:8: [error] empty value in block mapping (empty-values)
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: ignoring, error in schema: allOf: 1: if
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: properties:reg: 'anyOf' conditional failed, one must be fixed:
'maxitems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
'type' was expected
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: properties:drdy-gpios: 'anyOf' conditional failed, one must be fixed:
'maxitems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
'type' was expected
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: properties:interrupts: 'anyOf' conditional failed, one must be fixed:
'maxitems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
'type' was expected
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: properties:reg: 'anyOf' conditional failed, one must be fixed:
'maxItems' is a required property
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
'maxitems' is not one of ['maxItems', 'description', 'deprecated']
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
Additional properties are not allowed ('maxitems' was unexpected)
hint: Arrays must be described with a combination of minItems/maxItems/items
'maxitems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
from schema $id: http://devicetree.org/meta-schemas/cell.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: properties:drdy-gpios: 'anyOf' conditional failed, one must be fixed:
'maxItems' is a required property
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
'maxitems' is not one of ['maxItems', 'description', 'deprecated']
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
Additional properties are not allowed ('maxitems' was unexpected)
hint: Arrays must be described with a combination of minItems/maxItems/items
'maxitems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
from schema $id: http://devicetree.org/meta-schemas/cell.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: properties:interrupts: 'anyOf' conditional failed, one must be fixed:
'maxItems' is a required property
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
'maxitems' is not one of ['maxItems', 'description', 'deprecated']
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
Additional properties are not allowed ('maxitems' was unexpected)
hint: Arrays must be described with a combination of minItems/maxItems/items
'maxitems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
from schema $id: http://devicetree.org/meta-schemas/cell.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: allOf:1:if: None is not of type 'object', 'boolean'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: allOf:1:if: None is not of type 'object', 'boolean'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: allOf:1:if: None is not of type 'object', 'boolean'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: allOf:1:if: None is not of type 'object', 'boolean'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: allOf:1:if: None is not of type 'object', 'boolean'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: allOf:1:if: None is not of type 'object', 'boolean'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,ads1118.yaml: allOf:1:if: None is not of type 'object', 'boolean'
Traceback (most recent call last):
File "/usr/local/bin/dt-doc-validate", line 8, in <module>
sys.exit(main())
~~~~^^
File "/usr/local/lib/python3.13/dist-packages/dtschema/doc_validate.py", line 66, in main
ret |= check_doc(f)
~~~~~~~~~^^^
File "/usr/local/lib/python3.13/dist-packages/dtschema/doc_validate.py", line 37, in check_doc
dtsch.check_schema_refs()
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/dist-packages/dtschema/schema.py", line 241, in check_schema_refs
self._check_schema_refs(resolver, self)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/dist-packages/dtschema/schema.py", line 212, in _check_schema_refs
self._check_schema_refs(resolver, v, parent=k, is_common=is_common,
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
has_constraint=has_constraint)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/dist-packages/dtschema/schema.py", line 212, in _check_schema_refs
self._check_schema_refs(resolver, v, parent=k, is_common=is_common,
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
has_constraint=has_constraint)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/dist-packages/dtschema/schema.py", line 203, in _check_schema_refs
ref_sch = resolver.lookup(schema['$ref']).contents
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/dist-packages/referencing/_core.py", line 682, in lookup
retrieved = self._registry.get_or_retrieve(uri)
File "/usr/local/lib/python3.13/dist-packages/referencing/_core.py", line 422, in get_or_retrieve
registry = self.crawl()
File "/usr/local/lib/python3.13/dist-packages/referencing/_core.py", line 500, in crawl
id = resource.id()
File "/usr/local/lib/python3.13/dist-packages/referencing/_core.py", line 231, in id
id = self._specification.id_of(self.contents)
File "/usr/local/lib/python3.13/dist-packages/referencing/jsonschema.py", line 50, in _dollar_id
return contents.get("$id")
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Lexical error: Documentation/devicetree/bindings/iio/adc/ti,ads1118.example.dts:32.49-70 Unexpected 'IRQ_TYPE_EDGE_FALLING'
Lexical error: Documentation/devicetree/bindings/iio/adc/ti,ads1118.example.dts:33.40-55 Unexpected 'GPIO_ACTIVE_LOW'
FATAL ERROR: Syntax error parsing input tree
make[2]: *** [scripts/Makefile.dtbs:132: Documentation/devicetree/bindings/iio/adc/ti,ads1118.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1525: dt_binding_check] Error 2
make: *** [Makefile:248: __sub-make] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20251121-ads1x18-v1-1-86db080fc9a4@gmail.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
© 2016 - 2025 Red Hat, Inc.