Commit graph

164 commits

Author SHA1 Message Date
Mathieu Choplain
48b8dd69ac drivers: dac: stm32: validate channel ID in common code
Implement a common function to validate a DAC channel ID (and translate
it to an "index" value, ultimately used to obtain the LL channel value).

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-03 13:58:05 -04:00
Mathieu Choplain
bad1f23e51 drivers: dac: stm32: move channel_count to instance configuration
The number of channels supported by an instance is a fixed value so it
can be saved in the instance configuration instead of the instance data.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-03 13:58:05 -04:00
Syed Maaz
a87063bfca drivers: dac: microchip: Introduce DAC G2 Driver
Add G2 DAC driver for Microchip DAC Peripherals.

Signed-off-by: Syed Maaz <Syed.Maaz@microchip.com>
2026-06-21 07:39:18 -04:00
Radu Ciobanu
2b7f498d79 drivers: dac: ad5529r: update product ID to match released datasheet
Update AD5529R_PRODUCT_ID from 0x4140 to 0x414A to match the
released datasheet (Rev. 0) PRODUCT_ID_L register reset value.

Signed-off-by: Radu Ciobanu <Radu-rares.Ciobanu@analog.com>
2026-06-09 10:31:02 +02:00
Etienne Carriere
fec7063f7c dts: bindings: adc: use min/max properties in ADC emulation
Use min/max DT properties for ADC nchannels DT properties to factorize
documentation and build time check of the property values against its
valid range.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-03 18:27:28 -04:00
Richard Mc Sweeney
c1119376f1 drivers: correct pse84 autanalog dac index
Corrected PSE84 autanalog DAC index calculation. The DAC index is
contiguous and starts from dac0 instance. The previous implementation
was depending on the DT_NODE_CHILD_IDX, which returns the position
among all autanalog siblings (CTB, PTC, DAC, SAR, PRB). Therefore
it was returning an incorrect DAC index.

Signed-off-by: Richard Mc Sweeney <Richard.McSweeney@infineon.com>
2026-06-01 18:08:27 -05:00
Stephan Gatzka
1d65df9181 drivers: dac: dacx3608: Correct MSB alignment
The TI DAC43608 has 8 bit resolution, the DAC53608 has 10 bit
resolution. According to the datasheet from Texax Instruments,
the MSB of DACn_DATA must be left aligned.

This fix aligns the data correctly, allowing the DAC value to
be set to 100% and not only 25% max for the DAC43608.

Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
2026-05-29 23:35:57 +02:00
Richard Mc Sweeney
656c245ce5 drivers: add pse84 CTDAC support
Added autonomous analog CTDAC for PSE84 device.

This implementation uses the autonomous controller (MFD)
that is shared with other autanalog drivers.

The CTDAC stands for Continuous Time DAC. It is a programmable DAC
residing inside the autonomous (aut) analog subsystem. It is
controlled using the autonomous controller (AC), which is a
programmable state machine. The AC is shared across all autonomous
analog peripherals including the SAR, PRB, PTComp, CTB, and CTDAC.

The DAC output can either be software controlled or be driven
through the AC hardware by loading through an internal LUT memory.
AC MFD references the DAC configuration, and brings together all
other autanalog peripherals into a single AC setup for the application.

Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Richard Mc Sweeney <Richard.McSweeney@infineon.com>
2026-05-27 21:28:38 -04:00
Radu Ciobanu
2c4046da82 drivers: dac: ad5529r: enable internal voltage reference
Select the internal 4.096V reference during init. The REF_SEL register
defaults to external, causing 0V output when no external reference is
connected.

Signed-off-by: Radu Ciobanu <Radu-rares.Ciobanu@analog.com>
2026-05-27 08:36:42 +02:00
Robert Budai
c6c84446c4 drivers: dac: add ad5529r driver
Add DAC driver for the Analog Devices AD5529R 16-channel, 16-bit
voltage output DAC. The driver supports multiple output voltage
ranges, SPI communication, and optional reset/LDAC/clear GPIOs.

Signed-off-by: Robert Budai <robert.budai@analog.com>
Co-authored-by: Radu Ciobanu <raduciobanu096@gmail.com>
2026-05-20 20:02:09 -04:00
Guillaume Gautier
dfab44e51c drivers: dac: stm32: adapt dac driver for stm32 hal2
Adapt the DAC driver for STM32 HAL2.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-04-14 22:23:50 -04:00
Santhosh Charles
3315866bc1 drivers: dac: add driver support for TI MSPM0 G-Series DAC module
Add support for the DAC module on TI’s MSPM0 G-Series MCUs. The DAC
supports 8-bit and 12-bit resolution.

Signed-off-by: Santhosh Charles <santhosh@linumiz.com>
2026-04-14 22:04:55 -04:00
Henrik Lindblom
8494c5bdcf drivers: dac: add emulator driver
For use in tests where the existing "vnd,dac" driver doesn't work as it
returns error codes for all API functions. The approach is mimicked from
the adc-emul driver.

Signed-off-by: Henrik Lindblom <henrik.lindblom@vaisala.com>
2026-03-13 14:43:00 +01:00
Sylvio Alves
c64a74e711 espressif: adapt to hal_espressif IDF master sync
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.

Main changes:
- clock control: delegate peripheral clock gating to HAL
  layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
  allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
  object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
  MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
  DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-13 11:38:18 +01:00
Farsin Nasar V A
399e58d962 drivers: dac: microchip: Update DAC G1 driver for PIC32CX_SG
Update DAC G1 driver implementation to support PIC32CX_SG

Signed-off-by: Farsin Nasar V A <farsin.nasarva@microchip.com>
2026-03-10 22:21:44 +01:00
Zhaoxiang Jin
3ea9ca336a drivers: dac: add NXP HPDAC driver
1. Add device tree binding for NXP HPDAC.
2. Add driver for NXP HPDAC.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-03-05 10:03:40 +01:00
Andreas Wolf
0180ba1ce8 drivers: dac: Add drivers for TI DAC family X311 on SPI bus
Add shared code in 'dac_dacx311.c' and configuration files.
Support power mode bits via configuration.

Signed-off-by: Andreas Wolf <awolf002@gmail.com>
2026-03-04 11:37:33 +01:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Zhaoxiang Jin
def38a2e28 drivers: dac: dac_mcux_gau: fix comment formatting
Remove stray '/' character at the end of comment line.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-02-04 12:54:22 -06:00
Tomas Groth Christensen
c73e59c5f4 dac: mcux_gau: fix output-voltage-range mapping on RW61x
Map DT range index to SDK values {0,1,3} on RW61x

Signed-off-by: Tomas Groth Christensen <tgc@foss.dk>
2026-01-29 14:25:16 +00:00
Arunprasath P
74bafaf20e drivers: dac: microchip: Introduce DAC G1 Driver
Add G1 DAC driver for Microchip DAC Peripherals.

Signed-off-by: Arunprasath P <arunprasath.p@microchip.com>
2026-01-20 20:11:31 -05:00
Aksel Skauge Mellbye
a83b19b3f9 soc: silabs: Fix clock control dependency declarations
Most drivers for Series 2 depend on clock control, but didn't
declare it. Enable clock control by default for Series 2 SoCs.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-12-01 11:11:14 +01:00
Josuah Demangeon
30950b888d style: drivers: sort Kconfig and CMake includes
Use the "zephyr-keep-sorted-start/stop" comment to have CI check
the alphabetical order of includes, to help reducing the chance
of conflicts while contributing drivers.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Etienne Carriere
d27e1d6f78 drivers: dac: stm32: clean indentation in instance init macros
Clean indentation in STM32_DAC_INIT() macro.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Etienne Carriere
b0ccb2295f drivers: stm32: use STM32_CLOCK_INFO_BY_NAME() and friends
Use STM32_CLOCK_INFO(), STM32_DT_INST_CLOCK_INFO(),
STM32_CLOCK_INFO_BY_NAME() and STM32_DT_INST_CLOCK_INFO_BY_NAME()
helper macros in STM32 drivers.

Using these macros ensure the clock division factor is properly
populated according to DT information. Prior these changes some
drivers only got the bus and bits position information and missed
the clock division information which is fine only when this division
factor information is 0.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Mickael Bosch
d27b654eb5 drivers: dac: add AD56x1 devices
The Analog Device AD5601, AD5611, and AD5621 devices are 8, 10 and 12
bits DAC respectively.

These devices use a 16 bits SPI communication protocol.
The 2 first bit encode the low power mode (this driver do not use the
low power mode, it always run in the 'normal' mode).
The next 14 bits contain the left aligned value. The 2, 4, or 6
remaining bits (depending on the resolution) are set to 0.

Signed-off-by: Mickael Bosch <mickael.bosch@linux.com>
2025-10-24 08:55:03 -07:00
Anas Nashif
bf82f7ffac copyrights: fix copyright line
Add space before (c) to allow correct parsing by linters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-07 22:53:45 -04:00
Declan Snyder
570b445a61 drivers: Convert to use SPI macro without delay parameters
Convert all drivers and other consumers to use SPI macros without the
delay parameters.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-01 14:39:36 +03:00
Stefan Giroux
6cb06cdd08 drivers: sam0: dac: add sam0 dac support to samc21 processors
The SAMC21 has a different revision of the DAC peripheral.
This change adds an ifdef to handle the changed SYNCBUSY register.

Signed-off-by: Stefan Giroux <stefan.g@feniex.com>
2025-09-15 10:29:10 +02:00
Aditya Ganesh
38b40ed16e drivers: dac - Added additional channel selection support for AD5686
Added support for selecting channels A, B, both together, and all channels
on the AD5686 DAC driver. This improves flexibility for multi-channel
DAC applications.

Signed-off-by: Aditya Ganesh <adga5133@colorado.edu>
2025-08-19 09:13:20 +02:00
Bastien Beauchamp
9dbbe3b0da drivers: dac: implement the silabs_vdac compatible driver
This implements the DAC driver for silabs VDAC peripherals
using the silabs,vdac compatible binding.

Signed-off-by: Bastien Beauchamp <bastien.beauchamp@silabs.com>
2025-08-07 20:55:50 -04:00
Rafael Aldo Hernández Luna
2e30bbca00 drivers: dac: Added dac driver for samd5x
Added driver and binding file for samd5x dac peripheral, the already
implemented dac_sam0.c lacks the configuration registers for this
microcontroller family and is fixed to only have one dac channel output,
also, the code gets too bulky when adding the samd5x dac configuration
using preprocessor directives that’s why I moved the implementation to its
own file.

Added dac to the supported list of same54_xpro.yaml, fixed Kconfig.samd5x
help spacing, added board defines to test_dac.c and test it out with
twister script on board.

Signed-off-by: Rafael Aldo Hernández Luna <aldo.hernandez@daikincomfort.com>
2025-07-19 09:54:41 +02:00
Pieter De Gendt
ee78942c67 drivers: dac: Place device APIs in linker sections
Use DEVICE_API macro to place driver API instances into a linker section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-27 10:09:32 -05:00
Jeppe Odgaard
dffbd4fc88 license: fix copyright owner
Change license owner to Prevas due to initially wrong owner due to company
mix-up during co-development.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-06-26 10:56:48 -05:00
Benjamin Cabé
005377b4c5 drivers: dac: adopt SHELL_HELP
Adopt SHELL_HELP macro for dac_shell

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-16 14:03:57 -04:00
Benjamin Cabé
25dc5fe968 drivers: dac: esp32: avoid out-of-range channel ID
Fix channel ID check in dac_esp32_channel_setup as it was allowing to
set up a channel with ID greater than the number of channels.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-11 08:19:09 +02:00
Benjamin Cabé
e37631eea7 drivers: dac: max22017: return negative errno
Changed the return value for unsupported channel from ENOTSUP to -ENOTSUP

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-10 13:30:33 +02:00
Florijan Plohl
7692e3db3f drivers: dac: add driver for the NXP DAC12
Add driver shim for the NXP Digital-to-Analog (DAC12) module.

Signed-off-by: Florijan Plohl <florijan.plohl@norik.com>
2025-05-13 03:20:29 +02:00
Jeppe Odgaard
0dffe7cc7e drivers: dac: Add TI DAC161S997 driver
Initial DAC driver for TI DAC161S997. This is a 1 channel 16 bit
DAC designed for 4-20 mA loops.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-04-02 12:53:03 +02:00
Khoa Nguyen
9093598d86 drivers: dac: Update Renesas DAC driver to support for RA4
Update Renesas DAC driver to support DAC for RA4

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-03-25 22:13:12 +01:00
Khoa Nguyen
9c67002ef9 drivers: dac: Initial DAC driver support for Renesas RA
Initial DAC driver support for Renesas RA

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-02-11 11:44:40 +00:00
Pieter De Gendt
e574b019ce drivers: dac: dac_dam: Fix samx7x builds
Commit a21e9f02e6 introduced a regression for Atmel SAMX7X series.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-02-10 18:55:35 +01:00
Ibe Van de Veire
a21e9f02e6 drivers: dac: Add support for the SAM4S soc series
Add support for the SAM4S soc in the DACC driver.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
2025-02-06 10:43:17 +01:00
Benjamin Cabé
74cccfa1dc drivers: dac: sam: Fix typo in BUILD_ASSERT
Fixed a typo in BUILD_ASSERT macro causing driver to effectively fail to
compile as seen in:
west twister -p sam_v71_xult/samv71q21b -s drivers.dac.api

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-31 21:43:45 +01:00
Pieter De Gendt
f1c4760304 drivers: Update APIs to use DEVICE_API macro
Some drivers APIs were not wrapped using the DEVICE_API macro.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-24 01:15:19 +01:00
Fabio Baltieri
11b5e1f8f5 dac_shell: add device filtering
Add shell device name filtering using DEVICE_API_IS.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-22 05:40:11 +01:00
Guillaume Ranquet
31510fb3bf drivers: dac: Add support for MAX22017 DAC
The MAX22017 is a two-channel industrial-grade software-configurable
analog output device that can be used in either voltage or current output
mode.

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
2025-01-21 07:07:33 +01:00
Henrik Brix Andersen
7fec3d7f12 soc: atmel: samx7x: refactor SoC support for the Atmel SAM E70/V71
Refactor and merge the SoC support files for the Atmel SAM E70 and SAM V71
product series. These SoCs are part of a larger product family (SAM
E70/S70/V70/V71) and share a common set of peripherals.

Support for the two remaining product series (SAM S70/V70) is not part of
this refactoring as these will require further additions to the Atmel HAL.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-01-16 22:39:25 +01:00
Gerson Fernando Budke
ea7922195b clocks: atmel: sam0: Fix gclk and mclk clock bindings
The Atmel SAM0 SoC enable peripherals clocks in distinct places: PM and
MCLK. The old devices had defined the peripheral clock enable bit at PM.
On the newer devices this was extracted on a dedicated memory section
called Master Clock (MCLK). This change excludes the dedicated bindings
in favor of a generic approach that cover all cases.

Now the clocks properties is complemented by the atmel,assigned-clocks
property. It gives the liberty to user to customize the clock source
from a generic clock or configure the direct connections.

All peripherals drivers were reworked with the newer solution.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-01-14 20:49:03 +01:00
Martin Jäger
075cb211e5 drivers: dac: dacx3608: Fix bad shift operation
The parameter provided to the `BIT()` macro must be checked so that
the shift operation does not overflow the variable.

Fixes #81990

Signed-off-by: Martin Jäger <martin@libre.solar>
2025-01-07 11:51:39 +01:00