Commit graph zephyr/drivers
Author SHA1 Message Date
Fabian Kainka
218484b36b drivers: gpio: pca_series: fix GPIO_DISCONNECTED as not supported
Configuring a pin with GPIO_DISCONNECTED currently
results in the pin being set as output due to a
fallthrough in the code. This is not supported by
the driver and should return -ENOTSUP instead.

This commit ensures that configuring GPIO_DISCONNECTED
is explicitly rejected and not applied to the hardware.

Signed-off-by: Fabian Kainka <f.kainka@gmx.de>
2026-04-01 09:09:57 -05:00
Ryan Erickson
4023ded959 drivers: dp: fix reset state
When the debug port is turned on, the reset IO should be set inactive.
Setting the pin active will hold the device in reset constantly and
causes issues with debug port access.

When the port is turned off, the keep_reset_deast option should set
the IO to inactive as the kconfig states.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
2026-03-31 18:21:41 -05:00
Erwan Gouriou
5ac8a0e2ae Revert "drivers: pwm: add support for enabling DMA requests"
This reverts commit 311a841620.
+ related changes done in 841e4d4597

Proposed API change result in vendor specific details of the DMA leaking
into application code, which prevents usage with portable code.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2026-03-31 13:58:55 -05:00
Guillaume Gautier
9e10d4a7ca drivers: adc: stm32: fix preselection register for stm32h72x/73x
STM32H72x/73x ADC have a PCSEL_RES0 register instead of PCSEL for other
series.
Make a special case to prevent a compilation error.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-03-31 13:54:23 -05:00
Valerio Setti
a28407d9b2 drivers: entropy: mcux: require PRNG on ENTROPY_MCUX_TRNG
According to the note the driver is not able to provide large amount of
data and it can only be used as seed for a RNG. Therefore enable
ENTROPY_NEEDS_PRNG on it.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-03-31 13:50:34 -05:00
Valerio Setti
2b9e3265c8 drivers: entropy: add new Kconfig ENTROPY_NEEDS_PRNG
This Kconfig is used to signal that the entropy driver needs a PRNG crypto
algorithm on the provided data. The reason is that the driver is not
capable of providing large amount of data in a relatively short amount of
time.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-03-31 13:50:34 -05:00
Yangbo Lu
1be0d9a58b drivers: ethernet: dsa_tag_netc: validate RX tag before using
The RX tag length and port index in the tag should be validated
before using.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-03-31 10:25:39 -05:00
Jacob Wienecke
99a9e1a284 drivers: hwinfo: rw61x: fix multi-cause reset handling
POWER_GetResetCause() returns an OR'd bitmask since multiple reset
causes can occur simultaneously. The switch statement only matched
a single value, falling through to default and returning 0 when
multiple bits were set. Replace with bitwise checks to accumulate
all active reset flags.

Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
2026-03-31 10:22:13 -05:00
Ofir Shemesh
b1afb494b0 flash: nxp: align FlexSPI NOR DTS with soc-nv-flash layout
NXP FlexSPI NOR flash nodes were missing the soc-nv-flash child
node expected by Zephyr's flash map API.

Without this child node, DT_MTD_FROM_FIXED_PARTITION resolved to
the FlexSPI memory controller instead of the flash device. Since
the controller has api = NULL, MCUboot could hit a NULL pointer
dereference during boot on Zephyr 4.4.

Fix this by updating the DTS structure to match the soc-nv-flash
convention used by the flash map infrastructure.

Changes:
- add a soc-nv-flash child under each nxp,imx-flexspi-nor node
- move erase-block-size, write-block-size, and partitions into it
- add ranges to flash controller nodes for address translation
- update zephyr,flash to point to the soc-nv-flash child
- add zephyr,flash-controller chosen for the flash driver node
- remove soc-nv-flash.yaml from nxp,imx-flexspi-nor.yaml
- use zephyr,flash-controller in flash CMake XIP decisions
- update FlexSPI XIP Kconfig logic to walk to the grandparent

This keeps the controller and flash device roles separate and
restores correct flash map resolution for MCUboot and XIP logic.

Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
2026-03-30 15:04:48 -05:00
Krisztian Szilvasi
7ee1146a5b drivers: memc: fix compiler warnings for stm32 ospi psram
shared_multi_heap_add expects the region parameter to be
a non-const parameter; if const is passed, it still discards
it, but generates warnings.

Signed-off-by: Krisztian Szilvasi <krisztian@atym.io>
2026-03-30 15:02:52 -05:00
Jaro Van Landschoot
b85c717d86 drivers: i2s: i2s_mcux_sai: i2s_mcux_write take size argument into account
The size argument was ignored in i2s_mcux_write. This caused unwanted
behaviour when writing data smaller than the configured size.

Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
2026-03-30 15:02:21 -05:00
Michal Chromec
235b214df7 drivers: i2c: mcux_lpi2c: remove using of kLPI2C_TransferRepeatedStartFlag
The enum kLPI2C_TransferRepeatedStartFlag is not used in fsl_lpi2c.c,
so it shouldn't be used in mcux_lpi2c drivers.
Update nxp hal to get latest version of lpi2c drivers.

Signed-off-by: Michal Chromec <michal.chromec@nxp.com>
2026-03-30 15:01:43 -05:00
Kate Wang
cfbeb7b74c drivers: display: mcux_dcnano_lcdif: use DT_INST_ENUM_HAS_VALUE macro
Replace DT_ENUM_IDX_OR with DT_NODELABEL usage with the more appropriate
DT_INST_ENUM_HAS_VALUE macro for checking the version property value.
This improves code readability and uses the proper devicetree API for
enum value checking.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
2026-03-30 10:17:00 -05:00
Chun-Chieh Li
4a7f05be17 drivers: usb: udc: numaker: remove Control OUT error check
Remove the error check because it may misjudge some right cases.
For example, for HSUSBD, in the case Setup-DataIn-StatusOut and
immediately following Setup-DataOut-StatusIn, the DataOut in the
second Control transfer has arrived but user buffer for OUT may
be only ready for StatusOut in the first Control transfer.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-03-30 10:09:56 -05:00
Chun-Chieh Li
19346d6ac6 drivers: usb: udc: numaker: hsusbd: fix NULL transfer buffer
The scheduled transfer message can be just a hint and its attached
transfer buffer can be NULL. Skip this case.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-03-30 10:09:56 -05:00
Chun-Chieh Li
b6d6a10a7e drivers: usb: udc: numaker: hsusbd: fix STALL causes crash
The crash results from Control transfer STALL interrupt flag
not cleared. To catch all uncleared interrupt flags, all Control
transfer interrupt flags are cleared altogether at one place
instead of separately, with their handling order not changed.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-03-30 10:09:56 -05:00
Chun-Chieh Li
91f84a8ace drivers: usb: udc: numaker: refine format
Slightly refine the format

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-03-30 10:09:56 -05:00
Jonathan Keller
388f386d60 drivers: wifi: infineon: Fix null pointer dereference in airoc_mgmt_scan
If the user passed no parameters, `params->scan_type` would dereference a
null pointer.

Signed-off-by: Jonathan Keller <jonathan.keller@infineon.com>
2026-03-30 10:09:02 -05:00
Ahmed Ahmed
c64d271a03 drivers: serial: nrfx_uarte: Fix high-speed UART baudrate calculation
The UARTE_GET_CUSTOM_BAUDRATE macro used an incorrect formula that
did not match the one specified in the nRF54x UARTE datasheet.

The correct formula is:
  2^12 * floor(2^20 / round(f_PCLK / desired_baudrate))

Update the macro to match the datasheet formula, to reduce the
baudrate error for high-speed UART instances on nRF54x devices.

Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
2026-03-30 09:58:40 -05:00
Fin Maaß
511a50d831 drivers: ethernet: nxp: correct net_if_carrier use
net_if_carrier is to be used independently of the
administrative state (start and stop of the ethernet_api).

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-30 09:55:50 -05:00
Jianxiong Gu
fc4a381bd2 soc: wch: unify SOC series naming for CH32V00X
Replace SOC_SERIES_CH32V00X with SOC_SERIES_QINGKE_V2C to maintain
consistent naming across SOC series.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2026-03-28 08:04:33 -04:00
Pisit Sawangvonganan
c7ca7abc87 drivers: fix typo in (w1, watchdog, wifi)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/w1`
- `drivers/watchdog`
- `drivers/wifi`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
4328b32b5c drivers: fix typo in (serial, spi, tee, timer, usb, usb_c, video)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/serial`
- `drivers/spi`
- `drivers/tee`
- `drivers/timer`
- `drivers/usb`
- `drivers/usb_c`
- `drivers/video`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
4f9a85e80a drivers: fix typo in (rtc, sdhc, sensor)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/rtc`
- `drivers/sdhc`
- `drivers/sensor`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
f5512a6907 drivers: fix typo in (mipi_dbi, misc, mm, mspi, pcie, ptp_clock, pwm)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/mipi_dbi`
- `drivers/misc`
- `drivers/mm`
- `drivers/mspi`
- `drivers/pcie`
- `drivers/ptp_clock`
- `drivers/pwm`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
c259c78097 drivers: fix typo in (interrupt_controller, led_strip, lora, memc, mfd)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/interrupt_controller`
- `drivers/led_strip`
- `drivers/lora`
- `drivers/memc`
- `drivers/mfd`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
a847abf22c drivers: fix typo in (i2s, i3c, ieee802154, input)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/i2s`
- `drivers/i3c`
- `drivers/ieee802154`
- `drivers/input`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
edae0e7e30 drivers: fix typo in (ethernet, flash, fpga, fuel_gauge, gpio, i2c)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/ethernet`
- `drivers/flash`
- `drivers/fpga`
- `drivers/fuel_gauge`
- `drivers/gpio`
- `drivers/i2c`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
531628e57a drivers: fix typo in (disk, display, dma, eeprom, entropy, espi)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/disk`
- `drivers/display`
- `drivers/dma`
- `drivers/eeprom`
- `drivers/entropy`
- `drivers/espi`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
d08da865be drivers: fix typo in (clock_control, counter, crypto, dai, debug)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/clock_control`
- `drivers/counter`
- `drivers/crypto`
- `drivers/dai`
- `drivers/debug`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Pisit Sawangvonganan
3c44bcd2a0 drivers: fix typo in (adc, audio, bluetooth, can, charger)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/adc`
- `drivers/audio`
- `drivers/bluetooth`
- `drivers/can`
- `drivers/charger`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Fin Maaß
625a3ee2fe drivers: wifi: esp32: reset data->scan_cb on fail
reset data->scan_cb on fail, otherwise we can't
try it again, because we check it at the begining
and return when it is already set.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-27 20:19:10 -04:00
Andrei Menzopol
940f8da2f8 drivers: ieee802154: mcxw: Fix double free
pd_mac_sap_handler gPdDataInd_c case shouldn't free msg
as it is already freed by the rx_thread. The msg is put
in rx_msgq queue through k_msgq_put which does a shallow
copy.

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>
2026-03-27 13:59:36 -05:00
Tomasz Moń
df6be6479e drivers: udc_nrf: Detect isochronous DMA during SOF
nRF USBD peripheral allows only one DMA to/from isochronous endpoint in
between two SOF packets. nRF UDC driver enforces this limitation using
m_ep_ready variable that has respective endpoint bit set to 1 inside SOF
handler. While this works most of the time, there is a corner case where
the DMA can start before SOF and finish after SOF.

Prevent issuing two DMA to/from isochronous endpoint within one frame by
not setting m_ep_ready bit if isochronous endpoint DMA was active during
SOF. This avoids failed assertion for iso IN endpoint being armed and
ready at the same time.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2026-03-27 13:48:36 -05:00
Tomasz Moń
338ea9f927 drivers: udc_nrf: Dequeue endpoints in driver thread
Endpoint dequeue is inherently racing against bus transactions. It is
possible that transfer finishes right before dequeue. When this happens
it was possible for the endpoint queue to be empty during xfer finished
handling. Resolve the software thread race by performing dequeue in the
same thread that handles finished transfers.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2026-03-27 13:48:36 -05:00
Anas Nashif
4809fb40a6 counter: handlers: include marshalling header
Add missing header, this prevents build issues with llvm.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-03-27 12:35:56 -04:00
Ryan McClelland
748604daec drivers: counter: fix get_pending_int return type mismatch
The counter_api_get_pending_int typedef returns uint32_t, but the
public counter_get_pending_int API, its inline implementation, and
its syscall handler all return int. Several drivers return raw hardware
register bitmasks that can have upper bits set; the implicit cast to
int would make those values appear negative, which callers could
misinterpret as error codes.

Change the public API, inline impl, and syscall handler to return
uint32_t to match the driver API typedef.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-03-27 12:35:39 -04:00
Fabio Baltieri
2dec0486bf drivers: nrf: fix some llvm warnings
Fixes:

zephyr/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c:414:23:
warning: unused function 'ep_to_hal' [-Wunused-function]

zephyr/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c:816:22:
warning: unused function 'usbd_ep_iso_capacity' [-Wunused-function]

When compiling with LLVM:

west build -p -b nrf52840dk/nrf52840 samples/subsys/usb/hid-keyboard --
-DTOOLCHAIN_VARIANT_COMPILER=llvm

Drop ep_to_hal since it's static and unused, usbd_ep_iso_capacity is
used in an assert just flag it as maybe unused.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-03-27 12:35:07 -04:00
Johann Fischer
789f5ca318 drivers: udc_nrf: submit UDC_EVT_VBUS_READ if VBUS is still present
When the device is connected to the host, but the application shuts down
and initialize USB device again, there will be no UDC_EVT_VBUS_READ
event generated from USB VBUS regulator on nRF52840 and nRF5340
controller. We can track the state in the driver and resubmit the event
just at the beginning of the initialization. If the device gets
disconnected in between, there will be subsequent UDC_EVT_VBUS_REMOVED
event. Perhaps it could also be solved in more generic way, but other
controllers could behave differently. Also, it could be considered that
the application should track the state of the VBUS.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-03-27 12:34:23 -04:00
Tim Pambor
22d1ea568e drivers: adc: shell: fix a dangling pointer warning
Fix a dangling pointer warning in adc_shell.c by placing the
help text in a static variable instead of returning a pointer
to a local variable.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-27 09:16:21 +01:00
Nikhil Namjoshi
4d2950a694 drivers: ksz8081: Add PHY readiness check after PHY reset
Some systems can have board layout that can cause PHY
reset to be slower. So add more checkes to make sure
PHY is completely out of reset. We basically check
1) Power down bit from BMCR register
2) Reset bit from BMCR register
3) Factory Bit in OMSO register

Tested:

Verified that on a system with slow PHY
reset, the bit verification logic helps
ensure PHY is out of reset.

If the PHY takes longer thann 0.5s, then the
PHY bit checking logic helps surface the problem.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-03-26 19:28:25 -04:00
Arjun Sahajan
1a3d043ab3 drivers: wdt: mchp_xec: Update WDT driver with new macros
Update PCR and GIRQ properties of WDT driver to use new macros

Signed-off-by: Arjun Sahajan <Arjun.Sahajan@microchip.com>
2026-03-26 19:27:05 -04:00
Brett Peterson
13b22ea472 drivers: audio: fixing dma configuration in infineon dmic driver
The infineon dmic driver did not correctly track the address offset into
the current receive buffer and there were also issues with the transfer
size calculations. This change corrects these issues.

Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
2026-03-26 14:01:47 -04:00
Fin Maaß
e63d60915a drivers: wifi: esp32: set band info in scaned aps
set band info in scaned aps.
As the esp32-c5 supports 5 Ghz, the info can there otherwise
be wrong.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-26 14:01:25 -04:00
Mathieu Choplain
13c724de1e drivers: dma: stm32: enable the transfer error interrupt
The driver never enabled the transfer error interrupt. If a transfer error
occurred, the ISR would not be called which could result in a deadlock.

Make sure the transfer error interrupt is enabled.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-03-26 10:44:59 -04:00
Santhosh Charles
1ed50bfa78 drivers: can: add driver support for TI MSPM0 G-Series MCAN module
Add driver support for MCAN module on TI's MSPM0 G-Series MCUs.
The MCAN module supports both classic CAN and CAN FD protocols.

Signed-off-by: Santhosh Charles <santhosh@linumiz.com>
Signed-off-by: Jackson Farley <j-farley@ti.com>
Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2026-03-26 07:17:56 -04:00
Santhosh Charles
903f988c41 drivers: clock_control: mspm0: add CANCLK source support
Add support for the CANCLK source for MSPM0. `mspm0_canclk_cfg`
config struct is used to get rate.

Signed-off-by: Santhosh Charles <santhosh@linumiz.com>
2026-03-26 07:17:56 -04:00
Srikanth Boyapally
8cc69ce9a2 spi: cdns: Fix RX FIFO overflow and adjust RX accounting for slave mode
The Cadence SPI driver relied on a conditional guard around software RX
accounting (tx_remain_entry/fifo_diff) in spi_cdns_send(). During
opcode/address/dummy phases (e.g., SPI NOR reads), the RX segment may be
NULL (discard), causing the guard to evaluate false. This prevented the
driver from tracking RX entries generated by each TX entry and could
lead to RX FIFO overflow.

Fix this by always decrementing tx_remain_entry and incrementing
fifo_diff for every TX FIFO entry pushed. Since SPI is full‑duplex, each
TX entry clocks in one RX entry, regardless of whether the client
provides an RX buffer for that phase. The ISR drains RX while fifo_diff
> 0, so keeping fifo_diff accurate prevents overflow.

Also update spi_cdns_recv() RX context handling to be mode-aware:
- In slave mode, advance RX context only when an RX buffer is present.
- In master mode, advance RX context for each received frame.

This keeps slave receive accounting consistent while preserving correct
master behavior, and aligns with the software-tracking approach used to
avoid unreliable RX_NOT_EMPTY status (AR#65885).

As part of this change, refactor spi_cdns_recv() to reduce cognitive
complexity and improve readability, without changing functional behavior.

Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com>
2026-03-25 15:08:03 -04:00
Fabian Blatz
92a78dfa89 drivers: watchdog: wdt_cc32xx: Remove unused variable
Fix build failure caused by unused `rv` variable.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2026-03-25 15:07:02 -04:00
Carlo Caione
cb959fdb58 lorawan: native: add PM_DEVICE support to sx126x driver
Register a pm_action callback that disconnects RF GPIO pins
(antenna enable, TX/RX FE_CTRL) on suspend and reconfigures
them on resume.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-03-25 07:58:52 -04:00