* [PATCH v2 0/1] dt-bindings: iio: dds: Add AD9832/AD9835 binding
@ 2026-05-09 0:28 Hungyu Lin
2026-05-09 0:28 ` [PATCH v2 1/1] " Hungyu Lin
0 siblings, 1 reply; 3+ messages in thread
From: Hungyu Lin @ 2026-05-09 0:28 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt
Cc: jic23, lars, Michael.Hennerich, dlechner, nuno.sa, andy,
linux-iio, devicetree, linux-kernel, Hungyu Lin
v2:
- Add SPI peripheral schema reference
- Fix example by adding clock and regulator providers
- Fix SPDX license format
Hungyu Lin (1):
dt-bindings: iio: dds: Add AD9832/AD9835 binding
.../bindings/iio/dds/adi,ad9832.yaml | 87 +++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/dds/adi,ad9832.yaml
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] dt-bindings: iio: dds: Add AD9832/AD9835 binding
2026-05-09 0:28 [PATCH v2 0/1] dt-bindings: iio: dds: Add AD9832/AD9835 binding Hungyu Lin
@ 2026-05-09 0:28 ` Hungyu Lin
2026-05-09 0:36 ` sashiko-bot
0 siblings, 1 reply; 3+ messages in thread
From: Hungyu Lin @ 2026-05-09 0:28 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt
Cc: jic23, lars, Michael.Hennerich, dlechner, nuno.sa, andy,
linux-iio, devicetree, linux-kernel, Hungyu Lin
Add devicetree binding documentation for AD9832 and AD9835 DDS devices.
These devices are SPI-controlled direct digital synthesizers
requiring AVDD, DVDD supplies and an external master clock.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
.../bindings/iio/dds/adi,ad9832.yaml | 87 +++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/dds/adi,ad9832.yaml
diff --git a/Documentation/devicetree/bindings/iio/dds/adi,ad9832.yaml b/Documentation/devicetree/bindings/iio/dds/adi,ad9832.yaml
new file mode 100644
index 000000000000..95b20ed4f9c0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dds/adi,ad9832.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/dds/adi,ad9832.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD9832 / AD9835 DDS
+
+maintainers:
+ - Hungyu Lin <dennylin0707@gmail.com>
+
+description: |
+ Binding for Analog Devices AD9832 and AD9835 SPI-controlled direct
+ digital synthesizers (DDS). The devices use an external master clock
+ and are controlled over a serial SPI-compatible interface.
+
+properties:
+ compatible:
+ enum:
+ - adi,ad9832
+ - adi,ad9835
+
+ reg:
+ maxItems: 1
+
+ spi-max-frequency:
+ maximum: 20000000
+
+ clocks:
+ maxItems: 1
+ description:
+ External master clock input.
+
+ clock-names:
+ const: mclk
+
+ avdd-supply:
+ description:
+ Analog power supply.
+
+ dvdd-supply:
+ description:
+ Digital power supply.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - avdd-supply
+ - dvdd-supply
+
+allOf:
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ mclk: clock {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <25000000>;
+ };
+
+ vdd_3v3: regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vdd_3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ad9832@0 {
+ compatible = "adi,ad9832";
+ reg = <0>;
+ spi-max-frequency = <20000000>;
+ clocks = <&mclk>;
+ clock-names = "mclk";
+ avdd-supply = <&vdd_3v3>;
+ dvdd-supply = <&vdd_3v3>;
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2 1/1] dt-bindings: iio: dds: Add AD9832/AD9835 binding
2026-05-09 0:28 ` [PATCH v2 1/1] " Hungyu Lin
@ 2026-05-09 0:36 ` sashiko-bot
0 siblings, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-05-09 0:36 UTC (permalink / raw)
To: Hungyu Lin; +Cc: robh, krzk+dt, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The AD9832 and AD9835 require SPI Mode 2 (CPOL=1, CPHA=0), but the binding does not enforce `spi-cpol` and the example omits it.
- [High] The driver will unconditionally fail to probe when instantiated via Device Tree because it strictly requires `platform_data`.
- [Low] The example uses a specific part number for the node name (`ad9832@0`) rather than a generic functional name.
--
commit 0760129b4a1ce54473ebad28ebda22535e9eedd6
Author: Hungyu Lin <dennylin0707@gmail.com>
dt-bindings: iio: dds: Add AD9832/AD9835 binding
This commit adds device tree binding documentation for the Analog Devices
AD9832 and AD9835 SPI-controlled direct digital synthesizers.
Since the binding introduces device tree support, does the driver need
updates to actually probe successfully when instantiated this way?
Looking at ad9832_probe(), it unconditionally returns -ENODEV if
dev_get_platdata() is NULL:
drivers/iio/dds/ad9832.c:ad9832_probe() {
struct ad9832_platform_data *pdata = dev_get_platdata(&spi->dev);
if (!pdata) {
dev_dbg(&spi->dev, "no platform data?\n");
return -ENODEV;
}
...
}
When instantiated via device tree, platform data is typically NULL. Will
the driver fail to probe without additional patches to handle missing
platform data?
> diff --git a/Documentation/devicetree/bindings/iio/dds/adi,ad9832.yaml b/Documentation/devicetree/bindings/iio/dds/adi,ad9832.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dds/adi,ad9832.yaml
[ ... ]
> properties:
> compatible:
> enum:
> - adi,ad9832
> - adi,ad9835
>
> reg:
> maxItems: 1
>
> spi-max-frequency:
> maximum: 20000000
Does this binding need to specify spi-cpol?
The AD9832 hardware requires SPI Mode 2 (CPOL=1, CPHA=0) where the SPI
clock idles high. Since the driver doesn't set spi->mode in code and
relies on the device tree to configure polarity, omitting it might cause
the controller to default to Mode 0, which would cause communication to
fail.
Should spi-cpol: true be added to the properties and included in the
example?
[ ... ]
> spi {
> #address-cells = <1>;
> #size-cells = <0>;
>
> ad9832@0 {
This isn't a bug, but does this violate the device tree convention for
generic node names? Usually, node names describe the hardware's function
rather than the specific part number, such as generator@0 or frequency@0.
> compatible = "adi,ad9832";
> reg = <0>;
> spi-max-frequency = <20000000>;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260509002810.78372-2-dennylin0707@gmail.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-09 0:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 0:28 [PATCH v2 0/1] dt-bindings: iio: dds: Add AD9832/AD9835 binding Hungyu Lin
2026-05-09 0:28 ` [PATCH v2 1/1] " Hungyu Lin
2026-05-09 0:36 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox