Commit graph zephyr/drivers
Author SHA1 Message Date
Tim Pambor
38fa58c8ce drivers: ethernet: dwc_mac: stm32: fix DMA bus mode for STM32MP13
STM32MP13 uses a 32-bit AXI4 DMA bus master interface, not the 32-bit
AHB interface used by the other series with a 32-bit data bus. Reusing
the AHB DMA_SYSBUS_MODE value on STM32MP13 left the AXI4-only bits
(burst length and outstanding request limits) unset.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-21 16:27:37 -04:00
Alain Volmat
6e152a792a display: stm32-ltdc: correct ext-sdram section handling
Use LINKER_DT_NODE_REGION_NAME_TOKEN instead of LINKER_DT_NODE_REGION_NAME
for getting the section name in order to avoid doing twice stringify
on the section name. Indeed, LINKER_DT_NODE_REGION_NAME already
stringify the name, which is again stringify a 2nd time by
Z_GENERIC_SECTION, leading to section name such as "PSRAM" instead of
PSRAM.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-09-21 16:27:32 -04:00
Johannes Schuler
48b86a8c4f drivers: fuel_gauge: add fuel_gauge_set_buffer_prop
Add a set_buffer_property driver callback and the matching
fuel_gauge_set_buffer_prop() syscall so applications can write variable
length buffer properties, such as configuration images or manufacturer
defined data blocks, to a fuel gauge device. This mirrors the existing
fuel_gauge_get_buffer_prop() API.

The source is documented as an opaque, pointer-free byte buffer because
the syscall verifier can only validate the src/src_len range itself.

The callback is optional. The verifier checks the device object and the
source buffer only and leaves the callback check to
z_impl_fuel_gauge_set_buffer_prop(), so user mode callers get -ENOSYS
instead of a kernel oops when a driver does not implement it.

Signed-off-by: Johannes Schuler <jschuler@testo.de>
Assisted-by: Claude:claude-fable-5-1
2026-09-21 16:27:06 -04:00
Anders Frandsen
e6b90da24a drivers: rtc: stm32: add support for STM32WL3x
Apply the same settling delay used on STM32WB0.

Clear BYPSHAD and wait for RSF before entering initialization mode,
to avoid the silicon errata ES0612 Rev 8 2.9.2:
"Calendar initialization may fail in case of consecutive INIT mode entry"

Without this, rtc_set_time() returns -ETIMEDOUT after any operation
that has written an RTC register, as INITF fails to assert within
RTC_TIMEOUT. The first synchronization after reset takes 35 to 40 ms
on the NUCLEO-WL33CC1, which the settling delay alone does not cover.

The series has no EXTI. External interrupts are handled by SYSCFG,
and RTC interrupts are directly connected to the NVIC,
so the EXTI calls in exti_enable_rtc_alarm_it() and
exti_clear_rtc_alarm_flag() are skipped.

Signed-off-by: Anders Frandsen <anfran@anfran.dk>
2026-09-21 16:26:36 -04:00
Anders Frandsen
b41993f2d2 drivers: dma: stm32: add support for STM32WL3x
Add support for STM32WL3x in STM32 DMA driver,
and enable shared IRQ for the series.

Signed-off-by: Anders Frandsen <anfran@anfran.dk>
2026-09-21 16:26:36 -04:00
Anders Frandsen
cc21c40e3b drivers: i2c: stm32: add support for STM32WL3x
Add support for STM32WL3X in STM32 I2C driver.

Signed-off-by: Anders Frandsen <anfran@anfran.dk>
2026-09-21 16:26:36 -04:00
Anders Frandsen
393c1bab85 drivers: i2c: stm32: guard wakeup from stop on register availability
I2C_CR1_WUPEN is per device, not per series. STM32F030, F070, WB0 and
WL3 do not have it, so registering an I2C target failed to build there
with a declaration of LL_I2C_EnableWakeUpFromStop().

Use the same guard as the LL HAL (stm32f0xx_ll_i2c.h) instead of a
check for STM32F7.

Validated on STM32F0, F7, G0, WB0, WL and WL3 (Twister, no HW).

Signed-off-by: Anders Frandsen <anfran@anfran.dk>
2026-09-21 16:26:36 -04:00
Johan Hedberg
19c58a5a3b Bluetooth: ipm_stm32wb: Fail setup when the address write fails
bt_ipm_ble_init() logs an error when bt_ipm_set_addr() fails and
carries on regardless, so a controller that rejects
ACI_HAL_WRITE_CONFIG_DATA comes up with a silently different identity
address. Return the error instead, so that bt_enable() fails and the
caller learns that the controller is in an unexpected state.

The UID64 is factory programmed on every part, so bt_get_ble_addr()
returning NULL is not an expected case either and fails setup the same
way.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-09-21 16:26:18 -04:00
Michele Sardo
72687a911a Bluetooth: HCI: stm32wba: fixes in send API
- preserve buffer ownership on error paths, consistent with API
  expectations [See also bt_hci_send documentation], preventing
  double unref.
- fix the data length check as the pre-allocated event buffer
  already carried the H:4 indicator, so its tailroom was one byte
  short of the 71-byte Read Local Supported Commands response, and
  smaller responses only passed because net_buf_reset() discarded
  that byte before the copy.
- Factorize common code to improve maintainability, keeping flow
  control only in the indication

Signed-off-by: Michele Sardo <msmttchr@gmail.com>
2026-09-21 16:26:13 -04:00
Tony Han
c49e4b45b6 drivers: rtc: rtc_mchp_g2: fix ACKUPD polling timeout in set_time
The WAIT_FOR timeout for RTC_SR_ACKUPD_Msk was set to 5000 us (5 ms),
which is far too short. The RTC acknowledges an update request at the
next second boundary after RTC_CR_UPDTIM/UPDCAL are written, so the
wait can be up to ~1 second. This caused rtc_mchp_set_time() to always
time out on sama5d2.

Increase the timeout to 1,100,000 us (1100 ms) to allow a full second
boundary to elapse with margin.

Fixes: 7cff6281d7 ("drivers: rtc: microchip: introduce G2 rtc driver")

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-09-21 16:26:08 -04:00
Tony Han
da7d7fb6b7 drivers: rtc: rtc_mchp_g2: fix wrong mask for SEC event in ISR
In rtc_mchp_isr(), the second-tick event was tested using
RTC_SR_SEC_Msk against sr, which is mis-wrote to RTC_SCCR_SECCLR_Msk.

There is no runtime impact because the values for RTC_SCCR_SECCLR_Msk
and RTC_SR_SEC_Msk are the same.

Fixes: 7cff6281d7 ("drivers: rtc: microchip: introduce G2 rtc driver")

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-09-21 16:26:08 -04:00
Tony Han
35f6cdf8c6 drivers: rtc: rtc_mchp_g2: update the driver for sama5d2 support
Update the driver for sama5d2 due to there's no 'WPITEN' field in
register 'SYSCWP_SYSC_WPMR'.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-09-21 16:26:08 -04:00
Tony Han
0d40c9a290 drivers: can: sam: correct the instance value for SFR_CAN_SRAM_SEL bit
The SFR_CAN_SRAM_SEL register has one bit per hardware MCAN peripheral.
The driver was indexing that register with the DT enumeration index
(assigned by DT_INST_FOREACH_STATUS_OKAY) instead of the index by MCAN
hardware peripheral number. When the two values are not the same, the
wrong bits are set, causing the hardware to read CAN configuration from
the wrong 64 kB SRAM bank.

Fixes: bd15f36928 ("drivers: can: sam: update the can_sam driver for
sama7g5 MCAN")

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-09-21 16:25:53 -04:00
Daniel DeGrasse
2c7ad4f8da drivers: flash: add semihosted flash driver
Add a semihosted flash driver, which utilizes the semihosting interface
to write to a flash file on the host. The flash file will be created if
it does not exist, but otherwise an existing flash file is used. This
driver can therefore be used for testing flash in cases where the
contents need to be set before application startup (such as mcuboot)

Assisted-by: Claude:claude-haiku-4-5
Signed-off-by: Daniel DeGrasse <daniel.degrasse@analog.com>
2026-09-21 16:25:19 -04:00
Aksel Skauge Mellbye
a4e2ff6278 drivers: hwinfo: silabs: Add Series 3 hwinfo driver
Add hwinfo driver for Silicon Labs Series 3 devices.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-09-21 11:26:56 +01:00
Aksel Skauge Mellbye
85505b39a2 drivers: watchdog: silabs: Add Series 3 watchdog driver
Add driver for Silicon Labs Series 3 WDOG peripheral. The
driver supports window min/max as well as a warning interrupt
(multistage).

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-09-21 11:26:42 +01:00
Ryomei Osaki
68795ea4fd drivers: spi: spi_mcux_ecspi: abort transfer on completion timeout
When spi_context_wait_for_completion() times out, the SDK transfer
handle is left busy and every later transfer on the bus fails with
kStatus_ECSPI_Busy until reboot.

Abort the transfer and deassert the chip select on error so the bus
recovers, as spi_nrfx_spim already does on -ETIMEDOUT.

ECSPI_MasterTransferHandleIRQ() does not check the handle state, so a
completion interrupt latched just before the abort would still run the
callback, start the next word and signal the context again. Disarm the
callback with a flag before aborting, with interrupts locked so the ISR
cannot interleave with the abort, and clear the completion signal
(ctx.sync, or ctx.ready without CONFIG_MULTITHREADING) to drop a
completion that raced in before the flag was set.

Signed-off-by: Ryomei Osaki <o.ryomei1020@gmail.com>
2026-09-21 11:26:40 +01:00
Aksel Skauge Mellbye
96491da790 drivers: flash: silabs: Add Series 3 EXTMEM flash driver
Add driver for Silicon Labs Series 3 EXTMEM flash controlled by
the SE. The initial version of the driver supports reading from
and getting the layout of the entire flash, but only writing
and erasing data regions.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-09-21 11:26:13 +01:00
Yves Wang
ba575ee9ea drivers: watchdog: nxp_ewm: enable the peripheral clock
On MCXW SoCs the EWM is clock gated. Until the MCXW clock control driver
was introduced, soc.c opened the gate unconditionally.

PR #101937 removed that hardcoded initialization and described the
gate in dts instead, but wdt_nxp_ewm never consumed the new "clocks"
property. The gate is left closed and the first register write in
nxp_ewm_init() takes a precise bus error.

Enable the clock during init for instances that describe one. SoCs that
do not gate the EWM have no "clocks" property and keep the previous
behaviour.

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2026-09-21 11:26:10 +01:00
Holt Sun
6daa713661 counter: mcux_qtmr: report chan_id 0 in the alarm callback
The QTMR driver exposes every hardware channel of a TMR block as an
independent counter device with .channels = 1, so chan_id 0 is the only
alarm channel it accepts: counter_set_channel_alarm() and
counter_cancel_channel_alarm() reject anything else with -EINVAL, and the
counter API rejects it even earlier with -ENOTSUP.

The ISR, however, handed the callback config->channel, i.e. the hardware
channel index from the devicetree. On a device instantiated from
qtmr1_timer1 the alarm callback was therefore told chan_id 1, and an
application that fed that value straight back into
counter_cancel_channel_alarm() got -ENOTSUP.

Report 0 instead, which is what the capture path already does.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-09-21 11:25:31 +01:00
Mathieu Choplain
e9e4dd51ff west.yml: update hal_stm32 module + associated changes
Update the STM32 HAL module to new revision with updated STM32Cube
package for various series and update the RTC driver accordingly:
some function that was named differently in STM32CubeU3 vs. all other
series has been realigned to the usual name so an #if SERIES check in
that driver can - in fact, must - be dropped.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-21 11:22:32 +01:00
Mathieu Choplain
9aa4078c4f drivers: udc: stm32: handle HAL2 compatibility more cleanly
The HAL2 glue currently works on STM32C5 series but is incomplete.
It will also break upon updating to STM32CubeC5 v2.1.0 because the API
changed a bit (bringing it closer to what existed in HAL1, really).

Plug the holes by implementing missing glue pieces, and removing any use
of the raw HAL1/HAL2 macros, except in udc_stm32_device_speed() for the
sake of simplicity. This ensures the glue works with STM32CubeC5 v2.1.0
and should ensure a series with OTG_HS Just Works, although this latter
claim has not been verified due to no such hardware being available.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-21 11:22:32 +01:00
Jay Roy
fcafe696c1 drivers: serial: stm32: lock IRQs when setting interrupt callback
Protect the assignment of user_cb and user_data in
uart_stm32_irq_callback_set() using irq_lock() and irq_unlock() to
prevent a race condition where an incoming UART interrupt executes the
new callback with stale user_data.

Fixes #118457

Signed-off-by: Jay Roy <jayroy0304@gmail.com>
2026-09-21 11:21:53 +01:00
Stefan Schmidt
5ec7f88c8a drivers: clock_control: add support for the TI cdce9xx clock generator
Move device specific clock control shell to a common clock control shell
Fix bug in device initialization, add example configuration in yaml

Signed-off-by: Stefan Schmidt <kontakt@stefanschmidt-embedded.de>
2026-09-21 11:21:23 +01:00
Stefan Schmidt
41c6ae2e52 drivers: clock_control: add support for the TI cdce9xx clock generator
Potential fix for pull request finding (second copilot run)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Signed-off-by: Stefan Schmidt <kontakt@stefanschmidt-embedded.de>
2026-09-21 11:21:23 +01:00
Stefan Schmidt
db30cda5a7 drivers: clock_control: add support for the TI cdce9xx clock generator
Potential fix for pull request finding (second copilot run)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Signed-off-by: Stefan Schmidt <kontakt@stefanschmidt-embedded.de>
2026-09-21 11:21:23 +01:00
Stefan Schmidt
80852218e5 drivers: clock_control: add support for the TI cdce9xx clock generator
Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Signed-off-by: Stefan Schmidt <kontakt@stefanschmidt-embedded.de>
2026-09-21 11:21:23 +01:00
Stefan Schmidt
7e4b7d5538 drivers: clock_control: add support for the TI cdce9xx clock generator
The driver is based on the linux driver for the same family of devices.

It has the same limitations:
Y1 is always connected to the input clock,
Y2/Y3 is always connected to PLL1 (Y4/Y5-PLL2, Y6/Y7-PLL3, Y8/Y9-PLL4)

In addition it assigns ownership to the first output that requests a PLL.
The vco frequency calculation of the PLL prefers the owner, trying to
provide the best possible result for it. If a second output frequency is
requested a vco frequency based on the least common multiple is calculated
and used, if the "perfect" result for the owner can be achieved. If not,
the second output can only use its divider to get the best possible
approximation of its requested rate. Ownership is transferred if the
current owner request a output rate of 0.

The output frequencies can be configured via device tree and changed
during runtime.

A sample has been added to control the driver via a shell.

Assisted-by: Claude:claude-sonnet-5 coccinelle
Signed-off-by: Stefan Schmidt <kontakt@stefanschmidt-embedded.de>
2026-09-21 11:21:23 +01:00
Sanjay Yadav
1bd1b6680f drivers: wifi: add u-blox and Quectel module for IW416 and IW61X
The IW416 and IW61X module choices only covered the AzureWave and
Murata modules, so the u-blox and Quectel modules had no way to
be selected from Zephyr.

Signed-off-by: Sanjay Yadav <sanjay.yadav@nxp.com>
2026-09-21 11:21:08 +01:00
Gaofeng Zhang
780cf8fae9 drivers: wifi: enable compressed TX power table for IW416 and IW612
NXP_WIFI_COMPRESS_TX_PWTBL was not selectable for IW416, so IW416 kept
using the legacy per-channel TRPC tx power tables. Add NXP_IW416 to the
if block and to its depends on, and give NXP_WIFI_CLOCKSYNC an explicit
depends on so it stays disabled for IW416.

Also drop the NXP_IW416_REGION and NXP_IW61X_REGION choices. The driver
now selects the region table at runtime from the country code, and one
WW header already carries the WW, JP, US, EU and CA tables, so the
per-region headers are redundant. The header is selected per chip in the
wifi_nxp CMakeLists instead, as RW610 already does.

Signed-off-by: Gaofeng Zhang <gaofeng.zhang@nxp.com>
2026-09-21 11:21:08 +01:00
Fabio Baltieri
071230a9be sensor: rts5912: make the sensor fetch synchronous by default
Add a locking to synchronize fetch with the actual sample fetching, on
by default as that's the API contract, but leave an option to turn it
off if needed, noting that that's not the normal API behavior.

Assisted-by: Gemini:gemini-3.1-pro
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-09-21 11:20:50 +01:00
Fabio Baltieri
74d395ce1d sensor: rts5912: fetch samples asyncronously
The current rts sample_fetch() implementation has a sleep loop up to
50ms to wait for the most recent sample, this can be problematic if the
function is called from a shared thread, for example from the sysworkq.
The advantage is it guarantees to get a recent sample, but in practice
that's rarely necessary for a fan control loop, and having the most
recent sample is probably good enough, and that's actually how other EC
tachometer drivers are implemented.

Rework the rts5912 tach driver to remove the sample_fetch() sleep
function, instead use the sample_fetch() function to start a sample
fetching asynchronously and let channel_get() return the most recent
available sample.

Note that the tachometer relies on the system clock, hence it returns
bogus values if the system happens to go into sleep during sampling.
Additionally it returns bogus samples on the first iteration after
waking up (presumably because it was already sampling from a partially
idle clock) and for the next sample as well (no idea why), so add the
necessary guards to keep the system awake during sampling, but also a
function to optionally discard the first two samples.

The discard option is off by default as in the normal use case of this
device the fan is only used while the application processor is on, and
in that condition the EC is normally stopped from entering suspend state
entirely, so it probably won't be needed, but there's no harm leaving
some code to handle that condition if it becomes necessary down the
road.

Note that there's quite few checks on the asynchronous functions to
avoid various potential race conditions between the interrupt and
overflow counter.

Also note, the tach seems to have a "limit" register and interrupt that
seemingly could work in place of timeout, but I wasn't able to make it
work correctly for some reasons.

Assisted-by: Gemini:gemini-3.1-pro
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-09-21 11:20:50 +01:00
Esben Dueholm Nørgaard
a45892b727 drivers: mfd: ad559x: wait for reset recovery after hardware reset
The AD559x needs up to 250 us to recover after a reset, per the
datasheet, before it will accept new data on the bus. The driver
previously issued the software reset immediately after de-asserting
reset-gpios, without waiting for this recovery time.

Add a reset-recovery-time-us devicetree property (default 250 us) and
busy-wait for it in mfd_ad559x_init(), after de-asserting reset-gpios
and before the software reset. The delay is only applied when
reset-gpios is present. Boards whose reset line needs extra settling
time can increase the property to match their hardware.

Tested on an STM32 Nucleo-H563ZI paired with a MikroElektronika ADAC
Click board (AD5593R). The click board's RESET pull-up was replaced
with a pull-down so RESET is guaranteed low until the MCU drives it
high, matching what the driver assumes.

A Saleae logic analyzer captured RESET and I2C activity at startup
to measure the delay between RESET going high and the first I2C
transaction. A test application swept reset-recovery-time-us across
several values: with the delay set to 0, the software reset write in
mfd_ad559x_init() failed and device_is_ready() returned false,
logging "AD559x device is not ready". With the datasheet's 250 us
default restored, init and the following I2C traffic succeeded
reliably. The reset-recovery delay is applied in mfd_ad559x_init()
before the bus-specific init, so this exercises the same code path
used by the SPI variant.

Signed-off-by: Esben Dueholm Nørgaard <esbendn@tutanota.com>
Assisted-by: Claude:claude-opus-4.8
2026-09-21 09:43:32 +02:00
Pieter De Gendt
1489951f0c drivers: ethernet: smsc911x: round up the TX staging buffer
smsc_write_tx_fifo() pads the last fragment up to a DWORD and copies
whole words out of the staging buffer, so a frame whose length is not a
multiple of four reads up to three bytes past the end of tx_buf. A
1514 byte frame, the largest one accepted, reads two bytes too far.

Size the buffer to the padded length instead.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-09-21 09:41:33 +02:00
Pieter De Gendt
84de8990c3 drivers: ethernet: smsc911x: reject frames larger than the TX buffer
eth_tx() read net_pkt_get_len(pkt) bytes into a fixed
NET_ETH_MAX_FRAME_SIZE staging buffer without checking the length.
net_pkt_read() takes no destination size, so a packet larger than the
buffer overwrites memory behind it. The interface MTU is not bounded by
what the link can transmit (an IPv6 RA MTU option raises it up to 0xffff),
which makes such packets reachable from the network.

Drop oversized frames before any TX_DATA_PORT write, so the TX FIFO is
not left holding a command word without its payload.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-09-21 09:41:33 +02:00
Priyanshu Singh
2ae6df52c0 drivers: memc: stm32: add data hold timing support for FMC NOR/PSRAM
On newer STM32 families (STM32U5, STM32H5, STM32N6, STM32MP1, STM32MP2,
STM32L5, STM32G4), the Flexible Memory Controller (FMC) features a
2-bit DATAHLD[1:0] field in FMC_BTRx and FMC_BWTRx registers to
configure data-hold cycles for asynchronous read and write accesses.

Currently, memc_stm32_nor_psram.c skips initializing .DataHoldTime in
both normal and extended timing configurations, forcing the field to
0 cycles and causing timing violations on external devices requiring
non-zero data hold duration (such as parallel display controllers).
Older FMC v1 controllers (STM32F4, STM32F7, STM32H7) lack DATAHLD
bits entirely and their HAL timing structs omit the DataHoldTime
member.

Add optional Devicetree properties st,data-hold-cycles and
st,data-hold-cycles-ext to st,stm32-fmc-nor-psram binding without a
YAML default to prevent generating existence flags on unsupported
targets.

In memc_stm32_nor_psram.c, conditionally populate DataHoldTime when
FMC_BTRx_DATAHLD_Pos or FMC_BTR1_DATAHLD_Pos is defined, and add
compile-time assertions to prevent misconfiguration on legacy SoCs.

Fixes #118296

Signed-off-by: Priyanshu Singh <singhpriyanshu9838@gmail.com>
2026-09-21 09:41:16 +02:00
Yurii Lozynskyi
a59a63b65c drivers: clock_control: infineon: Add PSOC4000T family support
Add the PSOC4000T-specific peripheral clock divider handling
needed for the new SoC series.

Signed-off-by: Yurii Lozynskyi <Yurii.Lozynskyi-EE@infineon.com>
2026-09-21 09:40:15 +02:00
Wai-Hong Tam
2ea7b9c4a1 Bluetooth: Kconfig: Only restrict system workqueue priority when needed
Enabling CONFIG_BT restricts SYSTEM_WORKQUEUE_PRIORITY to the
cooperative range for every build, but the requirement comes from the
individual components that submit work to the system workqueue, not
from Bluetooth being enabled.

An application that asks for a preemptible system workqueue therefore
cannot build with Bluetooth enabled at all, even when no Bluetooth
code uses that queue. Running the system workqueue below every other
thread is a common way to service a watchdog only while the whole
system is still making progress.

Add BT_SYSTEM_WORKQUEUE_COOP and apply the range only when it is set.
The components that need the system workqueue to stay cooperative
select the option themselves, so the requirement is recorded next to
the code that has it and a new work item cannot slip past it: the
host stack, the H:5 and STM32WB0 drivers, the NXP wake-on-BT LED
blink option, and BT_CTLR_PRIVACY when the split link layer builds
ull_filter.c.

Mesh, Audio and the other Host users need the Host, so they are
covered by its select; they get their own when the Host drops it.

No in-tree configuration changes behavior: SYSTEM_WORKQUEUE_PRIORITY
already defaults to -1, and no Bluetooth test or sample overrides it.

Signed-off-by: Wai-Hong Tam <waihong@google.com>
2026-09-20 19:06:12 +02:00
Benjamin Cabé
74fb04399c drivers: display: co5300: Send full init command parameters
The init sequence parser copied only the first parameter byte into
a local variable but passed the full parameter size to
mipi_dsi_dcs_write(), sending stack garbage for every multi-byte
command such as the column and page address setup. Pass the
parameter bytes straight from the command table.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-20 19:04:38 +02:00
Sylvio Alves
d396e53ca5 drivers: wifi: esp32: select the station power save mode
Add a Kconfig choice for the station power save mode applied
when the driver starts: minimum modem sleep, maximum modem
sleep or none. The default keeps the current behaviour, where
the Wi-Fi library starts in minimum modem sleep. The mode can
still be changed at runtime through the Wi-Fi power save
management request.

Assisted-by: Claude:fable-5.1
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-19 10:38:24 +02:00
Fabio Baltieri
538816fe34 input: gpio_kbd_matrix: fix undefined shift with 32 columns
When driving all columns (INPUT_KBD_MATRIX_COLUMN_DRIVE_ALL) or masking
direct port writes, gpio_kbd_matrix_drive_column() uses
BIT_MASK(common->col_size). Because col-gpios supports up to 32 pins,
col_size can be 32, which expands to (1UL << 32) - 1UL. On 32-bit
architectures where unsigned long is 32 bits wide, shifting by 32 is
undefined behavior and evaluates to 0 on x86, leaving all columns
undriven in idle mode.

Use BIT64_MASK(common->col_size) to safely compute the mask for up to
32 columns.

Assisted-by: Gemini:gemini-3.1-pro
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-09-19 10:37:02 +02:00
Fabio Baltieri
9d247f8bce input: kbd_matrix: fix debounce index overflow on large matrices
In input_kbd_matrix_update_state(), the linear key index cyc_idx into
the scan_cycle_idx array is stored in a uint8_t variable. When the
matrix has more than 256 keys (for example, 16 rows with 17 or more
columns when CONFIG_INPUT_KBD_MATRIX_16_BIT_ROW is enabled), cyc_idx
overflows and wraps modulo 256, corrupting per-key debounce tracking.

Change cyc_idx to uint16_t to support the full range of row_size *
col_size combinations.

Assisted-by: Gemini:gemini-3.1-pro
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-09-19 10:37:02 +02:00
Pieter De Gendt
4fc201611f drivers: flash: flash_mcux_flexspi_nor: derive erase geometry from SFDP
The SFDP configuration path programmed ERASE_SECTOR/ERASE_BLOCK with the
classic 0x20/0xD8 opcodes and strode range erases by an assumed 64 KiB
block size, regardless of what the flash declares. On parts whose block
erase is larger (e.g. the ISSI IS25WX01G declares 128 KiB for 0xD8),
each block-erase step wipes 64 KiB more than the loop accounts for,
erasing past the end of the requested range.

Select the erase opcodes from the BFP erase types (DW8-DW9) instead: the
type matching the driver's 4 KiB sector size for ERASE_SECTOR, and the
largest declared type for ERASE_BLOCK, with the block erase stride taken
from that type's actual size. Erase types beyond the advertised BFP
table length are skipped, as are types declaring a nonsensical size.
Vendor-specific and default LUT paths keep the 64 KiB assumption they
hard-code today.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-09-19 10:36:12 +02:00
Benjamin Cabé
50cd00a0e9 drivers: clock_control: nrf: fix calibration log module declare
nrf_clock_calibration.c declares the clock_control log module, which
only clock_control_nrf.c registers. With the split clock drivers
CONFIG_CLOCK_CONTROL_NRF_DRIVER_CALIBRATION is still set while that file
is not built, so under CONFIG_NO_OPTIMIZATIONS the module pointer
survives and the link fails on log_const_clock_control. Declare
clock_control_lfclk in that case, reusing the CONFIG_CLOCK_CONTROL_NRF
condition already used for the nrfx header.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-09-19 10:34:15 +02:00
John Goble
a13ff48eb4 drivers: serial: uart_rpi_pico_pio: use 64-bit pin masks
BIT() overflows for pins >= 32, so pio_sm_set_pins_with_mask() and
pio_sm_set_pindirs_with_mask() cannot express them. Use the 64-bit
variants, which are equivalent below GP32.

Assisted-by: Claude:claude-opus-5
Signed-off-by: John Goble <john.goble@nimbusdigital.com>
2026-09-19 10:32:28 +02:00
John Goble
dd04c41a09 drivers: misc: pio_rpi_pico: add gpio-base property
RP2350 PIO addresses a 32-pin window selected by GPIOBASE, which the
driver never writes, so PIO is limited to GP0-GP31. Add a gpio-base
property so a board can select the upper window and reach GP32-GP47 on
packages that have those pins.

GPIOBASE must be set before a program is loaded, so it is applied in
this driver's init.

Tested on an RP2350B with pio1 at gpio-base 16 driving a PIO UART on
GP37/GP39.

Assisted-by: Claude:claude-opus-5
Signed-off-by: John Goble <john.goble@nimbusdigital.com>
2026-09-19 10:32:28 +02:00
Jonas Berg
2e86988809 drivers: spi: stm32: Enable control of SPI pins when peripheral is idle
The SDO pin (previously known as MOSI) of the STM32 SPI controller is
floating when the SPI is idle. As we use a pull-up on that pin (it is
used as a multi-function pin), this causes an idle-high voltage
on the SDO pin. We use the SDO pin for control of WS2812 LEDs, and they
require an idle-low voltage.

Add a devicetree setting 'st,gpio-control' so the SPI controller keeps
control of the SDO pin also between transmissions.
This enables the AFCNTR bit in the STM32 SPI controller, via the
LL_SPI_EnableGPIOControl() HAL function.

The functionality is available for SPI in STM32H7, STM32H5, STM32C5
and some other series: all that rely on "st,stm32h7-spi"
DT compatible ID.

Tested on STM32H562.

Signed-off-by: Jonas Berg <jonas.berg@voiapp.io>
2026-09-19 10:29:58 +02:00
Bill Waters
08e757eb13 drivers: spi: spi_infineon_pdl: add device_deinit hook
Add an ifx_cat1_spi_deinit() implementation and register it via
SPI_DEVICE_DT_INST_DEINIT_DEFINE so device_deinit(dev) succeeds on the
Infineon PSE84 / CAT1 SCB SPI driver. Without this hook the upstream
tests/drivers/spi/spi_loopback test_spi_deinit case returns -ENOTSUP and
skips.

The deinit:
- returns -EBUSY while a transfer is still in flight, to avoid tearing
  down the SCB block in the middle of a transaction. The busy check is
  consolidated into ifx_cat1_spi_is_busy(), which reports busy while the
  SPI context still holds outstanding tx/rx buffers
  (spi_context_tx_on()/spi_context_rx_on()), while Cy_SCB_SPI_IsBusBusy()
  is active, or while an async transfer is still pending. The large-chunk
  DMA path drives the transfer purely through the DMA channels without
  setting data->pending, and Cy_SCB_SPI_IsBusBusy() can read idle between
  FIFO-paced DMA bursts, so the SPI context buffer state is used as the
  authoritative in-flight indicator that covers both the FIFO and DMA
  paths for synchronous and asynchronous transfers,
- unregisters the deep-sleep SysPm callback (only when CONFIG_PM=y),
- disables the SCB IRQ and the SCB SPI block (Cy_SCB_SPI_Disable),
- stops the rx and tx DMA channels via the shared ifx_cat1_spi_dma_stop()
  helper, also used by ifx_cat1_spi_release() (only when
  CONFIG_SPI_INFINEON_DMA=y),
- deinits the SCB SPI block last with Cy_SCB_SPI_DeInit(), then clears the
  cached SPI config so the next transceive after device_init() takes the
  full reconfigure path instead of being short-circuited by
  spi_context_configured().

The DMA channels are stopped before the SCB is deinitialized so the SCB
teardown is the last hardware step, and the rx/tx dma_stop sequence is
factored into ifx_cat1_spi_dma_stop() rather than duplicated between the
deinit and release paths.

The deinit function and its reference in the device definition are
guarded by CONFIG_DEVICE_DEINIT_SUPPORT, matching the pattern used by
drivers/spi/spi_nrfx_spim.c and drivers/spi/spi_bflb.c.

Also drop the unused dma_configured field from struct ifx_cat1_spi_data:
it was never read and never set to true anywhere in the driver.

Verified on kit_pse84_eval/pse846gps2dbzc4a/m55:
  - [spi_loopback.test_spi_deinit] PASS
  - [spi_loopback.test_spi_deinit_busy] PASS (device_deinit() returns
    -EBUSY while an 8192-byte DMA transfer is in flight, then succeeds
    and re-inits once the bus is idle)

Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
2026-09-19 10:29:24 +02:00
Fin Maaß
6890544d6c drivers: ethernet: stm32: enable source selection clocks with on()
The STM32 RCC applies a kernel clock source selection from
clock_control_on() now, so stop inspecting struct stm32_pclken to pick
between on() and configure() and enable every clocks entry the same way
in the HAL driver and in the DWC MAC glue.

Built for nucleo_h743zi with both drivers.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-18 13:54:16 +01:00
Fin Maaß
36bdb43943 drivers: clock_control: stm32: apply source selection from on()
Peripherals whose clocks property mixes bus gates with a kernel clock
source selection have to inspect the ST-private struct stm32_pclken to
decide between clock_control_on() and clock_control_configure() for
each entry. Let on() apply a source selection entry itself instead of
rejecting it with -ENOTSUP, so that a consumer can enable every clocks
entry the same way without knowing the cell encoding. off() keeps
rejecting such entries.

Built for nucleo_h743zi, nucleo_f767zi, stm32h573i_dk and
stm32mp135f_dk.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-18 13:54:16 +01:00