Commit graph zephyr/drivers
Author SHA1 Message Date
Ryan McClelland
e70f090b42 drivers: i3c: dw: add dw_i3c_is_current_controller() helper
Replace 12 open-coded PRESENT_STATE_CURRENT_MASTER register checks
with a dw_i3c_is_current_controller() inline helper that takes the
device pointer, improving readability and reducing duplication.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-04-14 22:36:39 -04:00
Ryan McClelland
b906176b76 drivers: i3c: dw: handle DEFTGTS CCC in target mode
When a secondary controller receives a DEFSLVS/DEFTGTS CCC, the DW
IP writes SDCT (Secondary Device Characteristic Table) entries to the
DCT region and generates a response with TID=0xf and DATA_LENGTH set
to the device count.

Read the SDCT entries and populate data->common.deftgts with the
active controller and target device information, matching the pattern
used by the Cadence I3C driver. This is done via a k_work item to
avoid allocating memory in ISR context.

On bus owner update, when gaining controllership, enqueue
i3c_sec_handoffed() to consume the deftgts data and attach all
devices from the previous controller's bus state. Also invoke the
controller_handoff_cb if registered.

Guarded by both CONFIG_I3C_CONTROLLER and CONFIG_I3C_TARGET since
DEFTGTS is used for controller role handoff which requires both roles.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-04-14 22:36:39 -04:00
Ryan McClelland
0044b97c16 drivers: i3c: dw: add controller role handoff support
Add support for controller role (mastership) handoff using standard
DW I3C registers:

- Implement I3C_IBI_CONTROLLER_ROLE_REQUEST in target ibi_raise using
  SLV_INTR_REQ (0x8C, bit 3) with HW capability, DA validity, and
  DISEC checks before issuing the request.
- Handle mastership request IBIs on the controller side via
  i3c_ibi_work_enqueue_controller_request() instead of dropping them.
- Handle INTR_BUSOWNER_UPDATE_STAT in the ISR to flush FIFOs, resume
  the controller, and reconfigure interrupt masks for the new role.
  Guarded by both CONFIG_I3C_CONTROLLER and CONFIG_I3C_TARGET since
  role switching requires both roles compiled in.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-04-14 22:36:39 -04:00
Julien Panis
7d7863c667 drivers: firmware: scmi: Add option to force polling mode
Add an ARM SCMI option to force polling based communication flow.
This may be needed if SCMI platform does not support interrupt-driven
communication flow.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2026-04-14 22:36:01 -04:00
Carlo Caione
590c9a0683 syscon: reject misaligned register accesses
syscon_sanitize_reg() was silently rounding down misaligned offsets to
the nearest aligned address via ROUND_DOWN(). This masks caller bugs:
an offset of 0x03 with reg_width=4 would silently become 0x00, reading
the wrong register with no error reported.

Change to reject misaligned accesses with -EINVAL instead.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-14 22:35:36 -04:00
Carlo Caione
a5e3a81d56 syscon: add per-device spinlock and update_bits API
Add a spinlock to the generic syscon driver data so that concurrent
register accesses from multiple consumers are serialized per-device.

Also introduce syscon_update_bits() which performs an atomic
read-modify-write under a single lock hold.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-14 22:35:36 -04:00
Zayne Stites
00fa90d6b8 drivers: hwinfo: Added hwinfo_infineon support
Added hwinfo driver support for infineon devices

Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
2026-04-14 22:35:00 -04:00
David Chalco
81c041921a input: analog_axis: Fix self-deadlock when raw callback gets calibration
When analog_axis_calibration_get and similar are called in
analog_axis_set_raw_data_cb installed callback, analog_axis_loop
can self-deadlock. Loop takes cal_lock before invoking callback
and analog_axis_calibration_get (ex.) tries to aquire cal_lock again
at K_FOREVER in same context. Fixed by reducing cal_lock scope
and taking copy of callback ptr while under cal_lock, so cal_lock is
released before running raw callback in analog_axis_loop.

Signed-off-by: David Chalco <david@chalco.io>
2026-04-14 22:34:52 -04:00
Manimaran A
940c14d16c drivers: input: kscan: mec: enable kscan for mec174x/5x/165xb
Used Zephyr inline register access functions (sys_read/write)
instead of CMSIS register structure.

Used soc helper api to access/configure girq registers.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2026-04-14 22:34:33 -04:00
Manimaran A
f394a29aa5 dts: arm: microchip: update kscan node with new macros
Update PCR and GIRQ properties of kscan node to use new macros

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2026-04-14 22:34:33 -04:00
Tejus Subramanya
304a02cb50 drivers: wifi: siwx91x: raise NET_EVENT_WIFI_TWT from WiseConnect
Register SL_WIFI_TWT_RESPONSE_EVENTS and map sl_wifi_event_t /
sl_wifi_twt_response_t into struct wifi_twt_params, then call
wifi_mgmt_raise_twt_event() so applications receive TWT setup/teardown
results (resp_status, setup_cmd, negotiated parameters).

Signed-off-by: Tejus Subramanya <ters@silabs.com>
2026-04-14 22:34:02 -04:00
Fin Maaß
2820b49a40 drivers: wifi: esp32: fix ESP32_WIFI_STA_AUTO_DHCPV4
When ESP32_WIFI_STA_AUTO_DHCPV4 is
enabled functions from the dhcpv4 clients are
used, therefore we need to depend on it, otherwise
a user could activate that Kconfig without the dhcpv4
client being enabled, which would lead to a build error.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-04-14 22:33:12 -04:00
Guðni Már Gilbert
04ab47f24d build: avoid including unnecessary directories
Folders which have menuconfig can be conditionally included

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2026-04-14 22:32:15 -04:00
Matin Lotfaliei
d53115be07 drivers: pinctrl: esp32: fix BIT overflow for pins >= 32
Same issue as the GPIO driver: esp32_pin_is_valid() and
esp32_pin_is_output_capable() use BIT() which overflows on 32-bit
Xtensa for pin numbers >= 32.

Fix by using BIT64() to match the 64-bit SOC_GPIO_VALID_GPIO_MASK.

Signed-off-by: Matin Lotfaliei <matinlotfali@gmail.com>
2026-04-14 22:31:46 -04:00
Matin Lotfaliei
68398e706b drivers: gpio: esp32: fix BIT overflow for pins >= 32
gpio_pin_is_valid() and gpio_pin_is_output_capable() use BIT() which
expands to (1UL << n). On 32-bit Xtensa targets, unsigned long is
32 bits, so BIT(n) for n >= 32 is undefined behavior.

This causes gpio1 pins (GPIO32+) to always fail validation with
-EINVAL, breaking any peripheral connected to GPIO32-GPIO48 on
ESP32-S3 (and similar ESP32 variants with gpio1).

Fix by using BIT64() which correctly handles pin numbers >= 32
since SOC_GPIO_VALID_GPIO_MASK is already a 64-bit value.

Signed-off-by: Matin Lotfaliei <matinlotfali@gmail.com>
2026-04-14 22:31:46 -04:00
Nicolas Pitre
7e02a6847e drivers: timer: arm_arch: use WFxT in arch_busy_wait()
Use the WFET (Wait For Event with Timeout) instruction, introduced in
Armv8.8-A (FEAT_WFxT), to let the CPU enter a low-power state during
arch_busy_wait() instead of spinning on the counter.

The availability of WFxT is detected at runtime by reading
ID_AA64ISAR2_EL1. When the feature is absent, the existing polling
loop is used as before.

Also fix the cycles_to_wait computation to use 64-bit multiplication
to avoid truncation with large usec_to_wait values.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-14 22:31:36 -04:00
Ryan McClelland
caccbe5c82 drivers: i3c: add disable-hj-at-init controller flag
Add I3C_CONTROLLER_FLAG_DISABLE_HJ_AT_INIT as BIT(1) in the
controller config flags. When set via the devicetree boolean property
"disable-hj-at-init" on the I3C controller node, Hot-Join ACKs will
not be enabled at the end of bus initialization. Hot-Join events will
be NACKed until the application explicitly enables them.

Guard the ENEC HJ broadcast in i3c_bus_init() (i3c_common.c), the
cdns-specific HJ ACK register write, the dw HJ NACK clear, and the
stm32 LL_I3C_EnableHJAck() call with this flag.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-04-14 22:31:26 -04:00
Ryan McClelland
19efb68d56 drivers: i3c: add disable-bus-init controller flag
Add a flags field (uint8_t) to struct i3c_driver_config and define
I3C_CONTROLLER_FLAG_DISABLE_BUS_INIT as BIT(0). When set via the
devicetree boolean property "disable-bus-init" on the I3C controller
node, i3c_bus_init() will not be called during driver initialization,
allowing the application to perform bus initialization at a later time.

Add I3C_CONTROLLER_CONFIG_FLAGS_DT_INST() macro in devicetree.h to
read the flag from the devicetree, following the same FIELD_PREP
pattern used for per-device flags in I3C_DEVICE_DESC_DT.

Update cdns, dw, max32, it51xxx, mcux, npcx, renesas_ra, and stm32
drivers to populate the new flags field and check it before calling
i3c_bus_init().

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-04-14 22:31:26 -04:00
Ren Chen
7a9027c4a2 drivers: comparator: it51xxx: add support for higher adc channel range
This commit adds support for higher adc channel range. (8 and above)

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-04-14 22:30:17 -04:00
Jordan Yates
360e25ce58 modem: cellular: update carrier state locations
The `NET_IF_LOWER_UP` (carrier on/off) state is not intended to signify
network registration state, that is the job of `NET_IF_DORMANT`. The
example from the documentation is:

> An example of an event that changes the carrier state is Ethernet
  cable being plugged in or out.

In the context of an LTE network, I am interpretting the equivalent of
the "cable" to be the modem ready to start searching for networks to
join. The state combinations end up being:

 * `!LOWER_UP && DORMANT`: Modem off or booting
 * `LOWER_UP && DORMANT`: Modem searching for network
 * `LOWER_UP && !DORMANT`: Modem registered to network

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-14 22:28:46 -04:00
Jordan Yates
2bdcf37f99 modem: cellular: fix dormant state control
According to the networking documentation:

> The network association status is represented with NET_IF_DORMANT flag

Therefore, the flag should be set at any time that the network is not
associated with. This is achieved by setting the flag at boot, and only
controlling the dormant state at entry/exit from the `REGISTERED` state.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-14 22:28:46 -04:00
Jordan Yates
77bb728be3 modem: cellular: rename DORMANT to AWAIT_PPP_DEAD
The name of this state is misleading as it is the same as the internal
Zephyr networking interface state of dormant. Rename the state to match
what it is doing, in the same way other states are named.

The misapplication of the interface `dormant` state by `AWAIT_PPP_DEAD`
is fixed later.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-14 22:28:46 -04:00
Jordan Yates
0a2ee3cb8e modem: cellular: rename CARRIER_ON to REGISTERED
The driver transitions to this state upon registering to the LTE
network, not upon the internal Zephyr concept of `carrier_on`.
`carrier_on` is an internal (and incorrect) consequence of transitioning
to the registered state, and should not be the basis of the name.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-14 22:28:46 -04:00
Guillaume Gautier
dfab44e51c drivers: dac: stm32: adapt dac driver for stm32 hal2
Adapt the DAC driver for STM32 HAL2.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-04-14 22:23:50 -04:00
Fin Maaß
8ee6844036 drivers: ethernet: call net_if_carrier_off first
net_if_carrier_off() should be called before
phy_link_callback_set(), as itside it, the carrier could be
already changed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-04-14 22:23:41 -04:00
Mathieu Choplain
b85fbd4c96 drivers: usb: udc: common: log requested endpoint configuration
In `ep_check_config()`, capabilities of the endpoint provided by the driver
are logged, but not the requested endpoint configuration. As a result, when
the function fails, it is not possible to determine why using only logs.

Add logging of the requested configuration in addition to the driver caps
to allow easily determining the cause of the failure (when logging is on).

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-04-14 22:23:28 -04:00
Kate Wang
a403230c5e drivers: video: Add format size estimation for PNG and NV12/NV21
- PNG is treated similarly to JPEG with a rough worst-case estimate.
- Treat NV12/NV21 formats specially rather than fall into the default
condition. These 2-planar YUV formats have a pitch equal to width and
a total size of pitch * height * 2 (Y plane + interleaved UV plane).

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
2026-04-14 22:23:18 -04:00
Robert Robinson
ea9c9bc12a drivers: sensor: nordic: Add sensor to monitor battery voltage
The need to monitor battery voltage on nordic devices and nRF7120
in particular is required among other metrics such as die temperature.
Creating a sensor to measure battery voltage allows to easily monitoring
of all required metrics in a consistent way.

This commit adds a new sensor driver to monitor battery.

Signed-off-by: Robert Robinson <robert.robinson@nordicsemi.no>
2026-04-14 22:22:51 -04:00
Camille BAUD
e7eae8d448 drivers: display Minor st7586s fixes
Implement post-merge review remarks:
- check return values correctly
- fix bad function naming
- fix binding no title
- use function instead of macro as is possible

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-04-14 22:22:31 -04:00
Guillaume Gautier
3beaaa7f92 drivers: usb: udc: stm32: adapt driver for stm32 hal2 and stm32c5
STM32 HAL2 brings many changes regarding structure, macro and function
names, so add a compatibility layer to keep the driver working for both
versions.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-04-14 22:22:14 -04:00
Carlo Caione
3186b4185d lora: native: sx126x: wake radio before aborting duty cycle
During RX duty cycle mode the SX126x keeps BUSY asserted even in
the sleep phase. The standby command cannot be sent because the HAL
waits for BUSY LOW first.

Fix by calling sx126x_hal_wakeup() before set_standby when
cancelling duty cycle reception. The wakeup function drives NSS low
directly (bypassing the BUSY check), which forces the radio out of
duty cycle and into STDBY_RC.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-14 22:22:05 -04:00
Carlo Caione
77739f54de lora: native: sx126x: flatten RX done handler and extract restart helper
Reduce nesting in sx126x_handle_irq_rx_done.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-14 22:22:05 -04:00
Carlo Caione
a43ef096c4 lora: native: sx126x: add RX duty cycle support
Implement the recv_duty_cycle API using the SX126x hardware
SetRxDutyCycle command. The radio autonomously alternates between
short RX windows and sleep, waking the MCU only on packet reception.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-14 22:22:05 -04:00
Fabin V Martin
9e94073c71 drivers: i2c: microchip: sercom g1: refactor code
Updates for code improvement.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2026-04-14 22:21:46 -04:00
Anand Kumar
dadf30044c drivers: serial: stm32: add UART IRQ sharing support
Add shared interrupt support for STM32 UART on SoC families where
multiple USART/LPUART peripherals share a single IRQ line (F0, G0,
L0, U0, C0).

Add a compile-time BUILD_ASSERT in the STM32 UART driver that detects
when two or more enabled UART instances share an IRQ and
CONFIG_SHARED_INTERRUPTS is not set.

Add configdefault SHARED_INTERRUPTS and SHARED_IRQ_MAX_NUM_CLIENTS
to the SoC Kconfig for STM32F0x, STM32L0x, STM32U0x, and STM32C0x.

Update DTS comments in the F0 family that previously stated shared
UART IRQs are unsupported.

The SHARED_IRQ_MAX_NUM_CLIENTS combinations in the F0x Kconfig were
generated with:

  from itertools import combinations
  usarts = ['usart3','usart4','usart5','usart6','usart7','usart8']
  for n in range(6, 2, -1):
      for combo in combinations(usarts, n):
          conds = ' && '.join(
              f'$(dt_nodelabel_enabled,{u})'
              for u in combo)
          print(f'\tdefault {n} if {conds}')

Fixes zephyrproject-rtos#39565

Signed-off-by: Anand Kumar <anandvtu16158@gmail.com>
2026-04-14 22:21:03 -04:00
Chun-Chieh Li
090564c80a drivers: sdhc: numaker: support NuMaker M55M1X SDHC
Add support for Nuvoton NuMaker M55M1X SD host controller

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-04-14 22:16:29 -04:00
Chun-Chieh Li
898295cd79 drivers: clock_control: numaker: support SDH
Add clock support for SDH for Nuvoton NuMaker SoC

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-04-14 22:16:29 -04:00
Jari Tervonen
021da3bf43 drivers: debug: Make ETR optional
Exclude ETR register writes when ETR mode is not used.

Signed-off-by: Jari Tervonen <jari.tervonen@nordicsemi.no>
2026-04-14 22:16:15 -04:00
Raffael Rostagno
5e5f18b5bf drivers: spim: esp32: Add PM support
Add PM support to ESP32 SPIM driver.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-04-14 22:15:02 -04:00
Lukas Gehreke
1e40470be9 drivers: modem: sim7080: Added tls and dtls support
Added tls and dtls support for the sim7080 modem driver.

Signed-off-by: Lukas Gehreke <lk.gehreke@gmail.com>
2026-04-14 22:14:44 -04:00
Yuzhuo Liu
f368878072 drivers: i2c: add Realtek Bee series driver
Add I2C driver support for Realtek Bee series SoCs,
including RTL87x2G and RTL8752H.

This driver supports:
- Master mode operation
- 7-bit and 10-bit addressing
- Standard and Fast mode speeds

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-04-14 22:14:35 -04:00
Ankitkumar Modi
1d574789af drivers: display: st7796s: Add tear scanline configuration support
Add support for configuring the Set Tear ScanLine (STE) command in the
ST7796S LCD display driver. This allows users to specify the exact
scanline where the Tearing Effect (TE) signal becomes active, providing
better control over display synchronization.

Changes:
- Add ST7796S_CMD_STE (0x44) command definition
- Add tear-scanline property to device tree binding
- Add tear_scanline field to driver configuration structure
- Implement STE command configuration in LCD initialization

The tear scanline can now be configured via device tree:
  tear-scanline = <240>; // TE signal at scanline 240

Signed-off-by: Ankitkumar Modi <ankit.modi912@gmail.com>
2026-04-14 22:14:14 -04:00
Davide Di Lello
d67fcbab8b drivers: comparator: Infineon LPCOMP Driver
Adds LPCOMP driver files to support LPCOMP
for the PSOC C3 family of MCUs.

Signed-off-by: Davide Di Lello <Davide.Dilello@Infineon.com>
2026-04-14 22:08:41 -04:00
Muhammad Waleed Badar
0d158a626b drivers: usb: dwc2: refactor to use MMIO macros
The DWC2 USB driver was accessing hardware registers
through a raw dev->config->base pointer, which breaks on
MMU-enabled platforms where physical addresses need to be
mapped to virtual ones before use.

Use Zephyr's standard MMIO abstraction API by introducing
DEVICE_MMIO_NAMED_RAM/ROM(core) in the driver's data and
config structs, mapping the region at initialization time
with DEVICE_MMIO_NAMED_MAP, and routing all register accesses
through a dwc2_get_base() helper that calls DEVICE_MMIO_NAMED_GET.
These changes allows the driver to be useful on MMU-based
platforms like Broadcom BCM2711 SoC.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-04-14 22:08:02 -04:00
Om Srivastava
952d2c5509 wifi: esp_at: validate IPv4 family before sin_addr access
Coverity reported a potential out-of-bounds access in
drivers/wifi/esp_at/esp_offload.c when accessing sin_addr
without validating the sockaddr family.

ESP-AT offload supports IPv4 only, so add an explicit
NET_AF_INET check before dereferencing the IPv4-specific
structure to prevent invalid memory access.

Fixes: #100001

Signed-off-by: Om Srivastava <srivastavaom97714@gmail.com>
2026-04-14 22:07:49 -04:00
Bjarki Arge Andreasen
e4d61fc472 drivers: spi: nrf_spim: refactor to use common code with rtio impl
Refactor the nrf_spim device driver to share the common code between
the nrf_spim_rtio implementation.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-04-14 22:07:40 -04:00
Bjarki Arge Andreasen
6f2829ea0c drivers: spi: rtio: introduce nrfx spim rtio
Introduce support for NRF SPIM device based on RTIO.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-04-14 22:07:40 -04:00
Bjarki Arge Andreasen
d99b89ff96 drivers: spi: rtio: move private spi/rtio.h to drivers/spi/spi_rtio.h
Move the private spi_rtio.h header from the public path

 include/zephyr/drivers/spi/rtio.h

the the private path

  drivers/spi/spi_rtio.h

and update drivers to include it using a relative path.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-04-14 22:07:40 -04:00
Bjarki Arge Andreasen
5085a29ae0 spi: rtio: don't support SPI_LOCK_ON
The SPI_LOCK_ON flag is not compatible with RTIO, nor is the
related spi_release API. Introduce stub implementation for drivers to
use which simply returns -ENOTSUP and validate SPI_LOCK_ON within the
spi_rtio_transceive wrappers.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-04-14 22:07:40 -04:00
Bjarki Arge Andreasen
f37a79fd5a spi: rtio: introduce spi_rtio_transceive_cb wrapper
Introduce spi_rtio_transceive_cb which is an implementation of the
spi_transceive_cb API based on the spi_rtio context.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-04-14 22:07:40 -04:00