Commit graph zephyr/drivers
Author SHA1 Message Date
Manimaran A
0a0f59e576 drivers: serial: mchp_xec: drain TX before suspend
Spin on Transmitter Empty at the top of PM_DEVICE_ACTION_SUSPEND so an
in-flight byte finishes shifting before LD_ACTIVATE is cleared. Without
this, poll_out callers (printk, LOG_MODE_MINIMAL) get their last byte
cut off mid-shift on every suspend, producing garbled console output.
No-op when TX is already idle.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2026-06-10 14:54:10 -04:00
Ren Chen
92a1a49bf7 drivers: clock_control: it51xxx: add 96MHz pll frequency support
This change adds the 96MHz PLL frequency configuration required
when the usb interface is enabled. It also introduces a kconfig
option to enable sof calibration for improving usb clock accuracy.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-06-10 14:53:46 -04:00
Benjamin Cabé
6af7a9d6dc drivers: audio: dmic: add new dmic shell module
Add a shell module for digital microphone devices, enabled with
CONFIG_AUDIO_DMIC_SHELL, exposing the "dmic" command with three
subcommands:

- read: capture a number of blocks and print the per-channel peak
  level, for a quick "is the mic working" check.
- vu:   show a live level meter, one horizontal bar per channel.
  The filled bar is the current block peak in dBFS, a '|' tick
  marks the recent peak hold and a red '!' flags clipping.
- dump: stream captured PCM as base64 over the console for offline
  playback, with copy-paste instructions for ffplay/sox.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.8
2026-06-10 14:53:27 -04:00
Raffael Rostagno
9b6b63ce0c drivers: mcpwm: esp32: PM support
Add PM support for ESP32 devices for MCPWM driver.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-06-10 13:12:00 +02:00
Surya Prakash T
f18c5499b7 drivers: counter: shell: fix off-by-one check in periodic loop
Migrate the periodic loop to a standard for-loop to fix
an off-by-one check in the periodic timer shell command.

Signed-off-by: Surya Prakash T <suryat@aerlync.com>
2026-06-10 11:01:57 +02:00
Surya Prakash T
acdfb06631 drivers: counter: shell: start counter after configuration
Call counter_start() after configuration to prevent indefinite hangs.

Signed-off-by: Surya Prakash T <suryat@aerlync.com>
2026-06-10 11:01:57 +02:00
Surya Prakash T
3feed15813 drivers: counter: shell: validate tick values against hardware max
Check calculated ticks against counter_get_max_top_value() to block
delays that exceed the hardware timer's range.

Signed-off-by: Surya Prakash T <suryat@aerlync.com>
2026-06-10 11:01:57 +02:00
Surya Prakash T
a75a47a749 drivers: counter: shell: defer semaphore initialization
Move k_sem_init() until after parse_device() completes successfully to
prevent leaving stale semaphore configurations on early error exits.

Signed-off-by: Surya Prakash T <suryat@aerlync.com>
2026-06-10 11:01:57 +02:00
Surya Prakash T
41fc33c28d drivers: counter: shell: propagate return code from counter_stop
Return the actual error code from counter_stop() instead of relying on
unreliable hardware tick comparisons via counter_get_value().

Signed-off-by: Surya Prakash T <suryat@aerlync.com>
2026-06-10 11:01:57 +02:00
Benjamin Cabé
b63c22e9bd include: clock_control: agilex: move clock_agilex_ll.h to drivers/
The clock_agilex_ll.h header is not meant to be public API and only
contains register definitions meant for internal use by the drivers.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-10 10:57:17 +02:00
Thomas Hebb
9e7c3d7ece drivers: sdhc: imx_usdhc: Replace IMX_USDHC_NOCACHE_TAG with __nocache
These are both gated on CONFIG_NOCACHE_MEMORY and both place the symbol
in a non-cacheable section, so there's no reason to define our own
macro. The only difference is that __nocache uses a file-specific
section name, which helps with debugging but shouldn't affect
functionality.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2026-06-10 10:56:45 +02:00
Tomas Barak
60ba990cc9 drivers: i2s: add native_sim file backend
Add a native_sim file-backed I2S controller for RX, TX,
and loopback tests.

The driver reads and writes PCM data through host-libc
file I/O and supports configurable stream direction.
It exposes standard I2S trigger handling, provides
command-line overrides for the RX and TX file paths,
is documented in the native_sim board guide, and adds
I2S to the supported peripherals in native_sim.yaml.

Assisted-by: GitHub Copilot:GPT-5.4

Signed-off-by: Tomas Barak <tomas.barak@nxp.com>
2026-06-10 10:53:09 +02:00
Jean Yuan
7af0cd35b0 drivers: adc: add support for ADS1118 ADC
- Implement ADS1118 ADC driver
- Add support for temperature sensor mode
- Add ADS1118 ADC configuration in Kconfig

Signed-off-by: Jean Yuan <jyuan@testo.net.cn>
2026-06-10 10:52:48 +02:00
Pieter De Gendt
f429e2518a drivers: display: ili9341: Replace BUILD_ASSERT with min/max-len
Add min-len/max-len to properties instead of BUILD_ASSERTs.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-06-10 07:49:21 +02:00
Johan Hedberg
76d92d502b drivers: bluetooth: hci_bflb: Fix send() buffer ownership contract
The bt_hci_driver_api send() contract requires that the buffer
reference is only consumed (unreffed) on success. On error, the
caller retains ownership and is responsible for unreffing the buffer.

bt_bflb_send() was unconditionally calling net_buf_unref() at a
goto done label, incorrectly consuming the buffer on all error paths.

Fix by returning early on each error path (without unreffing), and
unreffing only on the success path.

Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-10 07:49:04 +02:00
Johan Hedberg
9a684b5c31 drivers: bluetooth: hci_bee: Fix send() buffer ownership contract
The bt_hci_driver_api send() contract requires that the buffer
reference is only consumed (unreffed) on success. On error, the
caller retains ownership and is responsible for unreffing the buffer.

bt_hci_bee_send() was unconditionally calling net_buf_unref() at a
goto done label, incorrectly consuming the buffer on error paths too.
Additionally, buf->len was accessed after the unref, constituting a
use-after-free.

Fix by returning early on each error path (without unreffing), and
unreffing only on the success path.

Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-10 07:49:04 +02:00
Johan Hedberg
e6d36ffba3 drivers: ethernet: Use net_buf_drop() where applicable
Replace the two-line pattern:

  net_buf_unref(buf);
  buf = NULL;

with net_buf_drop(&buf) which performs both operations
atomically in a single step.

Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-10 07:48:40 +02:00
Jilay Pandya
04fceba6a0 drivers: stepper: tmc: fix clock frequency
wrong device passed to get_clock_frequency leads to incorrect
ramp and velocity calculation

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2026-06-10 07:48:20 +02:00
James Growden
77a47a41d9 drivers: intc_dw: fix build errors for flags not existing
We recently changed from "sense" to "flags", however,
this controller compatible never defined sense so thus
it errors out since it doesn't have enough cells.

Solution (like i2c_dw) is to fall back to 0 if the IRQ
doesn't have the flags cell.

Signed-off-by: James Growden <jgrowden@tenstorrent.com>
2026-06-10 07:46:02 +02:00
Sarah Younis
01865b9d3b drivers: mspi: stm32 ospi, xspi, qspi drivers with multiple instances
Fix the dev_id intialization.
Index is a structure reflecting the mspi_dev_id instance.

Signed-off-by: Sarah Younis <zephyr@exalt.ps>
2026-06-10 07:45:15 +02:00
Manimaran A
6b34e23e93 drivers: i2c: mchp: implement own address 2 feature
Extend the i2c_mchp_xec_v2 driver to support the "own address 2"
hardware configuration. This capability enables the I2C target
controller to detect and service requests from two unique addresses.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2026-06-10 07:42:32 +02:00
Julien Panis
0ff8c2621b drivers: firmware: scmi: pinctrl: Allow zero configs for valid function IDs
The SCMI spec allows zero configs for a function-only request, but
says that if the number of configurations is zero, fid_valid (bit 10)
must not be zero.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2026-06-09 20:02:03 +02:00
Eliott Speyser
2747b03a8b drivers: spi: stm32: add log level config
When CONFIG_LOG_DEFAULT_LEVEL is set to 4 and SPI driver is used,
it will log debug messages idependently of CONFIG_SPI_LOG_LEVEL.
This allows disabling debug logs with the SPI log level config.

Signed-off-by: Eliott Speyser <eliott.speyser@st.com>
2026-06-09 20:01:47 +02:00
Benjamin Cabé
e281d8b273 drivers: audio: codec: use DEVICE_API_IS in codec shell
Codec is now a proper driver class, so use DEVICE_API_IS to check if a
device is a codec.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-09 20:00:07 +02:00
Benjamin Cabé
1cf451d942 drivers: audio: codec: make audio codec a proper driver class
There is no reason to not have audio codec be a proper driver class,
so make the appropriate change so that codec drivers actually populate a
driver_api struct.

A similar change was made to the DMIC driver class in commit 4f8a71fb.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-09 20:00:07 +02:00
Bjarki Arge Andreasen
b8ead74673 drivers: spi: spi_nrfx_spim: patch to support nothread
The spi_nrfx_spim device driver is used in nothread bootloaders, the
wake implementation waits on a k_sem, patch to poll a volatile bool
variable if CONFIG_MULTITHREADING=n

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-06-09 19:58:47 +02:00
Muhammad Waleed Badar
6cad4eec23 drivers: uart: bcm2711: switch to clocks phandle for platform clock
Use the `clocks` phandle to obtain the UART peripheral clock instead
of `clock-frequency` property. Update the binding and BCM2711 DTS
accordingly and rename the driver configuration field from
`clocks` to `pclk`.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-06-09 19:58:10 +02:00
Flavio Ceolin
1b1ecdc438 drivers: flash: add device validation in flash_copy syscall
Add K_SYSCALL_DRIVER_FLASH checks for src_dev and dst_dev in
z_vrfy_flash_copy() to ensure both devices implement the required
flash driver API before proceeding with the copy operation.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-06-09 19:56:53 +02:00
Mario Paja
320ac06200 drivers: i2s: stm32c5 add i2s support
These changes enable i2s support on stm32c5 series.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2026-06-09 19:55:47 +02:00
Mario Paja
c53f60d7cc drivers: i2s: stm32 disable i2s defore dma
These changes disable I2S before DMAReq.
In platforms like (N6xx, C5xx, H5xx etc.) TXDMAEN & RXDMAEN
are write protected while SPI is enabled. (RM0486, RM0522, RM0481)
In H7xx TXDMAEN & RXDMAEN are not write protected.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2026-06-09 19:55:47 +02:00
minyuan xue
02e33d0328 drivers: flash: add ameba flash driver
Add realtek ameba flash driver.

Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>
2026-06-09 19:54:32 +02:00
Siddhant Modi
d715c83181 drivers: wifi: esp32: add WPA Enterprise support
Wire the ESP32 Wi-Fi driver to Espressif's Enterprise EAP client APIs.

This adds support for WPA2/WPA3 Enterprise station connections through
Zephyr Wi-Fi management, including EAP-TLS, PEAP, TTLS, and WPA3
Enterprise mode selection.

Signed-off-by: Siddhant Modi <siddhant.modi@gmail.com>
2026-06-09 15:37:14 +02:00
Mathieu Choplain
33ed1c41b9 drivers: dma: stm32: v1: interpret burst size parameter correctly
Per DMA API, the `<dir>_burst_length` parameters are number of bytes;
however, the burst size for STM32 DMAv1 is in number of beats per burst,
not in number of bytes (where each "beat" = `<dir>_data_size` bytes).

Update driver to compute burst sizes properly instead of using the raw
`<dir>_burst_length` value as number of beats.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-06-09 13:44:55 +02:00
Mathieu Choplain
15511d4b84 dts: bindings: i2s: stm32_sai: map sub-blocks in top-level address space
Due to top-level SAI nodes lacking the `ranges` property, the sub-blocks
were mapped in a separate address space despite really being MMIO. As a
result, the `DT_REG_ADDR()` value was not correct and the driver had to
compensate by performing arithmetic to obtain the right address.

Update the SAI binding to enable use of `ranges` property at top-level:
notably, `#size-cells = <1>` is needed (instead of `#size-cells = <0>`)
because `ranges` property have no effect if the length is not specified.
Also update DTSI files to follow the new pattern, and drop the manual
math from the driver: `DT_REG_ADDR()` now returns the proper address for
SAI sub-block nodes.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-06-09 13:43:47 +02:00
Julien Panis
336169e2c8 drivers: pinctrl: renesas: Add support for R-Car X5H pinctrl
Add support for pinctrl to R-Car X5H SoC. Like for other Renesas SoCs,
a node approach is implemented (no grouping approach).

Pin configuration operations can optionally be performed through SCMI
(System Control and Management Interface).

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2026-06-09 13:43:37 +02:00
Julien Panis
233c38ca31 drivers: pinctrl: renesas: rcar: Change pfc_rcar_get_reg_index() prototype
Replace uint8_t with uint16_t for pin parameter. Some SoCs may have
more than 8 GPIO groups.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2026-06-09 13:43:37 +02:00
Jakub Zymelka
714b19a308 drivers: flash: nrf_rram: add NRF_RRAM_FILL_SKIP_IF_FILLED
Opt-in optimisation for the api->fill callback (and, transitively,
flash_fill() and flash_flatten()): scan the target region in 16-byte
write-line granularity with a fast 4x32-bit compare and skip the
physical write entirely for lines that already hold the fill value.
Consecutive dirty lines are batched into a single underlying
nrf_write().

Disabled by default because it changes the worst-case latency profile
of fill operations; enable explicitly when write endurance matters
more than absolute determinism.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2026-06-09 13:42:41 +02:00
Jakub Zymelka
f2edef49ad drivers: flash: nrf_rram: implement api->fill callback
Wire up the nRF RRAM driver to the new optional flash_api_fill
callback so flash_fill() and flash_flatten() on no-erase devices can
complete a region-fill in a single bulk operation instead of a long
write loop driven by CONFIG_FLASH_FILL_BUFFER_SIZE.

Result: a region-fill is now one rram_write() call covering the full
range, replacing thousands of write-block-sized api->write() calls
that each forced a hardware buffer commit. Flash_flatten() on RRAM
becomes effectively a single optimized memset.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2026-06-09 13:42:41 +02:00
Jakub Zymelka
9740d1b39c drivers: flash: dispatch flash_fill via api->fill when available
Prefer api->fill() when the driver provides it. Drivers that don't
implement the new callback (the vast majority today) keep using the
existing write-loop path with no behaviour change. The check is placed
after argument validation so misuse is caught the same way for both
paths, and before allocating the stack buffer so a fill-capable driver
does not pay for an unused CONFIG_FLASH_FILL_BUFFER_SIZE allocation.

This also fixes the long-standing inconsistency where flash_flatten()
on a no-erase device had to dispatch through flash_fill()'s slow loop
even when the underlying driver had a perfectly good bulk-fill path
available - flash_fill() now picks the fast path automatically.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2026-06-09 13:42:41 +02:00
Jakub Zymelka
4ffd1b8315 drivers: flash: add optional flash_api_fill driver callback
Add a new optional `flash_api_fill` callback type and matching field in
`struct flash_driver_api`. The callback lets a driver provide an
optimized implementation of fill-with-value (the operation that backs
`flash_fill()` and, transitively, `flash_flatten()` on devices without
explicit erase). When the field is left NULL behaviour is unchanged:
`flash_fill()` keeps using its generic write-loop emulation, so this is
a fully backwards compatible API extension and existing drivers compile
and run unchanged.

Explicit-erase drivers may also implement it when an internal command
is faster than a write loop.

The signature mirrors `flash_fill()` so the syscall implementation can
forward arguments verbatim. Alignment expectations match `api->write`
(write_block_size aligned offset/size); callers of `flash_fill()`
already satisfy this.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2026-06-09 13:42:41 +02:00
saeed molaie
fd7b6c2c3d drivers: flash: stm32u3: add Option Bytes read/write support
Add support for reading and writing Option Bytes (OB) on STM32U3
series devices. This enables runtime configuration of OB fields
using the STM32 flash driver.

Signed-off-by: saeed molaie <saeed.molaie@st.com>
2026-06-09 13:42:31 +02:00
Etienne Carriere
22396e4391 drivers: i2c: stm32: fix minor coding style issues
Fix and add inline comment related to #ifdef/#else/#endif directives.
Add and remove some empty lines or space chars where applicable.
Fix some indentation issues.
Remove spurious, yet harmless, heading semi-column in I2C_LOOP_SCLH()
and I2C_LOOP_SDADEL() macros definition.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-09 11:57:03 +02:00
Chaitanya Tata
8c2a903829 drivers: spi: nrfx_spim: chunk transfers exceeding EasyDMA MAXCNT
The reworked SPIM driver passes the whole continuous chunk returned by
spi_context_max_continuous_chunk() straight to the common transfer
layer, which rejects anything larger than the controller MAXCNT with
-EINVAL. On SoCs with a small EasyDMA MAXCNT (e.g. nRF91 SPIM with 13
bits, max 8191 bytes) a transfer of 8192 bytes or more fails outright.

The old monolithic driver used to cap the chunk to the MAXCNT limit and
let the event handler walk the rest of the buffer. That behaviour was
lost in the rework, so any caller pushing a buffer larger than MAXCNT
now breaks. One example is the nRF70 firmware patch download, which
copies the patch in 8192 byte chunks and ends up corrupting RPU memory,
leading to a boot signature mismatch.

Restore the cap in transfer_start() so an oversized chunk is split
across multiple EasyDMA transfers, with the remainder handled by the
next call from the event handler once the current chunk completes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Opus4.8
2026-06-09 11:56:44 +02:00
Ashley Brighthope
56f2ee7453 led: shell: use correct length sub-specifier
use correct length sub-specifier when
printing a size_t.

Signed-off-by: Ashley Brighthope <ashley.b@reddegrees.com>
2026-06-09 11:56:11 +02:00
Lucien Zhao
0b8babdcc3 drivers: sdhc: imx_usdhc: add cache maintenance on DMA path
When CONFIG_IMX_USDHC_DMA_SUPPORT is enabled, the USDHC ADMA2
engine DMAs to/from the data buffer supplied by upper layers
(e.g. FAT FS, SD subsystem) which lives in regular cacheable
RAM. Without explicit cache maintenance, on writes the
controller may DMA-read stale RAM while CPU writes are still
in D-cache, and on reads the CPU may consume stale cache lines
after the controller has DMA-written fresh data.

Flush the data buffer before each transfer (correct for TX,
and prevents later dirty-line eviction over DMA-written data
on RX) and invalidate after RX completes. Both scatter-gather
and non-scatter-gather paths are handled.

Raise SDHC_BUFFER_ALIGNMENT to DCACHE_LINE_SIZE when D-cache is
enabled so that DMA buffers (both upper-layer pass-through and
the SD subsystem fallback card_buffer) are cache-line aligned.
Without this, sys_cache_data_invd_range may operate on partial
cache lines and silently discard dirty data of adjacent
allocations sharing the head/tail line.

Fixes #107862

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2026-06-09 11:55:27 +02:00
Ching Ping Sun
ea1954e81f driver: ethernet: DM9051 process return value of SPI calls
Previously, not all of the SPI return values are verified.
Here we add checks after calling the SPI functions.

Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
2026-06-09 10:34:35 +02:00
Brian Cain
8352b398bd drivers: serial: fix spinlock leak in uart_renesas_rza2m_scif
Add missing k_spin_unlock() on two error return paths in
uart_rza2m_scif_configure():

- Unsupported parity mode (default switch case)
- Baudrate configuration failure

Both paths returned without releasing the spinlock acquired earlier.

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-06-09 10:32:08 +02:00
Fabin V Martin
24631a52e7 drivers: clock_control: samd5xe5x: fix clock reinit after MCUboot
Remove GCLK software reset and add clock_init_reset_state() to
ensure stable clock state during reinitialization. This prevents
system hang when application reinitializes clocks after MCUboot.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2026-06-09 10:31:10 +02: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
Fin Maaß
d7eb125f21 dsa: change the type of port_phylink_change argument
the ``void *user_data`` in port_phylink_change contains the
dsa port device. make this more explicit, so that we no longer
need to cast this.

This is now possible as this function
is no longer directly passed to phy_link_callback_set.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-09 10:29:44 +02:00