* Re: [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
2026-05-30 13:31 [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor Taha Narimani
@ 2026-05-30 10:43 ` sashiko-bot
2026-05-30 13:53 ` Taha Narimani
1 sibling, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-05-30 10:43 UTC (permalink / raw)
To: Taha Narimani; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing conditional device tree schema constraints for `busy-gpios`
--
commit b1de64cf7a950c655f529289b45b50bb4b5224f5
Author: Taha Narimani <tahanarimani3443@gmail.com>
dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
This commit adds the YAML device tree binding schema for the Analog Devices
AD7816, AD7817, and AD7818 temperature sensors. It defines the required
properties and resolves checkpatch warnings for undocumented bindings.
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> new file mode 100644
> index 0000000000000..7f6a3e5dfcf40
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
[ ... ]
> + busy-gpios:
> + maxItems: 1
> + description: GPIO connected to the BUSY pin. Only applicable for AD7816 and AD7817.
> +
> + interrupts:
> + maxItems: 1
> + description: OTI (Over Temperature Indicator) interrupt.
> +
> +required:
> + - compatible
> + - reg
> + - rdwr-gpios
> + - convert-gpios
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
[Severity: Low]
Does this binding need conditional rules to enforce the busy-gpios
requirement?
The property description states that busy-gpios is only applicable for
AD7816 and AD7817. Because it lacks structural enforcement, an adi,ad7818
node could incorrectly include a busy-gpios property and pass schema
validation, while an adi,ad7816 node could incorrectly omit it.
Could an if-then conditional block be added here to restrict busy-gpios
usage based on the compatible string? The ad7816 driver strictly requires
this GPIO for the AD7816 and AD7817 variants and will fail to probe with
-ENOENT if it is missing.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260530133126.54460-1-tahanarimani3443@gmail.com?part=1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
2026-05-30 13:53 ` Taha Narimani
@ 2026-05-30 11:06 ` sashiko-bot
[not found] ` <CAEsNvj8Q3n3-tuPhANfRjUfqrnCtzfguuRKL0OrwCEEkSXrUaw@mail.gmail.com>
2026-05-30 14:58 ` Jonathan Cameron
1 sibling, 1 reply; 8+ messages in thread
From: sashiko-bot @ 2026-05-30 11:06 UTC (permalink / raw)
To: Taha Narimani; +Cc: robh, devicetree, conor+dt
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing concurrency protection during sysfs accesses.
- [High] Stack-allocated buffers are passed directly to `spi_read()` and `spi_write()`, violating DMA mapping rules.
- [High] Unbounded polling loop for the BUSY pin can cause a hard CPU lockup.
--
commit cb7e57cc9cdde2668abda84c0f0d3e60ebb9a962
Author: Taha Narimani <tahanarimani3443@gmail.com>
dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
This commit adds a new YAML device tree binding schema for the Analog
Devices AD7816, AD7817, and AD7818 digital temperature sensors. It
documents the compatible strings, SPI configuration, interrupts, and
required GPIO pins.
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> new file mode 100644
> index 0000000000000..74008c14d40c6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> @@ -0,0 +1,87 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/adi,ad7816.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
[ ... ]
> +properties:
> + compatible:
> + enum:
> + - adi,ad7816
> + - adi,ad7817
> + - adi,ad7818
[Severity: High]
This isn't a bug introduced by this patch, but is there a missing lock to
protect concurrent sysfs accesses?
Looking at ad7816_show_value() in drivers/staging/iio/adc/ad7816.c:
drivers/staging/iio/adc/ad7816.c:ad7816_show_value() {
...
ret = ad7816_spi_read(chip, &data);
...
}
Since this is called for world-readable sysfs attributes, can multiple
userspace processes trigger this concurrently?
If so, could concurrent execution of ad7816_spi_read() interleave GPIO pin
toggling and SPI transfers, corrupting the hardware state?
[Severity: High]
This isn't a bug introduced by this patch, but does this code pass
stack-allocated buffers to SPI transfers?
Looking at drivers/staging/iio/adc/ad7816.c:
drivers/staging/iio/adc/ad7816.c:ad7816_spi_read() {
...
ret = spi_read(spi_dev, &buf, sizeof(*data));
...
}
And also in ad7816_spi_write():
drivers/staging/iio/adc/ad7816.c:ad7816_spi_write() {
...
ret = spi_write(spi_dev, &data, sizeof(data));
...
}
Since the SPI subsystem often maps these buffers for DMA, will passing
variables from the stack cause mapping failures or crashes on architectures
with virtually mapped kernel stacks?
[Severity: High]
This isn't a bug introduced by this patch, but can this unbounded polling
loop cause a CPU lockup?
Looking at ad7816_spi_read() in drivers/staging/iio/adc/ad7816.c:
drivers/staging/iio/adc/ad7816.c:ad7816_spi_read() {
...
while (gpiod_get_value(chip->busy_pin))
cpu_relax();
...
}
If the external device malfunctions or the GPIO line gets permanently stuck
high, will this loop block indefinitely and cause a hard lockup?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260530135302.54688-1-tahanarimani3443@gmail.com?part=1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
[not found] ` <CAEsNvj8Q3n3-tuPhANfRjUfqrnCtzfguuRKL0OrwCEEkSXrUaw@mail.gmail.com>
@ 2026-05-30 11:21 ` Taha Narimani
0 siblings, 0 replies; 8+ messages in thread
From: Taha Narimani @ 2026-05-30 11:21 UTC (permalink / raw)
To: sashiko-reviews; +Cc: robh, devicetree, conor+dt
Hi,
Thank you for the detailed analysis and for pointing out these issues.
I would like to clarify that these are pre-existing issues in the
driver and were not introduced by my documentation patch. My current
goal is limited to adding the missing Device Tree bindings to resolve
the checkpatch.pl warnings.
I acknowledge that the driver has issues regarding concurrency
protection, DMA mapping, and polling loops. I intend to focus on those
in a separate, subsequent patch series after this one is merged, as I
believe refactoring the driver logic requires a broader scope.
Thank you for your patience and for reviewing my contribution.
Best regards, Taha Narimani
On Sat, May 30, 2026 at 2:41 PM Taha Narimani
<tahanarimani3443@gmail.com> wrote:
>
> Hi,
>
> Thank you for the detailed analysis and for pointing out these issues.
>
> I would like to clarify that these are pre-existing issues in the driver and were not introduced by my documentation patch. My current goal is limited to adding the missing Device Tree bindings to resolve the checkpatch.pl warnings.
>
> I acknowledge that the driver has issues regarding concurrency protection, DMA mapping, and polling loops. I intend to focus on those in a separate, subsequent patch series after this one is merged, as I believe refactoring the driver logic requires a broader scope.
>
> Thank you for your patience and for reviewing my contribution.
>
> Best regards, Taha Narimani
>
>
> On Sat, May 30, 2026 at 2:36 PM <sashiko-bot@kernel.org> wrote:
>>
>> Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
>>
>> Pre-existing issues:
>> - [High] Missing concurrency protection during sysfs accesses.
>> - [High] Stack-allocated buffers are passed directly to `spi_read()` and `spi_write()`, violating DMA mapping rules.
>> - [High] Unbounded polling loop for the BUSY pin can cause a hard CPU lockup.
>> --
>>
>> commit cb7e57cc9cdde2668abda84c0f0d3e60ebb9a962
>> Author: Taha Narimani <tahanarimani3443@gmail.com>
>>
>> dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
>>
>> This commit adds a new YAML device tree binding schema for the Analog
>> Devices AD7816, AD7817, and AD7818 digital temperature sensors. It
>> documents the compatible strings, SPI configuration, interrupts, and
>> required GPIO pins.
>>
>> > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
>> > new file mode 100644
>> > index 0000000000000..74008c14d40c6
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
>> > @@ -0,0 +1,87 @@
>> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> > +%YAML 1.2
>> > +---
>> > +$id: http://devicetree.org/schemas/iio/adc/adi,ad7816.yaml#
>> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>
>> [ ... ]
>>
>> > +properties:
>> > + compatible:
>> > + enum:
>> > + - adi,ad7816
>> > + - adi,ad7817
>> > + - adi,ad7818
>>
>> [Severity: High]
>> This isn't a bug introduced by this patch, but is there a missing lock to
>> protect concurrent sysfs accesses?
>>
>> Looking at ad7816_show_value() in drivers/staging/iio/adc/ad7816.c:
>>
>> drivers/staging/iio/adc/ad7816.c:ad7816_show_value() {
>> ...
>> ret = ad7816_spi_read(chip, &data);
>> ...
>> }
>>
>> Since this is called for world-readable sysfs attributes, can multiple
>> userspace processes trigger this concurrently?
>>
>> If so, could concurrent execution of ad7816_spi_read() interleave GPIO pin
>> toggling and SPI transfers, corrupting the hardware state?
>>
>>
>> [Severity: High]
>> This isn't a bug introduced by this patch, but does this code pass
>> stack-allocated buffers to SPI transfers?
>>
>> Looking at drivers/staging/iio/adc/ad7816.c:
>>
>> drivers/staging/iio/adc/ad7816.c:ad7816_spi_read() {
>> ...
>> ret = spi_read(spi_dev, &buf, sizeof(*data));
>> ...
>> }
>>
>> And also in ad7816_spi_write():
>>
>> drivers/staging/iio/adc/ad7816.c:ad7816_spi_write() {
>> ...
>> ret = spi_write(spi_dev, &data, sizeof(data));
>> ...
>> }
>>
>> Since the SPI subsystem often maps these buffers for DMA, will passing
>> variables from the stack cause mapping failures or crashes on architectures
>> with virtually mapped kernel stacks?
>>
>>
>> [Severity: High]
>> This isn't a bug introduced by this patch, but can this unbounded polling
>> loop cause a CPU lockup?
>>
>> Looking at ad7816_spi_read() in drivers/staging/iio/adc/ad7816.c:
>>
>> drivers/staging/iio/adc/ad7816.c:ad7816_spi_read() {
>> ...
>> while (gpiod_get_value(chip->busy_pin))
>> cpu_relax();
>> ...
>> }
>>
>> If the external device malfunctions or the GPIO line gets permanently stuck
>> high, will this loop block indefinitely and cause a hard lockup?
>>
>> --
>> Sashiko AI review · https://sashiko.dev/#/patchset/20260530135302.54688-1-tahanarimani3443@gmail.com?part=1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
@ 2026-05-30 13:31 Taha Narimani
2026-05-30 10:43 ` sashiko-bot
2026-05-30 13:53 ` Taha Narimani
0 siblings, 2 replies; 8+ messages in thread
From: Taha Narimani @ 2026-05-30 13:31 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Taha Narimani,
open list:IIO SUBSYSTEM AND DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Cc: open list:IIO SUBSYSTEM AND DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Document the Analog Devices AD7816, AD7817, and AD7818 digital
temperature sensor and ADC bindings in YAML format.
This resolves the checkpatch.pl warnings regarding undocumented DT
compatible strings for 'adi,ad7816', 'adi,ad7817', and 'adi,ad7818'.
Signed-off-by: Taha Narimani <tahanarimani3443@gmail.com>
---
.../bindings/iio/adc/adi,ad7816.yaml | 74 +++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
new file mode 100644
index 0000000..7f6a3e5
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/adi,ad7816.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD7816/7/8 digital temperature sensor and ADC
+
+maintainers:
+ - Taha Narimani <tahanarimani3443@gmail.com>
+
+description: |
+ Analog Devices AD7816, AD7817, and AD7818 10-Bit temperature sensor and ADC.
+ The device communicates via an SPI interface.
+
+properties:
+ compatible:
+ enum:
+ - adi,ad7816
+ - adi,ad7817
+ - adi,ad7818
+
+ reg:
+ maxItems: 1
+
+ spi-max-frequency: true
+
+ rdwr-gpios:
+ maxItems: 1
+ description: GPIO connected to the RD/WR pin.
+
+ convert-gpios:
+ maxItems: 1
+ description: GPIO connected to the CONVST (Convert Start) pin.
+
+ busy-gpios:
+ maxItems: 1
+ description: GPIO connected to the BUSY pin. Only applicable for AD7816 and AD7817.
+
+ interrupts:
+ maxItems: 1
+ description: OTI (Over Temperature Indicator) interrupt.
+
+required:
+ - compatible
+ - reg
+ - rdwr-gpios
+ - convert-gpios
+
+allOf:
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
+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,ad7816";
+ reg = <0>;
+ spi-max-frequency = <1000000>;
+ rdwr-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+ convert-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+ busy-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+ interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-parent = <&gpio>;
+ };
+ };
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
2026-05-30 13:31 [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor Taha Narimani
2026-05-30 10:43 ` sashiko-bot
@ 2026-05-30 13:53 ` Taha Narimani
2026-05-30 11:06 ` sashiko-bot
2026-05-30 14:58 ` Jonathan Cameron
1 sibling, 2 replies; 8+ messages in thread
From: Taha Narimani @ 2026-05-30 13:53 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Taha Narimani,
open list:IIO SUBSYSTEM AND DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Cc: open list:IIO SUBSYSTEM AND DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Document the Analog Devices AD7816, AD7817, and AD7818 digital
temperature sensor and ADC bindings in YAML format.
This resolves the checkpatch.pl warnings regarding undocumented DT
compatible strings for 'adi,ad7816', 'adi,ad7817', and 'adi,ad7818'.
Signed-off-by: Taha Narimani <tahanarimani3443@gmail.com>
---
v2: Added conditional schema constraints for busy-gpios as suggested by Sashiko AI.
---
.../bindings/iio/adc/adi,ad7816.yaml | 87 +++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
new file mode 100644
index 0000000..74008c1
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/adi,ad7816.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD7816/7/8 digital temperature sensor and ADC
+
+maintainers:
+ - Taha Narimani <tahanarimani3443@gmail.com>
+
+description: |
+ Analog Devices AD7816, AD7817, and AD7818 10-Bit temperature sensor and ADC.
+ The device communicates via an SPI interface.
+
+properties:
+ compatible:
+ enum:
+ - adi,ad7816
+ - adi,ad7817
+ - adi,ad7818
+
+ reg:
+ maxItems: 1
+
+ spi-max-frequency: true
+
+ rdwr-gpios:
+ maxItems: 1
+ description: GPIO connected to the RD/WR pin.
+
+ convert-gpios:
+ maxItems: 1
+ description: GPIO connected to the CONVST (Convert Start) pin.
+
+ busy-gpios:
+ maxItems: 1
+ description: GPIO connected to the BUSY pin.
+
+ interrupts:
+ maxItems: 1
+ description: OTI (Over Temperature Indicator) interrupt.
+
+required:
+ - compatible
+ - reg
+ - rdwr-gpios
+ - convert-gpios
+
+allOf:
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - adi,ad7816
+ - adi,ad7817
+ then:
+ required:
+ - busy-gpios
+ else:
+ properties:
+ busy-gpios: false
+
+unevaluatedProperties: false
+
+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,ad7816";
+ reg = <0>;
+ spi-max-frequency = <1000000>;
+ rdwr-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+ convert-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+ busy-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+ interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-parent = <&gpio>;
+ };
+ };
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
2026-05-30 13:53 ` Taha Narimani
2026-05-30 11:06 ` sashiko-bot
@ 2026-05-30 14:58 ` Jonathan Cameron
2026-05-30 23:11 ` Conor Dooley
1 sibling, 1 reply; 8+ messages in thread
From: Jonathan Cameron @ 2026-05-30 14:58 UTC (permalink / raw)
To: Taha Narimani
Cc: Lars-Peter Clausen, Michael Hennerich, David Lechner,
Nuno Sá, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, open list:IIO SUBSYSTEM AND DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
On Sat, 30 May 2026 13:53:00 +0000
Taha Narimani <tahanarimani3443@gmail.com> wrote:
> Document the Analog Devices AD7816, AD7817, and AD7818 digital
> temperature sensor and ADC bindings in YAML format.
>
> This resolves the checkpatch.pl warnings regarding undocumented DT
> compatible strings for 'adi,ad7816', 'adi,ad7817', and 'adi,ad7818'.
>
> Signed-off-by: Taha Narimani <tahanarimani3443@gmail.com>
Hi Taha,
Please read the documentation for submitting patches. Also look at similar
dt-binding patches for title style
[PATCH v2] dt-bindings: iio: adc: add ad7816/7/8 digital temperature sensor / ADC.
The ADC bit is to make the point this is a general purpose ADC rather than simply
temp monitoring.
Also, never send a new version in with reply-to set to the previous version.
That just makes for very confusing emails. Even more so when they both have
the same email title! New thread for every version.
The driver is in staging currently. Normally we only submit a dt-binding as part
of the patch series that includes the patch moving the driver out of staging.
I don't mind reviewing it anyway, but for now I'm not considering this for
merging. Various comments inline. If you do send a new version make sure
the patch description calls out that the driver is in staging and not yet
ready to move out. Maybe better to keep this as an RFC given that constraint.
The only exception we might make is if another project (i.e. not the kernel)
needs the dt-binding.
Jonathan
>
> ---
> v2: Added conditional schema constraints for busy-gpios as suggested by Sashiko AI.
> ---
> .../bindings/iio/adc/adi,ad7816.yaml | 87 +++++++++++++++++++
> 1 file changed, 87 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> new file mode 100644
> index 0000000..74008c1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7816.yaml
> @@ -0,0 +1,87 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/adi,ad7816.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD7816/7/8 digital temperature sensor and ADC
> +
> +maintainers:
> + - Taha Narimani <tahanarimani3443@gmail.com>
> +
> +description: |
> + Analog Devices AD7816, AD7817, and AD7818 10-Bit temperature sensor and ADC.
> + The device communicates via an SPI interface.
> +
> +properties:
> + compatible:
> + enum:
> + - adi,ad7816
> + - adi,ad7817
> + - adi,ad7818
> +
> + reg:
> + maxItems: 1
> +
> + spi-max-frequency: true
We normally provide a maximum for this based on what this chip supports.
Obviously the board or the spi controller might have lower limits but
we can at least ensure we don't set it too high for the device.
> +
> + rdwr-gpios:
> + maxItems: 1
> + description: GPIO connected to the RD/WR pin.
> +
> + convert-gpios:
> + maxItems: 1
> + description: GPIO connected to the CONVST (Convert Start) pin.
> +
> + busy-gpios:
> + maxItems: 1
> + description: GPIO connected to the BUSY pin.
Interestingly the datasheet for the ad7817 suggests using this as an interrupt.
The driver seems to currently be busy looping on this which is a rather ugly
solution and likely something we would want to look at before moving the
driver out of staging. This is an example of why we don't tend to do bindings
ahead of that move!
> +
> + interrupts:
> + maxItems: 1
> + description: OTI (Over Temperature Indicator) interrupt.
> +
Power supplies are missing. They should be required if they need to be
there for the device to function. It doesn't matter if the driver actually
uses them or not as the binding should still be complete. Note that some
of the parts definitely have an internal reference option, so vref-supply
will be optional. The lack of it being provided means use the internal
reference instead.
Also looks like at least some parts have an !OTI pin which should be an
interrupt.
> +required:
> + - compatible
> + - reg
> + - rdwr-gpios
> + - convert-gpios
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - adi,ad7816
> + - adi,ad7817
> + then:
> + required:
> + - busy-gpios
> + else:
> + properties:
> + busy-gpios: false
Looks like you'll need to handle vref-supply in a similar fashion.
> +
> +unevaluatedProperties: false
> +
> +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,ad7816";
> + reg = <0>;
> + spi-max-frequency = <1000000>;
> + rdwr-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
> + convert-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
> + busy-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
> + interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
> + interrupt-parent = <&gpio>;
You don't have any interrupts in the binding. So this shouldn't
pass testing.
> + };
> + };
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
2026-05-30 14:58 ` Jonathan Cameron
@ 2026-05-30 23:11 ` Conor Dooley
2026-05-31 8:53 ` Jonathan Cameron
0 siblings, 1 reply; 8+ messages in thread
From: Conor Dooley @ 2026-05-30 23:11 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Taha Narimani, Lars-Peter Clausen, Michael Hennerich,
David Lechner, Nuno Sá, Andy Shevchenko, Rob Herring,
Krzysztof Kozlowski, Conor Dooley,
open list:IIO SUBSYSTEM AND DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]
On Sat, May 30, 2026 at 03:58:17PM +0100, Jonathan Cameron wrote:
> On Sat, 30 May 2026 13:53:00 +0000
> > +
> > + interrupts:
> > + maxItems: 1
> > + description: OTI (Over Temperature Indicator) interrupt.
> > +unevaluatedProperties: false
> > +
> > +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,ad7816";
> > + reg = <0>;
> > + spi-max-frequency = <1000000>;
> > + rdwr-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
> > + convert-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
> > + busy-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
> > + interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
> > + interrupt-parent = <&gpio>;
>
> You don't have any interrupts in the binding. So this shouldn't
> pass testing.
There is an interrupts property in the binding, unless you meant
something else?
>
> > + };
> > + };
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor
2026-05-30 23:11 ` Conor Dooley
@ 2026-05-31 8:53 ` Jonathan Cameron
0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2026-05-31 8:53 UTC (permalink / raw)
To: Conor Dooley
Cc: Taha Narimani, Lars-Peter Clausen, Michael Hennerich,
David Lechner, Nuno Sá, Andy Shevchenko, Rob Herring,
Krzysztof Kozlowski, Conor Dooley,
open list:IIO SUBSYSTEM AND DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
On Sun, 31 May 2026 00:11:44 +0100
Conor Dooley <conor@kernel.org> wrote:
> On Sat, May 30, 2026 at 03:58:17PM +0100, Jonathan Cameron wrote:
> > On Sat, 30 May 2026 13:53:00 +0000
> > > +
> > > + interrupts:
> > > + maxItems: 1
> > > + description: OTI (Over Temperature Indicator) interrupt.
>
> > > +unevaluatedProperties: false
> > > +
> > > +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,ad7816";
> > > + reg = <0>;
> > > + spi-max-frequency = <1000000>;
> > > + rdwr-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
> > > + convert-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
> > > + busy-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
> > > + interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
> > > + interrupt-parent = <&gpio>;
> >
> > You don't have any interrupts in the binding. So this shouldn't
> > pass testing.
>
> There is an interrupts property in the binding, unless you meant
> something else?
Huh. More coffee needed. Odd I missed it!
J
>
> >
> > > + };
> > > + };
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-05-31 8:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-30 13:31 [PATCH] dt-bindings: iio: adc: Add schema for AD7816/7/8 digital temperature sensor Taha Narimani
2026-05-30 10:43 ` sashiko-bot
2026-05-30 13:53 ` Taha Narimani
2026-05-30 11:06 ` sashiko-bot
[not found] ` <CAEsNvj8Q3n3-tuPhANfRjUfqrnCtzfguuRKL0OrwCEEkSXrUaw@mail.gmail.com>
2026-05-30 11:21 ` Taha Narimani
2026-05-30 14:58 ` Jonathan Cameron
2026-05-30 23:11 ` Conor Dooley
2026-05-31 8:53 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox