Commit graph zephyr/drivers
Author SHA1 Message Date
Henrik Brix Andersen
6c7aadb0fc drivers: can: stm32: bxcan: fix assert statement
Use CODE_UNREACHABLE instead of __ASSERT_UNREACHABLE as the latter is only
for test cases.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2026-05-07 18:15:26 -05:00
Alain Volmat
4f8137d035 video: imx335: test_pattern handling support
This commit adds the handling of test patterns generated
by the sensor.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-05-07 18:14:22 -05:00
Mathieu Choplain
63da9b5dbf drivers: counter: stm32_rtc: manage EXTI line in a proper manner
Instead of hardcoded EXTI line numbers and raw LL API calls, align the
STM32 RTC Counter driver with its Real-Time Clock counterpart:
- obtain EXTI line number from Devicetree
- use the EXTI INTC API instead of raw LL API calls

Fixes the build issue observed on STM32N6.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-05-07 18:12:51 -05:00
Fin Maaß
584d2911cd drivers: net: ppp: add dt dependency
if NET_TEST is not used, we need the
chosen zephyr,ppp-uart in the devicetree,
therefore add that dependency to the
NET_PPP driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-05-07 18:10:17 -05:00
Fin Maaß
4a1916eba4 drivers: ethernet: ivshmem: set ETH_NIC_MODEL
Even though the ivshmem ethernet driver can't be
directly run in the regular qemu, with west build -t run
we set this here, as we otherwise would get a build error.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-05-07 18:10:17 -05:00
Egill Sigurdur
a23abac549 kernel: sys_mem_blocks: add SYS_MEM_BLOCKS_DEFINE_TYPE for alignment
Introduces SYS_MEM_BLOCKS_DEFINE_TYPE() and
SYS_MEM_BLOCKS_DEFINE_STATIC_TYPE() helpers to allow the user to declare
mem blocks without having to manually ensure the alignment is correct,
which was very error-prone.

Matches the new K_MEM_SLAB_DEFINE_TYPE.

Signed-off-by: Egill Sigurdur <egill@egill.xyz>
2026-05-07 18:09:41 -05:00
Egill Sigurdur
16ac4a5b78 kernel: mem_slab: add K_MEM_SLAB_DEFINE_TYPE for automatic alignment
Introduces K_MEM_SLAB_DEFINE_TYPE() and K_MEM_SLAB_DEFINE_STATIC_TYPE()
helpers to allow the user to declare slabs for types without having to
manually ensure the alignment is correct.

Manual slab alignment was very error-prone and this change fixes several
instances of misalignment that would be trapped by the undefined
behavior sanitizer when running on 64-bit targets.

Signed-off-by: Egill Sigurdur <egill@egill.xyz>
2026-05-07 18:09:41 -05:00
Zhaoxiang Jin
9bf8689eb7 drivers: nxp_pmc_tmpsns: get calibration data using NVMEM
Read the temperature sensor calibration value through the
NVMEM API instead of the legacy ROM OTP API. The calibration
data is exposed by the OCOTP node as an NVMEM cell, so the
driver no longer depends on fsl_romapi_otp.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-05-07 18:04:59 -05:00
Zhaoxiang Jin
3628126fe5 drivers: otp: Add support for NXP RT7xx OCOTP
Add support for NXP RT7xx OCOTP

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-05-07 18:04:59 -05:00
Matthias Plöger
82acd3ef37 drivers: pwm: stm32: refactor ARR preload generation into device init
Avoids set of ARR value without enabled preload once counter is enabled.

Signed-off-by: Matthias Plöger <matthias.ploeger@phoenixcontact.com>
2026-05-07 18:04:01 -05:00
Matthias Plöger
1853c1a106 drivers: pwm: stm32: Avoid update generation in master-update mode
When the following conditions are met:
- center aligned mode
- trigger generation on update event
an additional update event is avoided during channel activation.
This may cause (depending on the up/down counting direction) a
de-synchronisation between pwm polarity and generated trigger.
Problematic  when e.g. the adc should trigger during high- and
low phase of a pwm signal.

Signed-off-by: Matthias Plöger <matthias.ploeger@phoenixcontact.com>
2026-05-07 18:04:01 -05:00
Mohammad Odeh
a98f0fdba2 drivers: sdhc: stm32: add SDMMC support using LL-implementation
Extend the STM32 SDHC driver to support SD memory cards in
addition to SDIO. This adds handling for the following commands:
- SD_SEND_IF_COND (CMD8)
- SD_APP_CMD (CMD55)
- SD_APP_SEND_OP_COND (ACMD41)
- SD_ALL_SEND_CID (CMD2)
- SD_SEND_CSD (CMD9)
- SD_APP_SEND_SCR (ACMD51)
- SD_SET_BLOCK_SIZE (CMD16)
- SD_READ_SINGLE_BLOCK/SD_READ_MULTIPLE_BLOCK (CMD17/CMD18)
- SD_WRITE_SINGLE_BLOCK/SD_WRITE_MULTIPLE_BLOCK (CMD24/CMD25)
- SD_ERASE_BLOCK_START/END/OPERATION (CMD32/CMD33/CMD38)
- SD_SWITCH (CMD6)
- SD_SEND_STATUS (CMD13)

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
a1a60fc99c drivers: sdhc: stm32: replace HAL_SDIO with LL-based implementation
Replace STM32 HAL SDIO API calls with custom LL-based wrapper
functions. This removes the dependency on the STM32 HAL SDIO driver.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
75ddd2276c drivers: sdhc: stm32: Rename SDHC polling config option
Renamed the Kconfig and code references from SDHC_STM32_POLLING_SUPPORT
to SDHC_STM32_DMA_MODE for clarity.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Sara Touqan
766e06adb4 drivers: sdhc: stm32: drop 1.8V support check
Remove 1.8V capability check from
sdhc_stm32_switch_to_1_8v() since this
validation is expected to be handled by
zephyr subsystem.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
59ffd1269e drivers: sdhc: stm32: use data timeout for rw_extended
Replace CONFIG_SD_CMD_TIMEOUT with the actual timeout value
from the sdhc_data structure (data->timeout_ms) for waiting
on DMA completion semaphore.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
ff7d4a207f drivers: sdhc: stm32: refactor error logging
- Replace multiple individual if statements in sdhc_stm32_log_err_type()
with a static const array of error masks and messages.
- Add some error log messages to improve visibility of SDMMC error
conditions.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
e073330766 drivers: sdhc: stm32: Refactor SDMMC ISR
- Extracted SDMMC interrupt flag clearing into a new helper function.
- Enhanced the event ISR to log errors, call error logging helpers.
- Deferred PM release to ISR only when a DMA-based command is
  successfully launched

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
09453bb181 drivers: sdhc: stm32: refactor request error handling and code organization
- Consolidate sdmmc_res error handling into a single check
  at the end of the switch block, removing redundant per-case checks
- Rename goto label 'out' to 'end' in sdhc_stm32_set_io()
- Move DEVICE_API definition after sdhc_stm32_init() for better
  code organization

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
1c811ecd8b drivers: sdhc: stm32: improve code formatting
Fix whitespace, indentation, and alignment issues throughout
the driver

Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
81626ed71d drivers: sdhc: stm32: remove unused cmd_index from data struct
Remove unused cmd_index from sdhc_stm32_data structure

Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
3ddfec7912 drivers: sdhc: stm32: remove card reset from host reset function
The reset function should reset the host controller only, not the card.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
0773400548 drivers: sdhc: stm32: simplify card presence detection
When no CD GPIO is configured, assume the card is present instead
of sending commands to probe, to avoids sending unexpected commands
that the SD subsystem doesn't expect.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Mohammad Odeh
e6998c7496 drivers: sdhc: stm32: fix PM device registration in DEVICE_DT_INST_DEFINE
The PM_DEVICE_DT_INST_GET macro was defined but not passed to
DEVICE_DT_INST_DEFINE, meaning PM callbacks were not properly
registered.

Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
2026-05-07 18:03:20 -05:00
Ryan McClelland
f29a2f11bd drivers: counter: stm32: introduce counter capture api
This introduces APIs for input capture on the STM32.

Rename callback in data to alarm_cb to prevent confusion with other
callbacks.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-05-07 18:02:21 -05:00
Ryan McClelland
1bc5f0543c drivers: counter: introduce counter capture api
This introduces APIs for input capture.

A use case for this would be time stamping a rising and/or falling edge
where precision and lack of jitter is important. The only way to currently
do this in zephyr is to set up a GPIO interrupt and then read the counter
or kernel time... but this can have limitations of software such as the
processor may have a lot going on and can be subject to interrupt
latencies. Having a hardware 'latch' done of the rising and/or falling
edge with respect to a timer can eliminate these imprecisions.

How this is to be used, is that an application is to call
`capture_callback_set` with the configuration of the channel number, flags
(such as falling, rising, or both edges), and then a callback function.
Then the `capture_enable` function is to be called to enable this. The
callback has the timestamp of the edge in ticks and the edge that it
captured (rising or falling).

This also adds a 64 bit tick version for the capture callback.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-05-07 18:02:21 -05:00
Mathieu Choplain
9735d90de4 drivers: mspi: stm32_*: save base address in device configuration
The base address is constant, it's wasteful to store it in device data.
`void *` type is used instead of hardware-specific `xxx_TypeDef *` since
the structure is shared by all controller drivers (QSPI, OSPI and XSPI).

Since this removes the need for a cast, this tangantially fixes a bug in
the OSPI driver which used the wrong type when casting device address:
`(XSPI_TypeDef *)` instead of `(OCTOSPI_TypeDef *)`.

While at it, move a `bool` field at the tail to avoid padding INSIDE the
structure (although there's sadly still some, due to struct mspi_cfg...)

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-05-07 15:15:16 +01:00
Steven Chang
b9cbec5444 drivers: watchdog: kb106x: Fix watchdog reset flag misconfiguration.
- Fix watchdog reset flag misconfiguration.

Signed-off-by: Steven Chang <steven@ene.com.tw>
2026-05-07 13:20:02 +01:00
Aksel Skauge Mellbye
b0344892f7 manifest: Update hal_silabs
Update hal_silabs to new HAL versions:

* SiSDK 2025.12.3
* WiSeConnect 4.0.2

This HAL update requires a minor change to the `memc` driver
for SiWx91x because an API has been renamed.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-05-07 13:19:13 +01:00
Krzysztof Chruściński
9697c188fe drivers: serial: nrfx_uarte: Use TIMER address from DT
For bsim targets MDK define (NRF_TIMERx) which is an address
of TIMER peripheral is not the same as register address for
timer node. Driver expects that address is set to the HW
peripheral address and it is later on converted to RAM
structure used by the bsim. Use address from the device tree
as it actually is set to the HW address, contrary to the
NRF_TIMERx macro which already points to the RAM structure
used by the simulator.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-05-07 13:18:41 +01:00
Adrien Ricciardi
5f1f342ac5 drivers: serial: R-Car: Add generic clock support
Convert the driver clock accesses to use the new generic API, so the
driver can be used on R-Car boards generations 3, 4 and 5 without changes.

This code has been tested on a Spider S4 and on an Ironhide X5H.

Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
2026-05-07 14:16:55 +02:00
Fabio Baltieri
35454d4458 input: use more LOG_ERR_DEVICE_NOT_READY
Fix more LOG_ERR_DEVICE_NOT_READY usages that were missing from
31b5866c88 for some reasons, there should be no more custom "not ready"
messages in input drivers after this.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-05-07 10:46:39 +01:00
Alexpandi Muniyandi
3984c8987a drivers: i2c: support 0-byte write for i2c scan in shell
The I2C shell scan probes addresses with a 0-byte write.
The driver returned -EIO without touching the bus because both
tx_size and rx_size are 0. Handle tx non-NULL with tx_size 0 by
calling MasterWrite which sends START + address + STOP.

Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
2026-05-07 09:23:24 +02:00
Ren Chen
ddba70043d soc: ite: ec: extend irq number size to 16-bit
Next-generation it51xxx SoCs support more than 256 irqs.
This change extends irq range up to 16 bit depend on
CONFIG_NUM_IRQS.

And the it8xxx2 SoC series only supports 8-bit irq
number size. Add irq type check assertion for this
series.

Tested with:
- it82xx2_evb/it8xxx2_evb/it51xxx_evb_it51526aw:
  tests/drivers/gpio/gpio_basic_api
- native_sim/native:
  tests/drivers/gpio/gpio_ite_it8xxx2_v2

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-05-07 09:23:06 +02:00
Fin Maaß
73a0004d6e ethernet: litex: move iface into config struct
move the pointer to the iface to the config
struct

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-05-07 09:21:51 +02:00
Fin Maaß
9e2a2e5752 ethernet: litex: flush pending irq before enable
flush pending irq before enable

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-05-07 09:21:51 +02:00
William Markezana
66b4ecb85d drivers: bluetooth: add BL61x on-chip BLE HCI driver
Extend the shared BFLB HCI driver with BL61x (BL616/BL618) support:
BL61x include paths and RF init routing through bflb_rf_init().

Kconfig adds BT_BFLB_BL61X with four controller variant choices, a
configurable PHY/RF retention memory size, and a 64 KB exchange memory
option for the BR/EDR variant.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-05-07 09:16:15 +02:00
William Markezana
d3274916ab drivers: sensor: add TE Connectivity HTU31D sensor driver
Add a driver for the HTU31D digital humidity and temperature sensor
from TE Connectivity (Measurement Specialties).

The driver implements the Zephyr sensor API with support for
SENSOR_CHAN_HUMIDITY (%) and SENSOR_CHAN_AMBIENT_TEMP (degrees C).
Measurement data is validated with CRC-8 per the datasheet.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-05-07 09:13:40 +02:00
Andrei-Edward Popa
e1cebbe7ad drivers: serial: uart_cmsdk_apb: fix init flow after pinctrl apply
uart_cmsdk_apb_init() returns early when pinctrl_apply_state()
succeeds, because the return value check is wrong.

As a result, the rest of the UART initialization is skipped and
the device remains only partially initialized.

Ignore -ENOENT as intended, but continue init on success and
abort only on real pinctrl errors.

Signed-off-by: Andrei-Edward Popa <andreip@axonne.com>
2026-05-07 09:13:09 +02:00
Tomi Fontanilles
7d65b380e2 modules: mbedtls: link to mbedTLS only when CONFIG_MBEDTLS_BUILTIN
393350fd65 made it so that the `mbedTLS`
library is only created when `CONFIG_MBEDTLS_BUILTIN`.

Before this commit, users of Mbed TLS did the following:
`zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)`

If the `mbedTLS` CMake library doesn't exist but is still linked to
(as is the case when `CONFIG_MBEDTLS && !CONFIG_MBEDTLS_BUILTIN`),
the linker command is populated with `-lmbedTLS` which makes the build
fail because there is no `libmbedTLS.a` in the build.

Make it so that users of Mbed TLS only link to the `mbedTLS` CMake
library when the builtin version is used.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2026-05-07 09:11:36 +02:00
Sanjay Vallimanalan
143953b66a drivers: watchdog: Add MSPM0 watchdog driver
TI MSPM0 has a WWDT module to initiate a reset when correct operation of
the device has failed due to an unexpected software or system delay.

Signed-off-by: Sanjay Vallimanalan <sanjay@linumiz.com>
Signed-off-by: Jackson Farley <j-farley@ti.com>
2026-05-07 09:10:50 +02:00
Pete Johanson
a0d8f78655 drivers: usb: udc: Buffer null checks, EP0 OUT handling, etc
Add missing null buffer checks in event callbacks for IN/OUT done handling,
various small fixes for halted state handling, remove some unnecessary
logging for expected failure modes, etc

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-05-06 19:59:08 +02:00
Henrik Brix Andersen
2cb670aec6 drivers: can: stm32: bxcan: guard against NULL pointer dereference
Guard against a theoretical NULL pointer dereference in CAN send path.

Fixes: #108378

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-05-06 19:58:51 +02:00
Guillaume Gautier
8c39353686 drivers: adc: stm32: fix get channel differential
The LL_ADC_GetChannelSingleDiff function to know whether an ADC channel
is configured as differential or single-ended was not used correctly.
This lead to systematically disabling the ADC to reconfigure it, even if
the configuration was already the correct one.

Instead of returning the mode, LL_ADC_GetChannelSingleDiff returns the
channel if it is configured as differential, or 0 if it is single-ended.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-05-06 19:57:55 +02:00
Ayush Singh
c483b2aaae gpio: mspm0: Add MSPM0L110x support
- As described in datasheet, MSPM0L110x has 28 pins in GPIOA.
- Also, it does not contain GPIOB and GPIOC.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-05-06 19:57:20 +02:00
Daniel Schultz
61726d8b81 drivers: serial: uart_shell: read: Add err_check
The poll_in function doesn't return any error codes related to
the transmission itself. Call 'err_check' afterwarwds to make
sure no error flags are present.

Example: in case an FIFO overrun happens, poll_in would return
no data but this command should report the error.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2026-05-06 19:56:49 +02:00
Håvard Reierstad
41e3b91fcb Bluetooth: HCI: Allow discarding of ext adv reports
Implements a method for discarding fragmented extended advertising. In
order to acheive this, we need to consider past and future fragments
of the advertising report we discard.

The future fragments are on its way from the controller, and will result
in either a complete- or incomplete event. These are handled by tracking
the adv SID and address until the controller sends either a complete or
incomplete event. Once an advertising report is marked as discarded,
consecutive fragments will be silently discarded.

The past fragments are either already in the reassembler (in scan.c),
or on their way through the rx_queue. To handle these, and allow the
reassembler to recover from a in-progress reassembly which is discarded,
we add a work item which is rescheduled when each consecutive fragment
is received. The timeout is configurable through the new Kconfig option
`CONFIG_BT_EXT_ADV_REASSEMBLY_TIMEOUT`. On timeout, the reassembler will
change its state to discard incoming fragments from the same advertiser.
The reassembler will start assembling new fragments if it recognises a
new advertiser, or if a final fragment (either marked as complete
or incomplete) from the advertiser it is currently tracking is received.

This functionality needs to be added at a HCI driver level by using the
new `hci_ext_adv_report_process` function. It is added the the
IPC HCI driver to fix zephyrproject-rtos/zephyr#50786

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2026-05-06 16:29:15 +01:00
Amneesh Singh
24560e0a69 drivers: syscon: use uint32_t for register offsets
Use uint32_t to allow larger offsets in place of the existing uint16_t
configuration.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-05-06 16:29:04 +01:00
Camille BAUD
e233f26384 drivers: pinctrl: bflb: Add clock out support
Add ability to output clocks generated by the microcontroller onto pins

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-05-06 16:28:45 +01:00
Ren Chen
75448eb1f6 drivers: counter: it51xxx: disable alarm before callback
This commit dsiables alarm counter before executing callback
function. Additionally, the alarm counter (external timer 7)
ticks are limited to 3 bytes. Return errno if the configured
value exceeds this range.

Tested with: samples/drivers/counter/alarm

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-05-06 12:02:47 +01:00