Commit graph zephyr/drivers
Author SHA1 Message Date
Bjarki Arge Andreasen
e85a5ee98c spi: rtio: make the shared rtio ctx of struct spi_rtio thread safe
Don't rely on drivers protecting the spi_rtio ctx from multiple
threads as this is generic and could just be part of the spi_rtio
context to avoid duplicate code and thus make using it safer and
more efficient.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-04-14 22:07:40 -04:00
Bjarki Arge Andreasen
652d2a7b2a spi: rtio: patch spi_rtio_copy transceive with empty buffer
The spi_rtio_copy implementation incorrectly sets up a transceive sqe
in place of a write or read when an empty "spacer" spi_buf is passed
which is not aligned with the "opposing" spi_buf. Using transceive in
these cases passes a NULL receive/transmit buffer with positive length,
which is a bug.

Some drivers have an additional check to clear the size if the buffer
is NULL, but we should not rely on this check in drivers as it is
duplicate code.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-04-14 22:07:40 -04:00
Ruoshan Shi
9231f554cb drivers: mipi dsi: Reorganize platform-specific code in dsi nxp dwc driver
Move variable declarations into platform-specific conditional blocks
and extend i.MX93 support to include M33 core. This eliminates unused
variable compilation warnings without affecting existing platform
functionality.

Signed-off-by: Ruoshan Shi <ruoshan.shi@nxp.com>
2026-04-14 22:06:04 -04:00
Ruoshan Shi
f44192dff9 drivers: display: add RM67199 driver support
Added rm67199 driver for i.MX93 display.

Signed-off-by: Ruoshan Shi <ruoshan.shi@nxp.com>
Signed-off-by: Winteri Wang <dongjie.wang@nxp.com>
2026-04-14 22:06:04 -04:00
Ruoshan Shi
4cb4833c7b soc: imx93: enable imx93 video pll
Added video_pll instance to soc dtsi.

Signed-off-by: Ruoshan Shi <ruoshan.shi@nxp.com>
2026-04-14 22:06:04 -04:00
Ruoshan Shi
136420ca03 drivers: display: mcux_lcdifv3: fix pointer cast warning
- Added mcux_lcdifv3_set_pixel_format api
- Fix pointer-to-integer cast error by using uintptr_t intermediate cast
instead of direct uint64_t cast
- Fixed the pixel_format setting on waveshare_dsi_lcd shield

Signed-off-by: Ruoshan Shi <ruoshan.shi@nxp.com>
2026-04-14 22:06:04 -04:00
Fin Maaß
9dccf71c77 drivers: spi: litex: support setting the spi mode
support setting the spi mode.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-04-14 22:05:05 -04:00
Fin Maaß
2445992057 drivers: spi: litex: use new clk divisor
use new clk divisor of litespi.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-04-14 22:05:05 -04:00
Fin Maaß
025cced614 drivers: spi: litex: use mem_addr_t for register addresses
use mem_addr_t for register addresses.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-04-14 22:05:05 -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
Andreas Schweigstill
324338ad39 adi_tmc: Corrected calls of read_actual_position()
Replaced them with tmc50xx_read_actual_position() resp.
tmc51xx_read_actual_position().

Signed-off-by: Andreas Schweigstill <andreas@schweigstill.de>
2026-04-14 22:00:07 -04:00
Sylvio Alves
711e3bebf0 drivers: i2c: esp32: enable i2c controller clock on init
Call i2c_hal_init() during driver init and after the clock
off/on cycle in i2c_hw_fsm_reset(). On SoCs where the
controller clock gate defaults to off, the peripheral would
not respond until explicitly enabled, matching the behavior
of ESP-IDF's i2c_hal_init().

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-04-14 13:08:51 -05:00
Eliott Speyser
61a59366b8 doc: drivers/modem: Typo fixes
Fix some typos: s/wich/which and s/unsolicitet/unsolicited

Signed-off-by: Eliott Speyser <eliott.speyser@st.com>
2026-04-13 11:04:42 -05:00
Raffael Rostagno
80ee819be5 drivers: systimer: xtensa: Fix ISR/idle_exit concurrency
IDLE exit is programmed to happen shortly before systimer
programmed wake-up event happens. If the interrupt from
the timer happens before, idle_exit() does not run, as
timeout_idle flag is cleared at the ISR. Fix condition for
both systimer (ESP32) and xtensa drivers.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-04-08 07:40:46 -04:00
rob-zeno
425108a4fd drivers: flash: mcux_c40: fix incompatibility with partition macros
Fixes zephyrproject-rtos/zephyr#106597

The current driver for the NXP C40 flash controller instantiates two
drivers, one for the controller (which has no real code -- it's just
a device with no API, config, or data), and one for the flash bank.
This breaks the various partition APIs because they expect the flash
driver API to be attached to the "grandparent" of the partitions
object -- but in the current C40 driver, it is attached to the parent.

I was worried this fix was going to be more complicated, but it
appears to have been quite simple. All I needed to do was to
instantiate a single device with the the API, config and data.

The fix requires the "soc-nv-flash" compatibility to be added to
device trees which reference this driver (see previous commit).

This fix addresses the bug report I filed a few days ago:

NXP C40 flash driver incompatibility with partitions macro APIs #106597

Signed-off-by: Rob Newberry <rob@zenomoto.com>
Signed-off-by: rob-zeno <rob@zenomoto.com>
2026-04-07 15:39:39 -04:00
Nicolas Pitre
7735bf3bb8 drivers: timer: intel_adsp_timer: use sys_clock_lock() to fix SMP race
Migrate intel_adsp_timer to the unified timer lock API. Replace the
driver-private spinlock with sys_clock_lock()/sys_clock_announce_locked().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-07 11:40:49 -05:00
Nicolas Pitre
8ee79c2dd3 drivers: timer: apic_tsc: use sys_clock_lock() to fix SMP race
Migrate apic_tsc to the unified timer lock API. Replace the
driver-private spinlock with sys_clock_lock()/sys_clock_announce_locked().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-07 11:40:49 -05:00
Nicolas Pitre
59d4ffeea6 drivers: timer: hpet: use sys_clock_lock() to fix SMP race
Migrate hpet to the unified timer lock API. Replace the driver-private
spinlock with sys_clock_lock()/sys_clock_announce_locked().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-07 11:40:49 -05:00
Nicolas Pitre
86dafedbfb drivers: timer: xtensa_sys_timer: use sys_clock_lock() to fix SMP race
Migrate xtensa_sys_timer to the unified timer lock API. Replace the
driver-private spinlock with sys_clock_lock()/sys_clock_announce_locked()
so that the hardware cycle baseline and the kernel tick counter are
always updated under the same lock.

Also migrate sys_clock_idle_exit() which updates driver state and
announces ticks on LPM exit.

Add extern declarations for sys_clock_cycle_get_32/64 in
arch/xtensa/arch.h, consistent with all other architectures, to
avoid a circular include dependency with system_timer.h. Xtensa
was the only architecture missing them.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-07 11:40:49 -05:00
Nicolas Pitre
8daab8d5d0 drivers: timer: riscv_machine_timer: use sys_clock_lock() to fix SMP race
Migrate riscv_machine_timer to the unified timer lock API. Replace the
driver-private spinlock with sys_clock_lock()/sys_clock_announce_locked()
so that the hardware cycle baseline (last_count) and the kernel tick
counter (curr_tick) are always updated under the same lock.

This eliminates a race on SMP where sys_clock_elapsed() could observe
the updated last_count before sys_clock_announce() had advanced
curr_tick, causing time-dependent kernel operations to see inconsistent
values.

Remove internal locking from sys_clock_set_timeout() and
sys_clock_elapsed() as they are now always called with the timer lock
held.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-07 11:40:49 -05:00
Nicolas Pitre
9ee7e6af75 drivers: timer: arm_arch_timer: use sys_clock_lock() to fix SMP race
Migrate arm_arch_timer to the unified timer lock API. Replace the
driver-private spinlock with sys_clock_lock()/sys_clock_announce_locked()
so that the hardware cycle baseline (last_cycle) and the kernel tick
counter (curr_tick) are always updated under the same lock.

This eliminates a race on SMP where sys_clock_elapsed() could observe
the updated last_cycle before sys_clock_announce() had advanced
curr_tick, causing time-dependent kernel operations to see inconsistent
values.

Remove internal locking from sys_clock_set_timeout() and
sys_clock_elapsed() as they are now always called with the timer lock
held.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-07 11:40:49 -05:00
Joakim Tjernlund
67b5d58c26 arm64: Set DS bit if GIC_SINGLE_SECURITY_STATE
This need to be set while in secure mode so do so in while in EL3

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
2026-04-07 11:34:49 -05:00
Etienne Carriere
4109e78632 drivers: i2c: stm32_v2: fix indentation in multi-line test conditions
Change indentation on multi-line test instruction for consistency
and to ease readability. Also replace 2 tabulations with a space char.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-04-07 11:32:23 -05:00
Etienne Carriere
97e77171e2 drivers: i2c: stm32_v2: consider i2c_configure() speed argument
Consider the I2C speed argument pass to i2c_configure() (or
i2c_dt_configure()) in stm32_v2 I2C driver.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-04-07 11:32:23 -05:00
Jjateen Gundesha
0c9fd34a46 drivers: adc: lpadc: fix calibration sequencing with 1us delay
LPADC_DoOffsetCalibration() triggers offset calibration but returns
immediately without waiting for it to complete. If gain calibration
is requested before offset calibration finishes, the hardware silently
rejects it and GCC[RDY] never asserts, causing
LPADC_FinishAutoCalibration() to spin forever at boot (~50% of the
time on affected boards like FRDM-MCXA266).

Fix by replacing LPADC_DoAutoCalibration() with the split HAL API:
  LPADC_PrepareAutoCalibration() + k_busy_wait(1U) +
  LPADC_FinishAutoCalibration()

The 1us busy-wait gives offset calibration sufficient time to complete
on all LPADC platforms before the gain calibration request is issued.
Only the HAS_CTRL_CALOFS path is affected (the path that also calls
DoOffsetCalibration); the HAS_CFG_CALOFS path has no preceding offset
calibration and is left unchanged.

Fixes #105652

Signed-off-by: Jjateen Gundesha <jjateen97@gmail.com>
2026-04-07 08:39:42 -05:00
Pete Johanson
a3962e2290 drivers: spi: MAX32 DMA + RTIO fixes
Correct some behaviors that were broken in the original SPI DMA + RTIO
work:

* Properly fallback to interrupt behavior if no DMA channels are assigned
  to a given SPI peripheral.
* Properly handle held CS lines across transactions when using hardware CS
  control.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-04-07 08:39:07 -05:00
Shreyas Shankar
785633e585 drivers: interrupt_controller: Fix VIM assert
The VIM IP has a register that informs the maximum
number of interrupts that can be supported.

The ASSERT must check whether the number of IRQs
is LESSER THAN OR EQUAL to above register value,
not a strict equality check.

Signed-off-by: Shreyas Shankar <s-shankar@ti.com>
2026-04-07 08:37:58 -05:00
John Batch
7796339c41 drivers: clock_control: infineon: fix psc3m5 build error
Updates the legacy HAL version of the Infineon clock control driver to
be excluded for devices not using the legacy HAL based drivers.

This fixes a failure in the libraries.devicetree.api_ext test, which
on PSC3M5 introduces a "fixed-clock" DTS note that causes
DT_HAS_FIXED_CLOCK_ENABLED and SOC_FAMILY_INFINEON_CAT1 to both be
selected.  This results in the HAL based driver being incorrectly
included in the build, causing build errors.

Assisted-by: GitHub Copilot:claude-opus-4.6
Signed-off-by: John Batch <john.batch@infineon.com>
2026-04-07 08:36:58 -05:00
Fengming Ye
a4010304f7 drivers: wifi: nxp: fix build error for custom host platform
Fix build error when independent reset is enabled on custom host.
Add out-of-band reset kconfig option to guard dependency on host GPIO,
so that in-band independent reset can be supported by default.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2026-04-07 08:36:27 -05:00
Jianchao Wang
3855c04157 drivers: can_mcux_flexcan: Ensure that prop_seg is aligned with fsl_flexcan
In the `FLEXCAN_SetTimingConfig` function(fsl_flexcan.c), the following
statement is implemented when the Enhanced Bit Timing Register is enabled:
```
base->ENCBT = CAN_ENCBT_NRJW(pConfig->rJumpwidth) |
              CAN_ENCBT_NTSEG1((uint32_t)pConfig->phaseSeg1 +
                               pConfig->propSeg + 1U) |
              CAN_ENCBT_NTSEG2(pConfig->phaseSeg2);
```
`prop_seg + 1` represents the length of the propagation segment.
- `pConfig->propSeg` = `flexcan_config.timingConfig.propSeg`
- Therefore, flexcan_config.timingConfig.propSeg(can_mcux_flexcan.c) should
  be equal to `data->timing.prop_seg - 1U`.
Fixes: #106238

Signed-off-by: Jianchao Wang <Jianchao.wang_1@nxp.com>
2026-04-07 08:35:29 -05:00
David J. Leach, Jr.
91f2980f6b drivers: crypto: ataes132a: fix integer overflows in CRC and commands
This commit addresses two integer handling issues in the ataes132a
crypto driver identified by coverity scans.

1. In ataes132a_send_command, added a centralized validation check
   to ensure the 'nparams' value, when combined with the 5-byte
   packet overhead, does not exceed the 8-bit 'count' limit or the
   physical 64-byte command buffer. This prevents a potential wrap-
   around that would cause the chip to receive an invalid length byte.

2. In the Atmel CRC calculation, added an explicit cast to uint16_t
   during the bit-shift operation. This prevents unintended integer
   promotion and satisfies static analysis regarding potential
   overflows during the 16-bit CRC generation.

Fixes #84683
Fixes #84690

Signed-off-by: David J. Leach, Jr. <tasmar@gmail.com>
2026-04-06 10:29:20 -05:00
Fabrice DJIATSA
46f2c75b21 drivers: watchdog: stm32: stm32wb0 series don't support *_FreezePeriph
STM32WB0 watchdog does not support disable the Debug
module during STANDBY mode once the DBGMCU
clock is enabled.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-04-03 23:12:22 +09:00
Sylvio Alves
d473e33fc6 drivers: mbox: espressif: fix missing guard for ESP32-C5
If building mbox driver for ESP32-C5, it fails due to
invalid headers. Add needed guard for that SoC.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-04-02 13:13:17 -05:00
yueling hu
763626c19c drivers: flash: shell: Fix result for test command
Fix return value issue when comparing errors

Fixes:   drivers/flash/flash_shell.c

Signed-off-by: yueling hu <502966985@qq.com>
2026-04-02 13:09:19 -05:00
Anand Kumar
93bed12c18 clock: esp32: treat already-enabled clock as success
Return 0 from clock_control_esp32_on() when the peripheral clock is
already on, matching clock_control_on() success semantics.

Signed-off-by: Anand Kumar <anandvtu16158@gmail.com>
2026-04-02 08:51:00 -05:00
Aksel Skauge Mellbye
315da11745 drivers: adc: siwx91x: Fix clock configuration
Since `a78cd34` the ADC driver did not correctly configure
its internal divisor. The responsibility was moved from the
clock control driver to the ADC driver and the `init` function
of the ADC driver was updated accordingly. But the driver
continued calling the clock control API from the `configure`
function, leading to `-EINVAL` being returned.

Correctly configure the internal divisor in the ADC driver by
calling the HAL API directly.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-04-02 08:48:48 -05:00
Muzaffar Ahmed
84e95b9046 drivers: wifi: siwx91x: Fix twt_capable by inferring it from link mode
The twt_capable field in wifi status earlier was hardcoded to true. It
seems better to set it to true only when the link mode is 802.11ax or
higher.

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2026-04-02 08:48:26 -05:00
Pieter De Gendt
19335b22c5 drivers: rtc: Use DEVICE_API macro
Put RTC device driver APIs into corresponding iterable section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-02 08:47:22 -05:00
Pieter De Gendt
c7dc4281af drivers: flash: Use DEVICE_API macro
Put flash device driver APIs into corresponding iterable section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-02 08:47:22 -05:00
Pieter De Gendt
793614dbf9 drivers: crypto: Use DEVICE_API macro
Put crypto device driver APIs into corresponding iterable section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-02 08:47:22 -05:00
Pieter De Gendt
6620d37769 drivers: clock_control: Use DEVICE_API macro
Put clock control device driver APIs into corresponding iterable section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-02 08:47:22 -05:00
Pieter De Gendt
9b3a60b5b3 drivers: bluetooth: hci: Use DEVICE_API macro
Put BT_HCI device driver APIs into corresponding iterable section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-02 08:47:22 -05:00
Pieter De Gendt
acf7dd4847 drivers: adc: Use DEVICE_API macro
Put ADC device driver APIs into corresponding iterable section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-02 08:47:22 -05:00
Mohit Talwar
383b1a5349 drivers: flash: mcux: clear caches after erase and write on Kinetis
Kinetis ke1xf (twr_ke18f/mke18f16) and k8x (frdm_k82f) select
CONFIG_HAS_MCUX_CACHE but previously fell through to the no-op
clear_flash_caches() path, meaning caches were not invalidated
after flash erase or write operations.

After the FTFE controller completes an erase or write, stale data
may remain in the instruction cache and (on some parts) the system
bus cache. Subsequent reads can return outdated values instead of
updated flash contents. This causes test_flash_erase,
test_flash_fill, and test_flash_flatten in
tests/drivers/flash/common to fail, with data read back as stale
values (e.g. 0xAA from a prior fill).

Rebased on top of #105918 and updated to use Zephyr's generic cache
API (sys_cache_instr_invd_all() / sys_cache_data_invd_all()) for
cache invalidation. This keeps the flash driver SoC-agnostic and
relies on the cache driver (e.g. LMEM) for hardware-specific
handling.

Fixes #98487

Signed-off-by: Mohit Talwar <talwarmohit2005@gmail.com>
2026-04-02 08:42:14 -05:00
Holt Sun
1cabbd3bdd drivers: cache: lmem: check cache enable state
LMEM cache maintenance helpers can be called before the
underlying code or system cache has been enabled.

This becomes visible on RT11xx CM4 targets once the generic ARM MPU
nocache-memory cleanup path uses the generic cache API for non-ARCH
cache backends during early boot. In that case, LMEM maintenance
requests must not blindly access the hardware while ENCACHE is clear.

Check the corresponding LMEM enable bit before performing code or
system cache maintenance. Return -EAGAIN when the selected cache is
currently disabled, and keep disable requests as a no-op when the
cache is already off.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-04-01 15:11:35 -05:00
Benjamin Gwin
28b8e6e875 drivers: udc_dwc2: Fix missing break statement
This code would fail to compile if compiled with
`-Werror=implicit-fallthrough=`. The fallthrough does not seem to be
intentional as it is handling 2 discrete events.

Signed-off-by: Benjamin Gwin <bgwin@google.com>
2026-04-01 11:55:18 -05:00
Nick Stoughton
12ba507599 drivers: serial: nrfx_uarte: remove unused variable
Removes compiler warning if `CONFIG_UART_USE_RUNTIME_CONFIGURE` is not
defined.

Signed-off-by: Nick Stoughton <nick.stoughton@eargo.com>
2026-04-01 11:51:24 -05:00
Fabio Baltieri
a258a4b017 auxdisplay: gpio-7seg: fix display glitch
The current code resets the refresh_pos pointer on write, but does not
clear the corresponding digit drive pin. This means that the next timer
iteration is going to set the gpio for digit 0, but any other digit may
still be selected, which would cause a glitch on that digit for the
cycle.

There's no real need to reset this pointer on write though so just drop
the line, then the timer refresh just catches up to the new string and
the display is stable.

Also drop the reset line from the clear function as it does not make
much sense there either, but reset on timer end so that the next cycle
starts from the first digit.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-04-01 11:50:08 -05:00
Ren Chen
db64bd6acf drivers: watchdog: it51xxx: improve error handling
`tests/drivers/watchdog/wdt_error_cases` test was failing
on `it51xxx_evb/it51526aw` due to insufficient error
handling. This change fixes those issues, and the following
tests now pass.
- tests/drivers/watchdog/wdt_error_cases
- tests/drivers/watchdog/wdt_basic_api
- tests/drivers/watchdog/wdt_basic_reset_none
- tests/drivers/watchdog/wdt_variables
- samples/drivers/watchdog

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-04-01 09:17:29 -05:00
Ren Chen
06f17b1768 drivers: adc: it51xxx: validate buffer size in start_read()
Move buffer size validation into `start_read()` to prevent adc
context from getting stuck. This issue is revealed by
`tests/drivers/adc/adc_error_cases` test.

Also, this patch adds check for unsupoorted options, including
oversampling and invalid resolution and adds support for higher
channel range. (8 and above).

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-04-01 09:16:23 -05:00