Commit graph

152 commits

Author SHA1 Message Date
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
Yishai Jaffe
1b4cef325b shell: use shell_device_get_binding
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-12-18 15:32:10 +01:00
Pieter De Gendt
454cc58246 drivers: dac: Place API into iterable section
Add wrapper DEVICE_API macro to all dac_driver_api instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-02 22:05:33 +00:00
Jeppe Odgaard
c6aafd7eb5 drivers: dac: ad559x: implement double range option
Optionally write to ad559x register bit which increases DAC output range
from 0V to 2 x Vref.

The functionality has been tested on AD5593r.
The voltage at 4095 has been measured to 5.01 volts.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Gerson Fernando Budke
0cc8f93e8a soc: atmel: Drop PINCTRL from Kconfig.defconfig
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.sam*.

Fixes #78619

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-11-04 13:43:26 -06:00
Gerson Fernando Budke
52d21d7bf0 soc: gd32: Drop PINCTRL from Kconfig.defconfig
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.gd32.

Fixes #78619

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-11-04 13:40:42 -06:00
Ben Booher
4a8a035bd7 drivers: sensor: dacx3608: add broadcast register for synchronized output
The dacx3608 line supports a broadcast register so all configured channels
can output a singular value, simultaneously. This drastically reduces I2C
overhead when using multi-channel control. An API addition was necessary
to support a global broadcast channel number. The API addition does not
break the write_value() implementation for other DAC drivers in the repo.
This change is based on an out-of-tree driver developed internally to
handle this use case.

Alternative to the API change, could be a KConfig option or device tree
entry. Also, no support for the Broadcast channel was added to the
channel_setup() implementation - this may or may not be confusing. I
believe it makes sense to maintain explicit setup calls for each channel
intended to be configured.

Signed-off-by: Ben Booher <benbooher@pull-repo.com>
2024-10-26 03:59:35 +01:00
TOKITA Hiroshi
1f30346d4f drivers: dac: Add dummy driver for vnd,dac
Add dummy driver for "vnd,dac" to use in build_all tests.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-02 09:51:19 +02:00
Martin Jäger
46922b51ce drivers: dac: dac_shell: consider buffered and internal options
The buffered and internal options were not assigned in the channel_cfg,
so they would end up at a random state.

The cfg struct is now properly zero-initialized and both options can
be set using optional parameters -b and -i.

Fixes #75884

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-09-23 13:21:11 -05:00
Corey Wharton
d80174fadf drivers: dac: add checks for internal channel config
Return -ENOTSUP if these flags are specified but not supported.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Corey Wharton
2b9ed72f9e drivers: dac_stm32: make pinctrl config in the device tree optional
Now that we support internally connected channels we should make the
pinctrl configuration optional.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Corey Wharton
834cc98f39 drivers: dac_stm32: add support for internally connected channels
Adds support for configuring the STM32 DAC channel mode for internal
connections. This is only enabled for SOCs that support it.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Erwan Gouriou
d13f9d9b9b drivers: stm32: Select PINCTRL when required
Select PINCTRL subsystem by drivers which require it.
Prevent the need from enabling this symbol at board or soc level.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-09-03 14:40:55 +01:00