[PATCH v8 0/3] iio: dac: Add support for AD5529R DAC
Janani Sunil <[email protected]> Wed, 5 Aug 2026 09:17:40 +0200
| Newsgroups | org.infradead.lists.linux-riscv,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-doc,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel,org.kernel.vger.linux-spi |
|---|---|
| Message-ID | <[email protected]> |
This patch series adds support for Analog Devices AD5529R, a 16 channel 16 and 12 bit voltage Digital-to-Analog Converter (DAC) with integrated precision reference. The AD5529R operates from both unipolar and bipolar supplies. The device communicates via SPI interface. **Device Overview:** The AD5529R features 16 independent DAC channels, with 16 or 12 bit resolution, allowing independently programmable output ranges. The internal 4.096V precision reference sets the accuracy of the output voltage. The device can encode a hardware address in its SPI command frame, allowing up to 4 devices to share a single chip select. This series introduces a generic spi-device-addr property for describing this type of addressing. **Features Implemented:** - Support for AD5529R 12-bit and 16-bit variants via device match data. - Support for a single DAC device using any hardware address between 0 and 3. - Reset support via reset controller framework. - Dual regmap configuration to handle 8 and 16 bit registers. - Per-channel output range configuration from devicetree. - Optional external reference and bipolar supply handling. **Patch Summary:** 1. Add the generic spi-device-addr SPI peripheral property. 2. AD5529R binding documentation with channel configuration. 3. Implement AD5529R IIO DAC Driver with regmap support. **Testing:** The driver was compiled and tested on the EVAL-AD5529R-ARDZ using a coraZ7 with a mainline v7.0 kernel. **Driver Rationale:** AD5529R introduces: 1. A unique register layout 2. Mixed 8-bit and 16-bit register accesses 3. Hardware specific features like function generators, multi-die hotpath registers etc. The device warrants its own driver due to these fundamental architectural differences, that would require substantial changes to existing drivers without providing reusable benefits. The standalone driver also allows future extensions for related devices in the same family. **Not Implemented in this Series:** The binding includes generic, peripheral level device addressing needed for multi-device support using a shared CS, but the driver presently supports only a single device. Signed-off-by: Janani Sunil <[email protected]> --- Changes in v8: - Rename the AD5529R supply properties to match the datasheet supply names. - Describe and enable all four positive and four negative high-voltage supplies. - Reject duplicate channel nodes and configurations with too many channels. - Add the required 20 ns delay between reset assertion and deassertion. - Add a macro to represent the number of channels. - Return -ENODATA when device cannot be identified. - Clarify that spi-device-addr contains one address per physical device. - Drop the Microchip binding and driver changes from the series. - Drop brackets around scalar spi-device-addr defaults. - Simplify the regmap_assign_bits() reference selection value. - Link to v7: https://lore.kernel.org/r/[email protected] Changes in v7: - Drop #include <linux/mod_devicetable.h> - Add comment on minimum HW reset low width. - Flip the vref regulator error check. - Clarify why spi-device-addr is an array, with one address per physical device sharing a chip select. - Add default addresses for mcp3564 and mcp3911 bindings. - Initialize AD5529R regmap configurations locally using designated initializers. - Update "Patch Summary" section in the cover letter. - Link to v6: https://lore.kernel.org/r/[email protected] Changes in v6: - Rename spi,device-addr to spi-device-addr and define it as an array at peripheral node level. - Fix the SPI binding patch subject prefix to use "spi: dt-bindings:". - Add spi-device-addr to the MCP3564 and MCP3911 bindings. - Deprecate the existing Microchip-specific device-address properties. - Replace adi,output-range-microvolt with output-range-microvolt. - Move AD5529R device addressing from channel nodes to the peripheral node. - Include linux/types.h - Honour non-zero hardware address in the AD5529R driver. - Dynamically expose only the channels described by devicetree and remove unused scan type definitions. - Use explicit reset assertion and deassertion as the GPIO reset controller does not implement reset_control_reset(). - Use the MICRO and MILLI unit constants when matching output ranges. - Simplify optional reference regulator handling and remove the external reference comment. - Simplify error messages and stick to 80 col. - Link to v5: https://lore.kernel.org/r/[email protected] Changes in v5: - Move register bitfield definitions next to their parent register addresses. - Remove spurious extra indent. - Rename ad5529r_output_ranges_mv[] to ad5529r_output_ranges_mV[]. - Remove extra parentheses in regmap_reg_range() for the readback range. - Use reset_control_reset() instead of reset_control_deassert(). - Use 10 * USEC_PER_MSEC instead of a bare 10000 in fsleep(). - Use fwnode_property_present() to explicitly guard the optional property. - Rewrite external_vref detection using explicit if/else. - Follow reverse christmas tree variable declaration order. - Improve invalid channel error message to include the maximum. - Add a new spi property to include the SPI device address. - Update ad5529r devicetree binding to allow more than 16 channels to include multiple DACs. - Update cover letter to add a mention about the multi device support. - Update driver commit message to describe the device further. - Link to v4: https://lore.kernel.org/r/[email protected] Changes in v4: - Fix DT child-node regex for hexadecimal channel addresses. - Wrap long DT binding description lines. - Simplify optional `vref-supply` and `hvss-supply` handling. - Update REF_SEL programming for optional external reference use. - Clean up range parsing and error messages. - Simplify debugfs register access by calling regmap helpers directly. - Add clarifying comments for reset settling time and RAW reads from `DAC_INPUT_A`. - Remove an unused vref regulator pointer and an include. - Rename the REF_SEL bit define and clean up small driver details. - Toggle pins defined as PWM pins, instead of GPIOs - Update cover letter to sync up latest changes. - Link to v3: https://lore.kernel.org/r/[email protected] Changes in v3: - Split into adi,ad5529r-16 and adi,ad5529r-12 device tree compatibles - Add DT-based output range configuration via adi,output-range-microvolt - Expand DT binding: vref-supply, clear/tg GPIOs, interrupts, muxout - Correct power supply voltage specifications as per datasheet - Reduce SPI frequency limit to 25MHz as per datasheet specs - Switch to autoincrement addressing mode, remove +1 register offsets - Use DT match data instead of device ID detection for fallback support - Implement dynamic scale/offset calculation per configured channel range - Added explicit val_format_endian and reg_stride for 16-bit regmap bus - Code cleanup: alphabetical includes, ARRAY_SIZE(), unused defines - Minor: .sign→.format field, simplify read/write order, optional hvss-supply - Remove redundant driver documentation ad5529r.rst - Link to v2: https://lore.kernel.org/r/[email protected] Changes in v2: - Fix IIO scale to use millivolts per ABI requirement - Fix documentation voltage calculations (2.5V not 2.048V) - Fix bipolar ranges in documentation (±5V, ±10V, ±15V, ±20V) - Fix alphabetical ordering in documentation index - Add missing newline to documentation file - Fix scale units description (millivolts not microvolts) - Include a section for driver rationale in the cover letter - Reword contents in cover letter 12/16 bit generic->variant - Add dependency array for spi-cpha and spi-cpol properties - Link to v1: https://lore.kernel.org/r/[email protected] --- Janani Sunil (3): spi: dt-bindings: Add spi-device-addr peripheral property dt-bindings: iio: dac: Add AD5529R iio: dac: Add AD5529R DAC driver support .../devicetree/bindings/iio/dac/adi,ad5529r.yaml | 254 ++++++++++ .../bindings/spi/spi-peripheral-props.yaml | 7 + MAINTAINERS | 8 + drivers/iio/dac/Kconfig | 17 + drivers/iio/dac/Makefile | 1 + drivers/iio/dac/ad5529r.c | 530 +++++++++++++++++++++ 6 files changed, 817 insertions(+) --- base-commit: 93df88612859e8e19dec93c69d563b4b73e9bd4b change-id: 20260507-ad5529r-driver-866bbdd864de Best regards, -- Janani Sunil <[email protected]> _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv