Commit graph zephyr/drivers
Author SHA1 Message Date
Tristan Honscheid
0b048a1970 drivers: espi: rts5912: API for saving/restoring internal driver state
Some of the RTS5912 ESPI driver's state is tracked in software and
cannot be deduced from hardware registers. When this driver is
used in multi-image (e.g. A/B, RO/RW) firmware products that jump
between images without a full hardware reset, the cache state is
wiped and no longer reflects the hardware state.

This commit adds an optional pair of driver-specific functions that
can be called to export state data to be preserved ahead of soft-reboots
and then restore it. It is the caller's responsibility to retain the
state data somewhere safe in the meantime (e.g. BBRAM, NVRAM, etc)

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2026-07-16 14:36:12 +02:00
Gang Li
934ad152f3 drivers: bluetooth: hci: add BSP wakeup support for NXP BT coex scenario
In Wi-Fi + BT coex scenario on NXP hosted wireless SoCs (IW612/IW416/
IW610), once Wi-Fi CPU loads valid firmware, it puts BT CPU into sleep
via Boot-Sleep-Patch (BSP). The BT bootloader stops sending HDR
signature bytes, blocking BT firmware download.

Add BSP wakeup detection and trigger mechanism:
- Introduce fw_upload_read_data_tmo() to support custom timeout for
  UART read, refactoring fw_upload_read_data() as a wrapper.
- Add fw_upload_wake_bt_from_bootsleep() which polls for HDR signature
  bytes with a configurable interval. Absence of signature within the
  polling window indicates BT CPU has entered BSP sleep.
- Send an RTS low pulse to wake BT CPU before FW download begins.

New Kconfig options:
- BT_NXP_CTRL_BSP_TRIGGER: enable/disable BSP wakeup feature
- BT_NXP_CTRL_HDR_SIG_INTERVAL: single poll timeout (default 505ms)
- BT_NXP_CTRL_BSP_WAIT_TIMEOUT: max total wait time (default 10s)
- BT_NXP_CTRL_BSP_RTS_PULSE_MS: RTS pulse duration (default 10ms)

Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
Signed-off-by: Gang Li <gang.li_1@nxp.com>
2026-07-16 14:34:09 +02:00
Daniel DeGrasse
baf2260f63 drivers: flash: add flash driver for pflash with intel command set
Add a basic flash driver for intel pflash. This flash implements a CFI
interface, and is available as "pflash" within QEMU targets.

Assisted-by: Claude:Haiku 4.5
Signed-off-by: Daniel DeGrasse <daniel.degrasse@analog.com>
2026-07-16 14:33:34 +02:00
Wojciech Sipak
5949aa3241 drivers: timer: cmsdk_apb_timer: drop unused MAX_TICKS
After recent modifications to the timeout calculation in cmsdk_apb_timer,
MAX_TICKS define is no longer used. This commit removes it.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2026-07-16 14:32:42 +02:00
Anas Nashif
9416429ab2 drivers: eth: w6100: reject header <= 2 before length subtraction
Same underflow as eth_w5500: a device-supplied header of 0-2 wraps
rx_len to a huge value. Reject before subtracting.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-16 14:29:09 +02:00
Anas Nashif
b7c7ec3259 drivers: eth: enc28j60: reject short RSV frame length before subtraction
frm_len = sys_get_le16(info) - 4 underflows to ~65532 when the
status-vector length is <= 4, causing enc28j60_read_packet to allocate
and copy ~64 KB. Reject the frame when the length is too small to hold
the CRC.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-16 14:29:09 +02:00
Anas Nashif
2fcee0dbff drivers: eth: adin2111: bound RX fsize against DMA buffer size
The FSIZE register is 32-bit and was used directly as the SPI burst-read
length into ctx->buf (sized CONFIG_ETH_ADIN2111_BUFFER_SIZE). A large
device-reported value could overflow the buffer.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-16 14:29:09 +02:00
Anas Nashif
7c4ea9a9d5 drivers: eth: w5500: reject header <= 2 before length subtraction
The header value read from the chip was used as-is in:
  rx_len = sys_get_be16(header) - 2
A value of 0, 1, or 2 underflows the uint16_t, causing an extremely
large allocation followed by a NULL fragment dereference.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-16 14:29:09 +02:00
Iustin Stolniceanu
a36b2dd27b drivers: sensor: adi: add adis1647x IMU driver
Add driver for the ADIS16477 6-axis IMU sensor family.
Supports polling, trigger (DRDY interrupt), RTIO async, and
streaming modes. Includes SPI bus access, burst read, decoder,
temperature and inertial data channels, decimation rate
configuration via devicetree, hardware reset, and diagnostic
status checking.

Signed-off-by: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
2026-07-16 14:26:59 +02:00
Flavio Ceolin
45df54dc63 w1: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
791069f814 spi: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
b7989d78a3 serial: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
6d63fac9b9 sensor: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
d2d9b9c52b led: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
88656bbc74 ipm: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
26310176bc i3c: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
c0f9b066a8 i2s: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
58c4e48622 flash: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
1b1a7d7495 entropy: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
a652fde0c1 eeprom: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
748faac151 dac: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
4aadff76e5 counter: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
d79c845634 adc: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
6fda61fb82 i2s: Remove redundant casts in syscall handlers
The syscall handler functions forward parameters with identical casts
that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
7f62d7bfe5 i2c: Remove redundant casts in syscall handlers
The z_vrfy_* functions forward parameters to the corresponding
implementation with identical casts that are redundant since the
variables already have those types.  Drop the casts to let the compiler
type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Flavio Ceolin
2fe92ea969 pwm: Remove redundant casts in syscall handlers
The z_vrfy_* functions forward parameters to the corresponding z_impl_*
with identical casts — (const struct device *)dev and (uint64_t *)cycles
— that are redundant since the variables already have those types.  Drop
the casts to let the compiler type-check the arguments unobstructed.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Sylvio Alves
ec5ad8d166 drivers: input: esp32 touch: fix unused variable warnings
Scope channel_cfg, num_channels and dev_cfg to the touch
sensor version branches that use them.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-07-15 19:03:50 -04:00
Mathieu Choplain
b3fa989bbb include: drivers: misc: stm32_wkup_pins: make the API private
This API was never intended to be "public" in the sense now documented
in the Glossary, as said in 559c72d7a6:
  "Introduce public functions for GPIO pins configuration [...]  in
   stm32 drivers & routines such gpio_stm32 & poweroff."

Remove the header from the public API directory and move the definitions
to a private header in SoC-specific includes. Update all previous users
of the header (which are as expected only those documented in the commit
message quoted above: gpio_stm32 and SoC poweroff.c).

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-15 19:03:02 -04:00
Satya Sri
cf7886b903 drivers: counter: Add TTC (Triple Timer Counter) driver
The TTC provides three independent hardware counters supporting
free-running and interval modes, accessed via MMIO registers.

This driver implements the Zephyr counter API, including start/stop,
read, alarm, and top value configuration. Alarm events are delivered
using match interrupts.

Dynamic IRQ connection is used to support platforms where multiple
TTC counter instances share the same interrupt line. Each IRQ is
registered only once at runtime, and the ISR dispatches pending
events to all TTC instances mapped to that interrupt, ensuring correct
handling for both shared and dedicated interrupt configurations.

Signed-off-by: Satya Sri <satyasri.katru@amd.com>
2026-07-15 19:01:27 -04:00
Vignesh Pandian
00d9a0da6f drivers: sensor: bmi270: add die temperature channel support
The BMI270 exposes an on-chip temperature sensor in registers
TEMPERATURE_0/1 (0x22/0x23). Add support for SENSOR_CHAN_DIE_TEMP so
applications can read it through the standard sensor API.

bmi270_init() now sets PWR_CTRL.temp_en, bmi270_sample_fetch() reads
the 16-bit value, and bmi270_channel_get() converts it using the
datasheet formula T = raw / 512 + 23 degrees C, returned in micro-
degrees through val1/val2.

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
2026-07-15 14:49:48 -05:00
Abderrahmane JARMOUNI
7cca4bda59 drivers: flash: stm32: rename STM32_MEMMAP to FLASH_STM32_NOR_MEMMAP
Rename CONFIG_STM32_MEMMAP to CONFIG_FLASH_STM32_NOR_MEMMAP for clarity
since it only concerns STM32 Flash drivers.
Same change is applied on MCUboot side upstream.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2026-07-15 14:45:00 -05:00
Brett Peterson
431a3afd25 drivers: audio: tlv320dac310x: speaker output support
Adding a binding property to enable speaker output and updating the
driver to support driving the speaker in addition to the headphone
outputs.

Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
2026-07-15 13:44:41 -05:00
Brett Peterson
9b61e3f45b drivers: audio: tlv320dac310x fixing comment
Fixing a typo in the comments.

Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
2026-07-15 13:44:41 -05:00
Tejus Subramanya
673d046e46 drivers: wifi: siwx91x: fix advanced scan dwell time handling
Advanced scan ignored the configured dwell times because the
driver only updated local variables instead of the advanced scan
configuration structure. Set the active and passive channel times
on the advanced scan config directly.

Signed-off-by: Tejus Subramanya <ters@silabs.com>
2026-07-15 15:28:57 +02:00
Mathieu Choplain
6fe6ba9f4c drivers: usb: udc: stm32: enable GPIO if disconnect/reset GPIOs are used
Enable the GPIO subsystem when the driver is enabled if disconnect-gpios
are provided on a node with compatible `st,stm32-usb` or if an ULPI PHY
provides reset-gpios.

The second case should be handled at a generic level, but ULPI PHYs have
always been managed as part of the STM32 driver for historical reasons.
Since no SoC family other than STM32 seems to use ULPI PHYs, this code
remains vendor-specific for now.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-15 15:26:33 +02:00
Mathieu Choplain
0bec25a536 drivers: sdhc: stm32: enable GPIO if card-detect or power GPIOs are used
Enable the GPIO subsystem when cd-gpios or pwr-gpios are used on
any STM32 SDMMC node and the corresponding driver is enabled.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-15 15:26:33 +02:00
Mathieu Choplain
80675bebfe drivers: mspi: stm32: enable GPIO when ce-gpios are used
Enable the GPIO subsystem when ce-gpios are used on any STM32 QSPI,
OSPI or XSPI node configured as MSPI controller  and the corresponding
driver is enabled.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-15 15:26:33 +02:00
Mathieu Choplain
1c0a0d799a drivers: mipi_dbi: stm32: enable GPIO if reset or power GPIOs are used
Enable the GPIO subsystem when reset-gpios or power-gpios are used on
any STM32 FMC node configured for usage as MIPI DBI host controller
and the corresponding driver is enabled.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-15 15:26:33 +02:00
Mathieu Choplain
1f1e182ce0 drivers: flash: stm32_*: enable GPIO when reset-gpios are used
Enable the GPIO subsystem when reset-gpios are used on any STM32 QSPI,
OSPI or XSPI flash node and the corresponding driver is enabled.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-15 15:26:33 +02:00
Muhammad Waleed Badar
528a0627ed drivers: usb: uhc_dwc2: introduce MMIO API for MMU platforms
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 uhc_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-07-15 15:25:42 +02:00
Samuel Slesar
5b4231a82d drivers: counter: mcux_qtmr: support fixed-clock providers
Allow the MCUX QTMR counter driver to use clock providers without a
named clock cell, such as fixed-clock.

Existing users with named clock cells keep the previous behavior.

Also use the filter-period devicetree property when configuring the
QTMR fault filter period.

Signed-off-by: Samuel Slesar <samuel.slesar@nxp.com>
2026-07-15 15:22:26 +02:00
Srikanth Patchava
2cb9c70081 drivers: fpga: fix sprintf misuse in mpfs driver
Fix two issues in fpga_mpfs.c:

1. Remove invalid (uint8_t *) cast on format string literal.
   sprintf() expects const char*, not uint8_t*. The cast suppresses
   the implicit-function-declaration warning but is semantically wrong
   and produces -Wint-conversion warnings on strict compilers.

2. Replace sprintf() with snprintf() to prevent potential buffer
   overflow. The FPGA_design_ver buffer is 30 bytes and the formatted
   string "Design Version : 0x%x" can reach 29 characters with a
   full 32-bit value (0xffffffff), leaving no margin.

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
2026-07-15 15:21:52 +02:00
minyuan xue
4a5df6d9cc drivers: adc: add ameba adc driver
Add realtek ameba adc driver.

Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>
2026-07-15 15:20:27 +02:00
Hasler Pauline
b08eeb0c6d drivers: adc: Add support for ADC ADS1220
Implement a driver for the ADC ADS1220.
Currently only the single shot mode is supported.
Origin: Original

Signed-off-by: Hasler Pauline <phasler@baumer.com>
2026-07-15 15:19:44 +02:00
Fin Maaß
fbeefb4185 drivers: usb: uhc: use driver api
use driver api. with this we can find out
what device is a usb host controller.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-15 10:50:44 +02:00
Vedant Malkar
63c8890b6b drivers: serial: add Shakti UART driver
Add a UART driver for SHAKTI Ganga SoC,
supports polling and interrupt driven
operations

Signed-off-by: Vedant Malkar <vedantitsme@gmail.com>
2026-07-15 10:44:27 +02:00
Nicholas Cadieux
9130b46b34 drivers: usb_c: tcpc: stm32: discard rx buffer for undelivered msgs
The RX buffer was cleared only when a message was consumed by
ucpd_get_rx_pending_msg(). Receptions not passed to the TCPM layer
(GoodCRC, filtered SOP'/SOP'', BIST or an errored message) left
stale order-set and header bytes behind, which the next poll of
ucpd_get_rx_pending_msg() reported as a pending message.

Discard the buffer at the end of the RXMSGEND handler whenever
UCPD_EVT_RX_MSG was not set, so only delivered messages remain
readable.

Signed-off-by: Nicholas Cadieux <ncadieux@qti.qualcomm.com>
2026-07-15 10:42:17 +02:00
Anas Nashif
5b85e9d41b arch: fix stale comments in arch-related headers and gicv3
Three comment-only fixes found while auditing the arch interface:

- include/zephyr/arch/common/addr_types.h still carried the 'x86
  address types' banner from before it was generalized into the
  common arch headers.
- include/zephyr/arch/exception.h documented its callback typedefs
  as exception_dump_hook_t and exception_drain_hook_t while the
  actual typedef names are arch_exception_dump_hook_t and
  arch_exception_drain_hook_t.
- intc_gicv3.c referenced z_arch_el3_plat_init, which does not
  exist; the platform hook is named z_arm64_el3_plat_init.

No functional change.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-14 20:08:55 -04:00
Michael Zimmermann
e256db718d drivers: flash: gecko: support CONFIG_MULTITHREADING=n
This is useful to reduce the size of mcuboot builds, so it can fit into the
16K bootloader flash area outside of the main flash, which many Silabs SoCs
have.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2026-07-14 20:08:08 -04:00
Florian Moesch
e5c5be31b6 drivers: display: st7567: fix set_contrast to accept 0-255 range
The set_contrast function of the ST7567 display driver now expects a
contrast value in the range 0-255, instead of 0-63.
The driver now scales the value to the 6-bit range expected by the
controller.
CONFIG_ST7567_DEFAULT_CONTRAST has been updated.

Signed-off-by: Florian Moesch <florian.moesch@draeger.com>
2026-07-14 20:06:45 -04:00