Commit graph zephyr/drivers
Author SHA1 Message Date
Jiafei Pan
6d166b22cc drivers: spi: spi_nxp_lpspi: fix size_t log format warnings
Use %zu instead of %d in LOG_DBG for size_t arguments (fill_len,
offset) to fix -Wformat build warnings.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2026-08-10 07:11:28 -07:00
Lucien Zhao
2c3e3d2c76 drivers: hwinfo: mcux_src_rev2: make the WDOG4 reset flag optional
Not all i.MX RT11xx SoCs implement a WDOG4 instance; on those parts
the SRC_SRSR register has no WDOG4_RST_B_M7 flag and the driver fails
to build. Take the flag into account only when the SoC header
defines it.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2026-08-10 07:10:41 -07:00
Lucien Zhao
15d75c5634 drivers: gpio: mcux_igpio: fix pinmux lookup for non-contiguous layouts
The pue_mux register layout check indexed the pinmux array with the
raw pin number, while all other accesses use the gap-compensated
cfg_idx. On a port with gpio-reserved-ranges and a compacted pinmux
map this reads the wrong entry, or past the end of the array.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2026-08-10 07:10:41 -07:00
Benjamin Cabé
c2f4cac5b1 drivers: pinctrl: mchp_port_g1: Clear OUT latch for pull-down
With PULLEN set, the PORT_OUT bit selects the pull direction. The
pull-down path never cleared a previously set OUT bit, so a requested
pull-down could configure a pull-up instead. Clear the latch in the
pull-down case, as the gpio_mchp_port_g1 driver does.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-10 07:08:58 -07:00
Erdem Simsek
a3a9dbfeed drivers: retained_mem: route nrf_ram_ctrl retention via TF-M in NS build
When CONFIG_SOC_SERIES_NRF71_TFM_RAM_CTRL_SERVICE is set, route
z_nrf_retained_mem_retention_apply() to the secure RAM-control service
(tfm_platform_ram_ctrl_retention_set) instead of nrfx_ram_ctrl; the secure
build keeps the direct nrfx path. Apply regions best-effort and return
-EIO if the secure service rejects one.

Signed-off-by: Erdem Simsek <erdem.simsek@nordicsemi.no>
2026-08-10 07:08:25 -07:00
Tibor Kiss
753b285285 spi: guard spi_context_lock against ISR blocking; use RTIO submit
- spi_context_lock: move the ISR assert from function entry to guard the
  actual blocking call (inside !already_locked), so the legitimate
  SPI_LOCK_ON fast path is not falsely caught.
- spi_context.h comment: clarify that calling from ISR is legal when the
  lock is already held via SPI_LOCK_ON.
- spi.h: point to the RTIO submit path as the correct way to chain
  asynchronous transactions, per @teburd and @npitre.

Suggested-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Tibor Kiss <kiss.tibor@gmail.com>
2026-08-10 07:05:09 -07:00
Benjamin Cabé
cb9034dca4 drivers: i3c: add help text to I3C_CONTROLLER and I3C_TARGET
Added help text for the I3C_CONTROLLER and I3C_TARGET options. While these
are promptless, they are worth explaining and should show up in the Kconfig
reference doc page so that cross-references to them can be resolved.

Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-10 09:26:51 +02:00
Mahesh Mahadevan
264554d4f7 drivers: i2s_mcux_flexcomm: Fix the TX path
The TX path was broken if we did not prefill the
TX queue with more than one block. This is because
the TX DMA was queueing a NULL block causing DMA
failures after transfer of the first block.
Added logic to wait for atleast 2 blocks before
starting a transmit.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2026-08-09 17:46:20 -04:00
Holt Sun
f3839150e9 drivers: rtc: sam0: Fix int32 overflow in get_calibration
The ppb conversion in rtc_sam0_get_calibration() multiplies the
FREQCORR correction value by 1000000000 in a 32-bit expression.
Any correction value of 3 or more overflows int32_t (3e9 >
INT32_MAX), so the reported calibration is garbage for most of
the register range (VALUE goes up to 127).

Do the multiplication in 64 bits, matching the equivalent
conversion in the Microchip G1 RTC driver. The result fits
comfortably in int32_t: with the smallest in-tree cal-constant
(983040), the maximum magnitude is 127 * 1e9 / 983040, about
129186 ppb.

Built tests/drivers/rtc/rtc_api for samc21n_xpro with
CONFIG_RTC_CALIBRATION=y.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-08-09 17:45:46 -04:00
Jakub Zymelka
2dfb81ef57 drivers: serial: nrf_uarte: restore IRQ state on DMM error
Restore the previous interrupt state when DMM RX buffer preparation
fails. Returning with the IRQ lock held could leave interrupts disabled
after uart_rx_buf_rsp() reports the error.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2026-08-09 17:45:37 -04:00
Jakub Zymelka
beed381352 drivers: serial: nrf_uarte: use DMAEND on frame timeout
Model DMAEND and FRAMETIMEOUT_DMAEND support as a devicetree
capability. Use DMAEND for finite asynchronous RX frame timeouts on
capable UARTE instances and retain STOPRX on unsupported hardware.

Disable TIMER-based byte counting when DMAEND is available. Preserve
buffer accounting when uart_rx_disable() races with an ENDRX rollover,
reject buffer responses during teardown, and restore the interrupt
state after DMM preparation failures.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2026-08-09 17:45:37 -04:00
Stefan Prisacariu
75f9205fcb drivers: sensor: tmag5273: fix invalid default ANGLE_EN setting
The default case of the angle_magnitude_axis switch programs
TMAG5273_ANGLE_EN_POS. This value sets bits outside the ANGLE_EN
field and overlaps with the adjacent range configuration bits in
SENSOR_CONFIG_2.

Use TMAG5273_ANGLE_EN_NONE instead to be corrrectly configured.

Signed-off-by: Stefan Prisacariu <stefan.prisacariu@prevas.dk>
2026-08-09 17:44:53 -04:00
Benjamin Cabé
3473034d9e drivers: rtc: rv8803: Fix weekday alarm readback
The alarm getter open-coded find_lsb_set on the weekday bitmask
without the -1 index correction, returning the weekday off by one.
Use the rv8803_mask2weekday helper like get_time.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-09 17:44:43 -04:00
Farsin Nasar V A
a21a6e242c drivers: rtc: microchip: Update RTC G1 driver
Update RTC G1 driver implementation to support PIC32CM_JH

Signed-off-by: Farsin Nasar V A <farsin.nasarva@microchip.com>
2026-08-09 17:43:56 -04:00
Hongquan Li
5208eac86a drivers: sdhc: fix R2 response order in intel_emmc_host and sam_hsmci
The Zephyr SD subsystem expects a 136-bit R2 response in
sdhc_command::response[4] with response[3] holding the most
significant 32 bits and response[0] holding the least significant
32 bits.

intel_emmc_host stored the 32-bit fragments in reverse order, so
resp3 (bits 127:96) was placed in response[0] and resp0 (bits 31:0)
in response[3]. Reverse the assignments.

sam_hsmci read the HSMCI_RSPR FIFO into response[3..0] in the order
the FIFO returns data, but that puts the most significant word in
response[0]. Read the FIFO into response[0..3] instead, matching the
Zephyr layout.

Fixes #112868

Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
2026-08-09 17:43:11 -04:00
Lubos Koudelka
46a095c44f stm32wb: add HSE/1024 support for RF wakeup clock
Add support for selecting HSE/1024 as the STM32WB RF wakeup (low speed)
clock source, as an alternative to LSE, for boards without a 32.768 kHz
LSE crystal.

The source is selected through the existing clock-cell mechanism on the
ble_rf devicetree node (e.g. <&rcc (STM32_SRC_HSE | STM32_CLOCK_DIV(1024))
RFWKP_SEL(3)>), so no new devicetree property and no clock-control driver
change are needed. The ipm_stm32wb driver reads the configured source from
that clock cell and, for HSE/1024, sets the HSE/1024 SHCI low speed clock
bit on top of the CFG_BLE_LS_SOURCE value from app_conf.h. The Cube
app_conf.h is not modified, so no companion hal_stm32 change is required.

Note: switching the RF wakeup clock source is a CPU2 clock change and
requires a power-on reset to take effect.

Signed-off-by: Lubos Koudelka <lubos.koudelka@st.com>
2026-08-09 17:42:53 -04:00
Tony Han
13b2941299 drivers: entropy: add driver for microchip,trng-g2-entropy
Add the driver for microchip,trng-g2-entropy device.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-08-09 17:42:37 -04:00
Liam Ogletree
0c3c4aff26 drivers: haptics: cirrus: Port haptics API changes to CS40L5x
Port haptics API changes to the CS40L26/27 driver, notably
*_calibrate(), *_monitor_get(), *_monitor_set(),
*_select_source(), and *_set_level(). Removes CS40L5x-specific
API functions from the public header that have been replaced
by the haptics API.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2026-08-08 16:36:01 -04:00
Benjamin Cabé
5d739e0888 drivers: stepper: gpio_step_dir: Fix step interval check for dual edge
The dual-edge minimum interval check was immediately overridden by
an unconditional check requiring twice the step width, which only
applies to single-edge stepping, so valid dual-edge intervals were
rejected. Restrict the stricter check to single-edge mode.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-08 16:35:26 -04:00
Tony Han
2fd235ffd8 drivers: clock_control: mchp: sckc: update for supporting more MPUs
Update the driver of SCLK (Slow Clock Controller) for compatible with
more MPUs such as sam9x and sama5d2 series.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-08-08 16:35:16 -04:00
Tony Han
9aa2ccf55a drivers: clock_control: mchp: split the config item for PMC and SCKC
A dedicated config item for SCKC is added so that the drivers for PMC
and SCKC can be built seperately.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-08-08 16:35:16 -04:00
Benjamin Cabé
1c440a1758 drivers: ipm: imx: Do not write back the shifted status register
The receive flag extraction used a compound shift assignment,
writing the right-shifted value back into the volatile MU status
register as a side effect. Use a plain shift into the local.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-08 16:35:08 -04:00
Jamie McCrae
b108bbbc44 soc: cmake: Remove usage of duplicate SOC_* variables
Instead uses the Kconfig values directly, which are the source of
truth

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-08-08 16:33:24 -04:00
Fabrice DJIATSA
27965929cb drivers: serial: stm32: don't force RXNE IRQ on async rx disable
uart_stm32_async_rx_disable() forced RXNE on and left the ERROR
interrupt enabled, causing per-byte/per-overrun ISR load on continuous
RX streams.

Keep async and interrupt-driven RX ownership separate: async disables
RXNE on enable and, on disable, only tears down async state and
disables ERROR. RXNE remains off; callers that switch back to
interrupt-driven RX must re-enable it via uart_irq_rx_enable().

This avoids ISR flooding for async users and matches API ownership.


Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-08-08 16:32:32 -04:00
Mike J. Chen
dee68fc485 drivers: watchdog: add support for ARM CRSAS-MA2
This adds support for the ARM Corstone System Architecture Specification
Ma2 (ARM CRSAS-MA2) Watchdog Timers.

Signed-off-by: Mike J. Chen <mjchen@google.com>
Co-authored-by: Wojciech Sipak <wsipak@antmicro.com>
Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2026-08-08 16:32:22 -04:00
Sergei Ovchinnikov
6054a36855 drivers: mfd: npm10xx: add GPIO arbitration function
nPM10 devices' GPIO pins multiplex a lot of different functions. To avoid
application-side misconfiguration, an internal arbitration function was
added.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2026-08-08 16:32:14 -04:00
Thomas Fischer
e09574eb6c drivers: display: add levetop lt7680 driver
Add a display driver for the LeveTop LT7680. This was tested with the
sample `zephyr/samples/subsys/display/lvgl`.

While this display should theoretically support all 4 orientations, I only
managed to get it working with 0 and 180 degrees, so the driver only
supports these for now.

Signed-off-by: Thomas Fischer <thomas.fischer@jumo.net>
Co-authored-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2026-08-08 16:32:06 -04:00
Madhab Sharma
2f61c7ed19 drivers: ethernet: add ch9120 driver
Added ethernet socket offload driver for
WCH CH9120 ethernet chip.

Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
2026-08-08 16:31:42 -04:00
Etienne Carriere
7ab98dc051 drivers: i2c: stm32: fix issue with shared interrupts in RTIO driver
Add a test to only process the TC and TCR interrupts if they are
enabled for the corresponding peripheral (indicated by the TCIE bit in
the CR1 register). This prevents processing twice transfer complete
sequence in case the I2C interrupt is shard between 2 I2C buses.

Update sample counter only when a sample is effectively transferred
when DMA is not used.

This change prevents de-synchronization issues for example when the I2C
bus interrupt is shared when another I2C bus and interrupt can be
triggered while there are no samples no transfer. Note that the change
in TC/TCR interrupt status is synced with the change made in the non-RTIO
driver by commit ffbc63efcb ("drivers: i2c: stm32: fix issue with shared
interrupts") that fixed issue #109993.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-08-08 16:31:23 -04:00
Etienne Carriere
d5c37abdb7 drivers: i2c: stm32: Fix rx hangs on slow devices in RTIO/DMA config
Fix an issue seen on STM32C0xx/G0xx/L0xx/U0xx where controller fails
the receive data due to DMA being armed after I2C transfer have started.

Arm DMA and enable the transfer interrupts before generating the
(repeated) START condition. The STM32 I2C controller can buffer only
two received bytes (RXDR plus the shift register) before it stretches
the clock. If the START were issued first, the controller could start
clocking bytes in while the DMA setup (dma_config()/dma_start()) is
still ongoing; on slow parts RXDR would never get drained and the
transfer would stall. Issuing START last guarantees that DMA is ready
to service the very first byte.

Assisted-by: Claude Opus 4.8
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-08-08 16:31:23 -04:00
Etienne Carriere
751594521f drivers: i2c: stm32: Default enable I2C_STM32_V2_DMA, no more experimental
Enable CONFIG_I2C_STM32_V2_DMA by default if at least a compatible
and enabled I2C device node defines 'dmas' DT properties.

Remove the EXPERIMENTAL state of I2C_STM32_V2_DMA config symbol since the
feature is now mature enough to be used.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-08-08 16:31:23 -04:00
Etienne Carriere
60d070b532 drivers: i2c: stm32: Allow using DMA in a single direction
Allow using DMA only in one direction and don't use DMA on read
messages when destination buffer is not aligned on cache line size
to prevent cache invalidation affects nearby data.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-08-08 16:31:23 -04:00
Etienne Carriere
82b84a3736 drivers: i2c: stm32: Don't enforce use of DMA in non-RTIO driver
Do not enforce use of DMA in STM32 I2C non-RTIO driver when
CONFIG_I2C_STM32_V2_DMA is enabled. Instead, rely on the devicetree
device node providing or not a DMA configuration.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-08-08 16:31:23 -04:00
Yuzhuo Liu
402fed803f drivers: dma: bee: add address conversion for flash
Convert cached flash addresses to non-cached flash addresses in Realtek
Bee DMA driver. Without this conversion, DMA may access an invalid flash
mapping and read back 0xdeadbeef.

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-08-08 16:31:05 -04:00
Yuzhuo Liu
eb525902e0 drivers: uart: bee: add async API for Realtek Bee series
Add UART asynchronous driver support for Realtek Bee series SoCs,
including RTL87x2G and RTL8752H.

This driver supports:
- Asynchronous TX/RX transfers

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-08-08 16:31:05 -04:00
Steven Chang
bcc398abd0 drivers: i2c: kb106x: i2c driver
- Add i2c driver for ENE KB106X.

Signed-off-by: Steven Chang <steven@ene.com.tw>
2026-08-08 16:30:56 -04:00
Alain Volmat
e8ea342dff drivers: video: ov5640: make window settings human readable
Reformat OV5640 window settings for each resolution in order
to make them human readable.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
649231bd3b drivers: video: ov5640: use common window setting in MIPI/DVP
Use same window settings for both MIPI and DVP mode, helping reducing
the code size of the driver as well.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
c13924c94c drivers: video: ov5640: add frmival support for DVP
Add frmival support for DVP based OV5640, making it common
with the MIPI related code.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
056aeb2233 drivers: video: ov5640: rename frmival struct into ov5640_frmrate_config
In preparation for making DVP frmrate handling common with the existing
MIPI one, rename the structure ov5640_mipi_frmrate_config into
ov5640_frmrate_config as well as associated tables.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
124a9ffc61 drivers: video: ov5640: avoid output format in init_common_dvp
Avoid setting the output format as part of init_common_dvp since
this is set via the ov5640_set_fmt function as well.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
4e13b6c0ba drivers: video: ov5640: allow dvp polarity configuration via dt
Add handling of polarity configuration via endpoint video bindings.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
0c85c19a41 drivers: video: ov5640: use available macros for registers
Use available register macros whenever possible.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
bca8cbdc40 drivers: video: ov5640: avoid duplicated dvp register settings
Remove from init_common_dvp registers which are set via the set_fmt.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
a3c6f8a0bd drivers: video: ov5640: avoid DVP specific HFLIP/VFLIP settings
HFLIP/VFLIP settings are already done as part of the common init
sequence so avoid changing them specifically in the dvp part as
this is also accessible via dedicated controls.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Alain Volmat
d1cc3b786e drivers: video: ov5640: perform ID check first at init
Perform the sensor ID register check first before doing anything
else after the reset of the sensor.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-08-08 16:30:30 -04:00
Jordan Yates
a6d2b36371 charger: bq2518x: support charge termination configuration
Allow the charge termination threshold to be configured in devicetree.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-08-08 15:22:39 -04:00
Benjamin Cabé
a5f2e67913 drivers: virtio: minor cleanups
Use BIT64() for the chain length limit, compare pointers against
NULL and drop a store already covered by the memset().

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-08 15:21:51 -04:00
Benjamin Cabé
acd455913c drivers: virtio: streamline available ring update
Read avail->idx from shared memory once, replace the modulo with a
mask since queue sizes are powers of two, and make the helper void
as it cannot fail.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-08 15:21:51 -04:00
Benjamin Cabé
b378dbfe21 drivers: virtio: use a single allocation per virtqueue
Carve the free descriptor stack storage out of the virtqueue
allocation instead of relying on a second, hidden k_malloc() in
k_stack_alloc_init(), whose return value was not checked.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-08 15:21:51 -04:00