Commit graph zephyr/drivers
Author SHA1 Message Date
Carlo Caione
bc4c19eace drivers: lora: native: sx126x: fix swapped RX timeout sentinels
Per the SX1261/2 datasheet (13.1.12) 0x000000 selects Rx Single mode
and 0xFFFFFF Rx Continuous mode; the two defines had their values
swapped.

No functional change: SX126X_RX_TIMEOUT_SINGLE (0xFFFFFF) was never
referenced, and the continuous receive paths (lora_recv_async, and
lora_recv with K_FOREVER) re-arm RX after every packet in
sx126x_rx_restart(), so they kept receiving even with the chip wrongly
in single mode. The blocking recv path needs only one packet and
sleeps the radio in the RxDone handler regardless. After the swap
those paths use true Rx Continuous mode, with identical observable
behavior.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-06-04 09:07:51 +02:00
Ching Ping Sun
211eace013 drivers: ethernet: dm9051: fix GPR read returns undefined
GPR bit 0 is Write-Only (WO per DM9051A spec), reading returns
undefined values (default XXh). The previous code read GPR and only
powered on the PHY if bit 0 was set to 1. If the read returned 0x00
(random undefined value), the PHY would never be powered on.

Fix by unconditionally writing GPR = 0x00 to power up the PHY,
ensuring it is always enabled regardless of any prior state.

Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
2026-06-04 08:42:38 +02:00
Johan Hedberg
7570b51948 drivers: bluetooth: Document the placement requirement for common data
Add code comments to make sure the common data/config fields stay in the
correct place in the driver-specific struct if those structs ever get
modified.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-04 08:40:14 +02:00
Johan Hedberg
2f3cd95376 drivers: bluetooth: Remove unnecessary driver data structs
There's no point in having driver specific data structs if the only thing
they contain is the common data struct. Just declare the common data struct
directly as dev->data.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-04 08:40:14 +02:00
Johan Hedberg
7f3c897f96 drivers: bluetooth: Handle recv() callback in common layer
Now that we have a common data struct, we can take advantage of it and
move the recv callback into it. This way the common layer takes care of
assigning, dispatching and clearing the callback. Drivers now have to use
the new bt_hci_recv() API to pass data to the layer above them (typically
a host stack). Additionally, the drivers no longer get a recv parameter as
part of their open() callback, since that's all handled by the common
layer.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-04 08:40:14 +02:00
Johan Hedberg
c5420dc137 drivers: bluetooth: Add support for mandatory data/config fields
Add support for the new common data & config fields for all in-tree
drivers.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-04 08:40:14 +02:00
Fin Maaß
3701def369 drivers: fix add_subdirectory for timeaware_gpio
The move of the timeaware_gpio in
d5178bbc46 (#105664)
forgot to change the CMakeLists.txt.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-03 18:28:59 -04:00
Tyler Baker
0d37fbfab8 drivers: display: add charlieplex LED matrix driver
Add a display driver for monochrome and grayscale LED matrices driven by
charlieplexed GPIOs. With N GPIO lines such a matrix can drive up to
N*(N-1) LEDs: each pixel sits between an ordered pair of lines and is lit
by driving one line high and one low while every other line is held at
high impedance. Only one LED is lit at a time; a timer scans the pixels
fast enough for persistence of vision.

The driver implements the display API. It keeps a per-pixel framebuffer
and uses a counter device as the scan time source, lighting the next
pixel on each top-value callback. Grayscale is produced by duty
modulation over a configurable number of sub-frames. To stay portable
across SoCs it drives the matrix purely through the generic GPIO API,
configuring the inactive lines as disconnected to obtain the required
high-impedance state rather than touching the GPIO registers directly.

The GPIO bank, the per-pixel high/low pin-pair map, the scan timer,
refresh rate and grayscale depth are all described in devicetree through
the new charlieplex-led-matrix binding.

Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
Assisted-by: Claude Code:claude-opus-4.8
2026-06-03 18:28:33 -04:00
Etienne Carriere
b486d3a7e1 dts: bindings: reset: use min/max properties in reset-mmio
Use min/max DT properties for reset num-resets 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
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
Sylvio Alves
32f9a7c15d drivers: i2s: esp32: harden dma isr handling
Place the I2S DMA callbacks and transfer helpers in IRAM and
mask the interrupt status to the relevant TX/RX events, returning
early on spurious interrupts to keep the ISR path coherent.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
43c34e91b4 drivers: watchdog: esp32: skip rtc_cntl include on esp32p4
ESP32-P4 does not provide soc/rtc_cntl_reg.h. Skip including
it on P4 along with the existing skip for C5/C6/H2.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
5e5d574dfa drivers: spi: esp32: add axi gdma slot and cache maintenance
On SoCs with AXI GDMA, derive the DMA slot from the trigger
peripheral ID base. Flush the tx buffer and invalidate the rx
buffer around the transfer so CPU and DMA see coherent data.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
4867488361 drivers: serial: esp32: flush dma buffers in async path
Flush tx and invalidate rx DMA buffers around UART async DMA
transfers so the CPU and DMA engine see coherent data on SoCs
with an L1 data cache.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
2f7ab3fd4e drivers: sdhc: esp32: add esp32p4 support
Wire ESP32-P4 specific IOMUX paths and status register layout,
use the combined raw interrupt status field, and align the DMA
descriptors to the cache line for coherent flush and invalidate.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
36e515fd43 drivers: hwinfo: esp32: read mac on esp32p4
Use the same EFUSE MAC register pair for ESP32-P4 as for
ESP32-H2.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
edce3f7360 drivers: entropy: esp32: tune apb wait for esp32p4
Scale the RNG APB-cycle wait based on the CPU frequency on
ESP32-P4. The RNG has been characterised at around 75 kHz
on P4 ECO5+ silicon.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
1a515ab9e3 drivers: counter: esp32: enable counter clock source
Explicitly enable the timer clock source via esp_clk_tree
before programming the counter. Required on P4 where the
source clock is gated by default.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
14ab49c815 drivers: adc: esp32: flush dma buffer cache after dma read
Invalidate the DMA buffer after a DMA transfer so the CPU
reads the freshly captured samples instead of stale cache
lines.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
40e13d301b drivers: timer: esp32: enable systimer on esp32p4
Add SOC_SERIES_ESP32P4 to the dependency list of the Espressif
systimer driver so it is selected by default and provides the
sys_clock_elapsed implementation the kernel needs.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
8317efa25c drivers: serial: esp32: add esp32p4 uart support
Add ESP32-P4 to the Espressif UART driver and the USB-serial-JTAG
backend, including the SoC-specific clock source selection
for the P4 UART HAL.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
f101f519c6 drivers: gpio: esp32: add esp32p4 support
Select the gpio1 register field layout used by C5/C6/H2 on P4 and
switch the device definition to DEVICE_DT_INST_DEFINE.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
4a8c03b5ea drivers: interrupt_controller: esp32: track interrupt level
Store the allocated interrupt level in the vector descriptor and
match it on reuse for flexible-INTC SoCs, widen the source field
and allow IRAM handlers placed in ROM.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
64a99f2416 drivers: pinctrl: esp32: add esp32p4 support
Select the gpio1 register field layout used by C5/C6/H2 on P4 and
fold the initial pin-level set into a single gpio0/gpio1 path.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Sylvio Alves
1d5d7ddae7 drivers: clock_control: esp32: add esp32p4 support
Wire ESP32-P4 into the Espressif clock_control driver: PLL (CPLL)
and XTAL CPU clock selection, RTC slow/fast clock setup and the
regi2c DBIAS handoff to PMU.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-03 18:27:15 -04:00
Karl Palsson
2905c7e489 drivers/eeprom_shell: provider better parse errors
Port the eeprom shell to use shell_strtoul helper, instead of open code.

Previously, we warned for arguments that parsed as integers, but were
out of range.  Parse failures, such as below, would simply write 0 for
the failing bytes.

eeprom write <dev> <offset> 05 06 07 08
or
eeprom write <dev> <offset> fa ce be ef

While this change doesn't make the read format viable to feed back to
what write expects, it will at least warn now that it has failed to
parse, instead of silently proceeding with 0 bytes substituted.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
2026-06-03 18:27:01 -04:00
Liam Ogletree
b98d17b0ee drivers: haptics: Update haptics shell to expose new API features
Updates haptics shell to provide support for:
 - calibration
 - output level control
 - selecting playback sources
 - integrated sensor readings
 - streaming samples to the device

Notably, DAI configuration from the shell is not supported.

Additionally, the shell supports driver-specific monitors and
sources using integers.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2026-06-03 18:26:49 -04:00
Liam Ogletree
5718807766 drivers: haptics: Update haptic drivers to provide mandatory API callback
The newly introduced haptics_select_source() is a mandatory API feature, so
update existing haptic drivers to implement a placeholder. Subsequent PRs
can implement this function at a later point.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2026-06-03 18:26:49 -04:00
Liam Ogletree
b9c2675717 drivers: haptics: Add common features to haptics subsystem API
Extends the existing haptics subsystem API to provide generic support for:
 - playback source selection
 - integrated sensor readings
 - output level control
 - calibration
 - streaming effects over a control port

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2026-06-03 18:26:49 -04:00
Madhab Sharma
b333d1f4cc drivers: wifi: esp32: Prevent power save in AP mode
Currently, there was no check in place if set_power_save()
was called in AP mode which might result in undefined
behavior.

Additionally, esp_wifi_get_config() doesn't return an
error when querying for STA config in AP mode.

Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
2026-06-03 18:44:19 +02:00
Erwan SZYMANSKI
94c57ba192 drivers: ethernet: phy: lan8742: handle EALREADY properly
As it is done in phy_mii.c, set autoneg_in_progress
for already on init.

Signed-off-by: Erwan SZYMANSKI <erwan.szymanski@st.com>
2026-06-03 18:43:04 +02:00
Karl Palsson
f05380de76 drivers/eeprom_fm25xx: Show correct op lengths in debug
The debug prints were showing the maximal length of operations, instead
of the operation length actually used.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
2026-06-03 18:38:45 +02:00
Qiang Zhang
05aa0414f2 drivers: dma: mcux_edma: handle m2m on V4 instances without channel mux
Factor the m2m software-trigger check into a helper using
FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(base) for per-instance
detection, and gate all four m2m-software-only branches (SG -ENOTSUP,
burst-length override, manual start trigger, suspend -ENOSYS) on the
new dma_mcux_edma_m2m_software_only().

Fixes parallel display output on MCXN947 (FlexIO-triggered m2m
channels were treated as software-only and lost their per-minor-loop
pacing).

Fixes: efe48ea674
Fixes: #108367
Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2026-06-03 18:38:23 +02:00
Tejus Subramanya
0ade2640ca drivers: wifi: siwx91x: fix listen-interval and DTIM wake cadence
The NWP ignored the host programmed listen_interval and fell back to
its ~1s default, so both WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL and
WIFI_PS_WAKEUP_MODE_DTIM woke the device roughly once per second
regardless of the AP's DTIM period or the host-requested LI.

Set SL_WIFI_JOIN_FEAT_PS_CMD_LISTEN_INTERVAL_VALID in
siwx91x_iface_init() so the NWP honors the listen_interval supplied
via the host-side power-save command path (i.e. the value programmed
through sl_wifi_set_performance_profile_v2()) instead of substituting
its built-in default.

Signed-off-by: Tejus Subramanya <ters@silabs.com>
2026-06-03 18:38:18 +02:00
Alexpandi Muniyandi
976e3691ab drivers: audio: Add audio codec support for tlv320aic26
Add minimal playback functionality for tlv320aic26 audio codec
module with SPI control interface

Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
2026-06-03 18:37:09 +02:00
Anand Kumar
4b53bb05fd drivers: entropy: stm32: rng: handle missing RNG clock source gracefully
Fixes zephyrproject-rtos#106241

When the RNG peripheral is enabled in the device tree but its kernel
clock source is not configured (e.g. HSI48 missing on STM32H7), the
driver currently hangs indefinitely inside generate_from_isr() with
interrupts locked, because RNG_SR.DRDY never asserts. This makes the
system completely unresponsive and very difficult to debug.

Three changes are made to address this:

1. Replace __ASSERT_NO_MSG(res == 0) after clock_control_on() with a
   proper error check that returns the error code and logs a message.

2. Replace __ASSERT(res == 0) after clock_control_configure() with
   the same pattern, returning the error code with a LOG_ERR.

3. Add a runtime clock source check that verifies the domain clock is
   present in the DTS and running at a non-zero rate using
   clock_control_get_rate(), following the same pattern as
   sdmmc_stm32.c. Returns an error instead of hanging indefinitely.

4. Add LOG_MODULE_REGISTER so LOG_ERR messages are routed through
   the standard Zephyr logging subsystem.

Based on approach suggested in zephyrproject-rtos#106241 by @FRASTM.

Signed-off-by: Anand Kumar <anandvtu16158@gmail.com>
2026-06-03 18:36:50 +02:00
Fin Maaß
ad056d5454 wifi: don't select WIFI_OFFLOAD wrongly
don't select WIFI_OFFLOAD, when it is a native driver without offloading.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-03 08:12:39 -05:00
Flavio Ceolin
ab35eaccec mbox: userspace: fix TOCTOU race in z_vrfy_mbox_send
The syscall verifier validated msg->data directly from live userspace
memory and then forwarded the original mutable userspace struct pointer
to z_impl_mbox_send(). A concurrent thread could race msg->data to a
supervisor address after the access check.

Fix this by copying struct mbox_msg into a kernel-stack variable.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-06-03 08:09:59 -05:00
Flavio Ceolin
d858a79329 mbox: userspace: Fix z_vrfy_mbox_send
handle msg == NULL explicitly since it is valid according with
the API documentation.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-06-03 08:09:59 -05:00
Christopher Besch
d2fb3a98ab doc: watchdog: add STM32 IWDG specific note for WDT_OPT_PAUSE_IN_SLEEP
I was working with an STM32WB55RG that had the IWDG_STOP bit
unset by a previous developer. It took me hours to figure
out why WDT_OPT_PAUSE_IN_SLEEP didn't do what it's supposed to.
I hope this note helps the next one coming around to this issue.

I also wrote an article about this:
https://chris-besch.com/articles/soc_option_bytes

Signed-off-by: Christopher Besch <mail@chris-besch.com>
2026-06-03 08:09:00 -05:00
Jérôme Pouiller
4552041cb1 drivers: dma: siwx91x: udma: Add design documentation
Add a bit of history about the driver (the information I would like to
forward to my future me). Try to explain why this driver has this design.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
e0cd7263fa drivers: dma: siwx91x: udma: Simplify siwx91x_udma_reload()
By replacing "udma_table = cfg->chan_desc" by "chan_desc =
&cfg->chan_desc[channel]", we can simply many statements. So, all the
statements now fits on one line.

desc_src_addr and desc_dst_addr are in fact useless.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
bcbd445843 drivers: dma: siwx91x: udma: Reject SG transfers in siwx91x_udma_reload()
Scatter Gather transfers are not supported by siwx91x_udma_reload(). Detect
and reject them.

Also check the size of valid regarding the operation width.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
33cb6c4041 drivers: dma: siwx91x: udma: Fix long line
Compliance check complains about long lines.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
961e4f563b drivers: dma: siwx91x: udma: Fix internal variables names
Some fields names contained irrelevant information (eg. "addr" in
"sg_desc_addr_info" and in "sram_desc_addr", "dma" in "dma_desc_pool").

In other case, it lacked of consistency, (eg. "chan" vs "channel",
"config_zephyr" vs "dma_config" vs "config").

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
77043c2ce6 drivers: dma: siwx91x: udma: Fix symbols prefix
We try to prefix all the symbols in a file with the same prefix (so the
developer easily understand if a symbols is provided by Zephyr, the HAL or
is internal to the driver).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
f51b9f367a drivers: dma: siwx91x: udma: De-duplicate sanity checks
Sanity checks were duplicated in siwx91x_udma_config_sg() and
siwx91x_udma_config_single(). Move them in the caller function.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
c618108a95 drivers: dma: siwx91x: udma: Work with native data
The UDMA drivers includes some functions to translate Zephyr values in
hardware values. However, these conversion are either trivial or not very
consistent. It is more readable to directly work with the native (Zephyr)
values. We just have to check the values requested by the caller are valid
before the processing.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
08e6898e25 drivers: dma: siwx91x: udma: Change stored direction format
Rather than using internal enum type to store the direction, store the
native (Zephyr) value. It will help to simplify the code in the next
changes.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00
Jérôme Pouiller
f1600412b0 drivers: dma: siwx91x: gpdma: Fix symbols prefix
We try to prefix all the symbols in a file with the same prefix (so the
developer easily understand if a symbols is provided by Zephyr, the HAL or
is internal to the driver).

A few symbols in dma_silabs_siwx91x_gpdma.c did not follow this rule.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-06-03 13:05:03 +02:00