From: sashiko-bot@kernel.org
To: "Bruce Tsao" <bruce.tsao@analog.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: iio: dac: Document Analog Devices AD5413 single-channel DAC
Date: Fri, 16 Oct 2026 19:36:32 +0000 [thread overview]
Message-ID: <sashiko-outbox-174864@kernel.org> (raw)
In-Reply-To: <20261017-ad5413-upstream-v1-1-61f40c8fef25@analog.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] dt-bindings: iio: dac: adi,ad5413: missing reg property and requirement
- [Medium] dt-bindings: iio: dac: adi,ad5413: invalid maintainers and spi-cpol schema
- [Medium] dt-bindings: iio: dac: adi,ad5413: custom boolean mode property duplicates standard range bindings
--
commit b9fdb51ef057c689f916309a04134bf25c49ed72
Author: Bruce Tsao <bruce.tsao@analog.com>
dt-bindings: iio: dac: Document Analog Devices AD5413 single-channel DAC
This commit documents the devicetree bindings for the Analog Devices AD5413
single-channel SPI DAC, including power supplies, reset GPIO, output mode,
and slew-rate control.
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5413.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5413.yaml
> new file mode 100644
> index 0000000000000..74e869304aab9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5413.yaml
> @@ -0,0 +1,101 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/adi,ad5413.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5413 DAC
> +
> +description:
> + Analog Devices AD5413 is a single-channel precision DAC supporting voltage
> + or current output modes with programmable slew-rate control.
> + The output mode is selected via the adi,chan-current-mode property.
> + Optional reset GPIO may be provided.
> +
> +maintainers:
> + - bruce.tsao@analog.com
> +
> +properties:
> + compatible:
> + const: adi,ad5413
> +
> + spi-max-frequency:
> + maximum: 50000000
> +
> + spi-cpha: true
> +
> + spi-cpol: false
[Severity: Medium]
Will this schema pass make dt_binding_check?
In the maintainers block, the entry uses a bare email address rather than
the required Full Name <email@domain> format:
maintainers:
- Bruce Tsao <bruce.tsao@analog.com>
Also, in the top-level properties block, spi-cpol is set to false. In DT
schema, boolean false property schemas are only valid inside conditional
if/then/else blocks to disallow a property defined at the top level. Since
spi-cpol is not defined in spi-peripheral-props.yaml and this binding sets
unevaluatedProperties: false, should spi-cpol: false simply be omitted?
> +
> + reset-gpios:
> + maxItems: 1
> + description: Optional reset GPIO (active low).
> +
> + avdd-supply:
> + description: Analog positive supply (AVDD)
> +
> + dvdd-supply:
> + description: Digital positive supply (DVDD)
> +
> + avss-supply:
> + description: Analog negative supply (AVSS)
> +
> + adi,chan-current-mode:
> + type: boolean
> + description: Select current output mode. If absent, voltage mode is used.
[Severity: Medium]
Should the output mode and range be described using standard IIO DAC range
properties rather than a custom adi,chan-current-mode boolean?
In drivers/iio/dac/ad5413.c, the hardware supports a 4-bit range configuration
field (AD5413_REG_DAC_CONFIG_RANGE_MSK = GENMASK(3, 0)) with multiple voltage
and current ranges, while the driver currently hardcodes only two of them
(AD5413_RANGE_PLUSMINUS_10_5V = 0x3 and AD5413_RANGE_0MA_24MA = 0x9) based on
this boolean.
Could this use output-range-microvolt and output-range-microamp from
Documentation/devicetree/bindings/iio/dac/dac.yaml (or adi,range-microvolt and
adi,range-microamp as in Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml)
so the binding describes the hardware capabilities rather than the current
driver limitation?
> +
> + adi,slew-time-us:
> + description: Output digital slew control time in microseconds
> + minimum: 0
> + maximum: 1000000
> + default: 0
> +
> +required:
> + - compatible
> + - spi-cpha
> + - avdd-supply
> + - dvdd-supply
> + - avss-supply
[Severity: Medium]
Should reg be defined with maxItems: 1 under properties and listed in
required?
The binding references /schemas/spi/spi-peripheral-props.yaml# under allOf,
which defines reg with minItems: 1 and maxItems: 256 and does not mark reg
as required. Because AD5413 is a single-chip-select SPI device and both
examples specify reg = <0>, omitting reg from properties and required leaves
the chip-select count unconstrained and optional during DT validation.
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + dac@0 {
> + compatible = "adi,ad5413";
> + reg = <0>;
> + spi-max-frequency = <1000000>;
> + spi-cpha;
> + reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
> + avdd-supply = <&avdd>;
> + dvdd-supply = <&dvdd>;
> + avss-supply = <&avss>;
> + adi,slew-time-us = <125>;
> + };
> + };
> +
> + - |
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + dac@0 {
> + compatible = "adi,ad5413";
> + reg = <0>;
> + spi-max-frequency = <1000000>;
> + spi-cpha;
> + avdd-supply = <&avdd>;
> + dvdd-supply = <&dvdd>;
> + avss-supply = <&avss>;
> +
> + adi,chan-current-mode;
> + };
> + };
In both examples above, could the standard properties (avdd-supply,
avss-supply, dvdd-supply, reset-gpios, spi-cpha, spi-max-frequency) be placed
in canonical natural-sort order after reg per
Documentation/devicetree/bindings/dts-coding-style.rst?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261017-ad5413-upstream-v1-0-61f40c8fef25@analog.com?part=1
next prev parent reply other threads:[~2026-10-16 19:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 19:23 [PATCH 0/2] iio: dac: add support for AD5413 Bruce Tsao via B4 Relay
2026-10-16 19:23 ` [PATCH 1/2] dt-bindings: iio: dac: Document Analog Devices AD5413 single-channel DAC Bruce Tsao via B4 Relay
2026-10-16 19:36 ` sashiko-bot [this message]
2026-10-16 23:02 ` Jonathan Cameron
2026-10-16 19:23 ` [PATCH 2/2] iio: dac: add AD5413 driver Bruce Tsao via B4 Relay
2026-10-16 19:33 ` sashiko-bot
2026-10-16 23:40 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-174864@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bruce.tsao@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox