Commit graph zephyr/drivers
Author SHA1 Message Date
Johan Hedberg
caf9a9c174 Bluetooth: hci_silabs_siwx91x: Configure RF power from open()
Send the vendor-specific RF power mode command from within open(),
through the HCI lockstep helper and the driver's own send path, instead
of implementing the setup() driver API op on top of the Host's
bt_hci_cmd_send_sync(). The response is consumed in the driver's
receive callback by feeding received packets to the lockstep helper
before delivering them to the host.

The driver no longer calls any Host command API, so the configuration
now also runs in controller-only builds, and it no longer selects
BT_HCI_SETUP. A failing or unanswered command fails open() with an
error instead of failing the Host's HCI initialization later, and is
logged by the helper.

The raw send path is factored out of send() and takes the device, so
that it serves both the send() op and the helper. The helper is
initialized once, from the device init function, so that reopening the
transport does not re-initialize its semaphore.

Tested on siwx917_rb4338a with the peripheral_hr sample.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-09-18 11:15:45 +01:00
Muhammad Waleed Badar
2d5a055fb8 drivers: display: intel_multibootfb: use common framebuffer helpers
Use the common framebuffer configuration and data structures to
simplify the Intel multiboot framebuffer driver and replace the
driver-specific read and write implementations with the common
framebuffer helpers.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:14:39 +01:00
Muhammad Waleed Badar
fcfc799d11 drivers: display: qemu_ramfb: use common framebuffer helpers
Use the common framebuffer configuration and data structures to
simplify the QEMU ramfb driver and replace the driver-specific read
and write implementations with the common framebuffer helpers.

Update the ramfb devicetree binding to use simple-framebuffer.yaml
and rename the fwcfg property to firmware.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:14:39 +01:00
Muhammad Waleed Badar
e242dcfea4 drivers: display: rpi_bcm2711_fb: use common framebuffer helpers
Use the common framebuffer configuration and data structures to
simplify the Raspberry Pi BCM2711 framebuffer driver and replace
the driver-specific read and write implementations with the common
framebuffer helpers.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:14:39 +01:00
Muhammad Waleed Badar
ca95d40853 drivers: display: add common framebuffer read/write helpers
Add a shared display_framebuffer library providing generic
read/write implementations for framebuffer-backed display
drivers (config/data structs, DT helper macros, and
display_framebuffer_read()/write()).

Add CONFIG_DISPLAY_FRAMEBUFFER to gate the new source file.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:14:39 +01:00
Benjamin Cabé
4deb62cf19 drivers: sensor: lsm9ds0_mfd: fix magnetometer runtime ODR mapping
The runtime magnetometer ODR table started with a bogus 0 Hz entry
copied from the accelerometer table, shifting every M_ODR code by one
so each requested rate programmed the next one up, and 100 Hz wrote a
reserved code. Drop the leading entry so the array index matches the
CTRL_REG5_XM M_ODR encoding used by LSM9DS0_MFD_MAGN_DEFAULT_M_ODR.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-18 11:14:30 +01:00
Benjamin Cabé
6a44ab3089 drivers: sensor: lsm9ds0_mfd: convert DIE_TEMP to degrees Celsius
SENSOR_CHAN_DIE_TEMP returned the raw OUT_TEMP_[LH]_XM count directly
as val1, so a die a few degrees above the reference was reported as
hundreds of degrees. Scale the 12-bit right-justified two's complement
sample by its 8 LSB/degC sensitivity and apply the ~25 degC reference
offset, re-normalising the sign from bit 11.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-18 11:14:30 +01:00
Vladyslav Goncharuk
80f24c58f1 sys: add boot FDT handling
Add a small OS helper for validating and copying a boot firmware device
tree blob into caller-owned storage.

The helper checks the FDT magic and total-size fields, verifies that
the caller-provided destination is large enough, copies the blob, and
returns 0 or a negative errno value. It does not own the destination
buffer or make policy decisions about which firmware argument contains
an FDT.

Add optional Xen support for preserving the boot device tree blob from
the first firmware argument when running on xenvm. The Xen driver code
owns the storage and policy, then exposes the copied data through
xen_fdt_get().

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Assisted-by: Codex:gpt-5
2026-09-18 11:14:23 +01:00
Martin Hoff
1b928aeca6 soc: silabs: enable new clock managers
This commit enables the new clock managers by switching the device
tree to use the new bindings. It also moves some initialization code
from the old clock manager to soc_early_init_hook() since some clocks
configuration needs to be done before the clock drivers are initialized.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-09-18 11:14:08 +01:00
Martin Hoff
ddd51dbdab drivers: clock_control: add SiWx91x HP/ULP/AON clocks managers
Introduce dedicated clock-control drivers for HP, ULP and AON domains
plus the shared helper API used by consumers, and refresh helper
documentation to match the current DT wiring and ownership model.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-09-18 11:14:08 +01:00
Martin Hoff
52bd30c9d3 dts: bindings: clock: Update SiWx91x clock IDs
Rename and extend SiWx91x clock IDs, then update the existing legacy
clock manager and current siwg917 DTS users to the new names.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-09-18 11:14:08 +01:00
Zhaoxiang Jin
e26865e3d7 drivers: serial: uart_mcux_lpuart: handle PM_DEVICE_ACTION_TURN_OFF
The driver rejects PM_DEVICE_ACTION_TURN_OFF with -ENOTSUP, so a power
domain cannot tell it that the supply is about to go away. Accept the
action instead. There is nothing to save: TURN_ON already rebuilds the
whole register bank from data->uart_config, and SUSPEND has stashed the
interrupt mask in data->pm_saved_int, so re-reading the mask here would
only record the zero SUSPEND left behind.

This matters on SoCs where a low-power state collapses the LPUART power
domain. Baud rate, format and enables are all lost, and without a TURN_OFF
the domain never gets to re-run TURN_ON: the first write after the window
stalls on a transmitter that is no longer clocked, or bus-faults on the
block.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-09-18 11:14:01 +01:00
Zhaoxiang Jin
be7458140d mfd: nxp: lp-flexcomm: handle PM_DEVICE_ACTION_TURN_OFF
The wrapper rejects PM_DEVICE_ACTION_TURN_OFF with -ENOTSUP, so a power
domain cannot tell it that the supply is about to go away. Accept the
action instead. There is nothing to save: both the reset line and
PSELID[PERSEL] are recomputed from the devicetree in TURN_ON, which the
power domain re-runs once the supply is back.

This matters on SoCs where a low-power state collapses the LP_FLEXCOMM
power domain. PSELID[PERSEL] clears, no communications function is
selected, and per the reference manual the selected module's
register-interface clock is then internally gated, so the next access to
a child (LPUART/LPSPI/LPI2C) register bus-faults. Re-running TURN_ON is
what puts the wrapper back.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-09-18 11:14:01 +01:00
Muhammad Waleed Badar
801d7accf0 drivers: usb: uhc_dwc2: increase uhc dwc2 stack size
Increase stack size of uhc dwc2 driver to accommodate
64-bit platforms

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:13:40 +01:00
Muhammad Waleed Badar
5703059fb2 drivers: usb: uhc_dwc2: add bcm2835 vendor quirks
Add a BCM2835-specific vendor quirk that acquires the VideoCore
power domain through the runtime PM API in pre_enable, disable
and shutdown, and translate physical addresses to the DMA bus
address space using dma_addr_xlate hook.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:13:40 +01:00
Muhammad Waleed Badar
2ad33408eb drivers: usb: uhc_dwc2: add DMA address translation quirk hook
Add uhc_dwc2_quirk_dma_addr_translation() call before each HCDMA write
(control setup/data, bulk) to allow platform-specific translation
of CPU-side buffer addresses into bus/DMA addresses (e.g. BCM2711
VC AXI +0xC0000000 offset) prior to being written into HCDMA.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:13:40 +01:00
Muhammad Waleed Badar
e8ac911d61 drivers: usb: uhc_dwc2: use mem_addr_t for DMA addresses
Use mem_addr_t for DMA buffer addresses in control and bulk
transfers instead of uint8_t *.

Cast the buffer pointers to mem_addr_t when assigning the DMA
address.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-18 11:13:40 +01:00
Kate Wang
31ddee5548 drivers: video: Add NXP PNG decoder driver
Add support for NXP PNG decoder hardware module. This driver provides
memory-to-memory (M2M) video transformation capability to decode PNG
compressed images into raw pixel formats.

Key features:
- Supports PNG input format (VIDEO_PIX_FMT_PNG)
- Resolution support: 1x1 to 1024x65535 pixels (1-pixel step)
- Fixed RGBA32 output format (VIDEO_PIX_FMT_RGBA32)
- Interrupt-driven operation with input/output buffer queues
- 8-byte buffer alignment requirement

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
2026-09-18 11:13:31 +01:00
Hariharan Arumugam
612afeafbe drivers: pinctrl: microchip: update pinctrl driver for PIC32CK SG family
Updated pinctrl driver to support the PIC32CK SG family devices

Signed-off-by: Hariharan Arumugam <hariharan.arumugam@microchip.com>
2026-09-18 11:13:24 +01:00
Christoph Seitz
5e3c1a7b3c drivers: serial: add Infineon AURIX ASCLIN UART driver
Add UART driver for the ASCLIN module found on TC3x and TC4x.
Supports polling mode with configurable baudrate via the ASCLIN
fractional divider. Uses a private register header to handle
TXDATA/RXDATA layout differences between TC3x and TC4x.

Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2026-09-18 11:13:16 +01:00
Christoph Seitz
ceedce1b41 drivers: interrupt_controller: add Infineon AURIX interrupt router
Add driver for the AURIX Service Request Router (IR) which maps
peripheral service requests to CPU interrupt priorities. The IR
handles priority-based dispatch and is shared across TC3x and TC4x.

Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2026-09-18 11:13:16 +01:00
Christoph Seitz
a8d37b47ef drivers: timer: add Infineon AURIX STM system timer driver
Add system timer drivers using the STM (System Timer Module)
on TC3x and TC4x. The STM provides the kernel tick source for
scheduling and timeouts.

Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2026-09-18 11:13:16 +01:00
Conor Paxton
c605a9da50 drivers: serial: ns16550: handle no priority cell, interrupt specifier
The ns16550 driver unconditionally references DT_INST_IRQ(n, priority)
when registering the interrupt handler. This fails to compile when the
DT Nodes interrupt controller uses a single-cell specifier with no
priority cell (e.g., riscv,cpu-intc with #interrupt-cells = <1>).

Add a UART_NS16550_IRQ_PRIORITY helper macro that checks for the
priority cell existence using DT_INST_IRQ_HAS_CELL and falls back to 0
when it is absent, matching the existing pattern used by
UART_NS16550_IRQ_FLAGS for the optional flags cell.

Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
2026-09-17 16:46:06 -07:00
Harini G
700ee15451 drivers: pwm: align Kconfig prompts with style guide
Reword PWM driver Kconfig prompts to follow the style guide
from #95132, using the "{Driver Name} PWM driver" format,
following the same pattern as the merged reset (#115694)
and dac (#116400) PRs.
Also fixes a copy-paste bug in Kconfig.xmc4xxx_ccu8,
which incorrectly referenced CCU4 instead of CCU8 in its prompt text.
Part of #7272.

Signed-off-by: Harini G <harinig1818@gmail.com>
2026-09-17 16:44:01 -07:00
Sylvio Alves
f812121f47 drivers: usb: uhc: dwc2: size the fifos for the port speed
The FIFO sizes were derived from full speed packet sizes regardless of
the speed the port came up at. On a high speed port a 512 byte bulk
OUT did not fit the non-periodic TX FIFO, so the channel halted with
only CHHLTD set and no status bit, which the OUT handler did not act
on: the transfer never completed and the caller timed out. The shared
RX FIFO was sized from a 256 byte packet and cannot absorb
back-to-back 512 byte IN packets, which overruns under a sustained
stream and reports transaction errors the driver does not recover
from.

Derive both the TX and the RX sizes from the speed the port reports,
and fail a transfer whose channel halts without a reason instead of
leaving the caller waiting.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-17 16:41:36 -07:00
Sylvio Alves
2809d2de67 drivers: usb: uhc: dwc2: maintain cache around bulk dma buffers
Bulk transfers programmed HCDMA without any cache maintenance, so on
SoCs with a data cache the controller sent stale OUT payloads and the
CPU read stale IN data. A mass storage command block wrapper written
by the CPU never reached the device, which answered with a STALL.

Flush OUT payloads before starting the transfer and invalidate the IN
buffer both before the transfer and before the received data is
consumed.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-17 16:41:36 -07:00
Sylvio Alves
69aa58b4e7 drivers: usb: uhc: dwc2: maintain cache around host dma buffers
The host driver programs HCDMA with buffers that live in cached
memory and never synchronised them, so on SoCs with a data cache the
controller read stale setup packets and the CPU read stale IN data.
On ESP32-P4 this surfaced as a spurious STALL on the first
GET_DESCRIPTOR, because the descriptor bytes fetched by DMA were
never visible to the CPU.

Flush the setup packet and OUT payloads before starting a transfer
and invalidate IN buffers before the data is consumed.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-17 16:41:36 -07:00
Sylvio Alves
07665fd818 drivers: usb: uhc: add esp32p4 usb otg hs host quirk
Add the UHC vendor quirk for the ESP32-P4 USB-OTG 2.0 controller so
the DWC2 host driver can drive the high speed port. The quirk enables
the peripheral clock, brings up the UTMI PHY and connects the D+/D-
pulldown resistors required in host mode.

The PHY is initialised from pre_init because the HAL init resets the
PHY, which must not happen once the host port is powered.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-17 16:41:36 -07:00
Benjamin Perseghetti
5634a7d9bb drivers: sensor: paa3905: enforce SPI mode 3 and the clock limit
The chip communicates in SPI mode 3 with a maximum clock of 2 MHz
(PAA3905E1-Q datasheet, section 6.0). The bus configuration left the
clock polarity and phase at mode 0, where every register read returns
the value shifted right by one bit: the product ID 0xA2 reads back as
0x51 and probing fails unless the devicetree node happens to set
spi-cpol and spi-cpha. Set both mode bits in the driver and assert the
clock limit at build time, so correct operation does not depend on
per-board devicetree flags and an out-of-spec node fails the build
instead of running the bus out of contract.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2026-09-17 13:07:31 -07:00
Luis Ubieda
1ceb90e159 drivers: sensor: paa3905: lower the no-motion report to debug level
A stationary sensor reports no motion for every sample, so at the
12.6 Hz streaming rate the warning floods the console with a condition
that is expected rather than exceptional.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2026-09-17 13:07:31 -07:00
Benjamin Perseghetti
a0e0a7fba9 drivers: sensor: paa3905: re-apply the configured LED state while streaming
The chip rewrites the LED control register on its own when its
automatic mode switching runs, so the state written during
configuration does not persist: a device configured with the LED
disabled ends up strobing again a few seconds after init. Extract the
LED control sequence into paa3905_apply_led_config() and re-apply it
from the stream path roughly once a second, so the devicetree
configured state is authoritative across mode switches.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2026-09-17 13:07:31 -07:00
Kamil Krzyżanowski
961591d3c0 drivers: serial: stm32: don't release the PM lock twice on TC
Commit a93e31f280 ("drivers: uart: stm32: don't read TC interrupt flag
multiple times") introduced a regression.

When building with both `PM` and `UART_ASYNC_API` enabled, using
`poll_out` on a UART causes the PM lock to be released twice after being
acquired a single time.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
2026-09-17 13:06:54 -07:00
Zayne Stites
ffb8b9c9a4 drivers: rtc: rtc_infineon: fix ifx_cat1_rtc_init return type
Return an int per the prototype, not a cy_rslt_t.  Both technically
work since callers will be checking for a non-zero return meaning
failure, but it's inconsistent

Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5.0
2026-09-17 13:06:12 -07:00
Zayne Stites
02533a5c05 drivers: rtc: rtc_infineon: Adding alarm support
Adding alarm support to the Infineon RTC implementation

Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
2026-09-17 13:06:12 -07:00
Zayne Stites
09622d8177 drivers: rtc: rtc_infineon: Remove prefix underscores from naming scheme
Most of the variables, macros, and functions were prefixed with
an underscore.  Removed these to match the standard Zephyr naming
scheme

Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5.0
2026-09-17 13:06:12 -07:00
Michał Stasiak
20b39896be drivers: clock_control_nrf: integrate nrfx_clock_lfrc
LFRC calibartion has been moved to separate nrfx driver.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2026-09-17 16:30:43 +01:00
Alejandro Sánchez
a5ceb2eff8 drivers: pcie: fix PTM register access
PCIe configuration-space helpers use DWORD indices, but the PTM code
added byte offsets directly to the extended capability base. This made
it access the wrong Capability and Control registers.

Replace compiler-dependent register bitfields with explicit masks,
including the granularity fields, and convert PTM register offsets to
DWORD indices. Update PTM Control with read-modify-write so unrelated
control bits are preserved.

Assisted-by: ChatGPT:GPT-5.6 Sol
Signed-off-by: Alejandro Sánchez <alesangreat@gmail.com>
2026-09-17 07:51:20 -07:00
Nhut Nguyen
4cf010b96c drivers: display: ed2208: Fix format warning
%zu should only used for argument of size_t type, but the buf_size is of
uint32_t type. Casting to size_t is required. Otherwise, a warning will
occur with compiler of 64-bit platforms.

    drivers/display/display_ed2208_gca.c:238:25: error: format
    '%zu' expects argument of type 'size_t', but argument 3 has
    type 'uint32_t' {aka 'unsigned int'} [-Werror=format=]

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-09-17 07:50:50 -07:00
Nhut Nguyen
8a0f56842e drivers: display: Fix format warning for several drivers
Use %zu for size_t to avoid build warning of 64-bit platforms.

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-09-17 07:50:50 -07:00
Nhut Nguyen
39c1118a69 drivers: display: Add support for ili9881c_dsi driver
Add support for ILI9881c display controller

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
2026-09-17 07:50:50 -07:00
Nhut Nguyen
c3475c11ce drivers: display: ili98xx: Generalize ILI98xx display driver
Make the driver generic so that similar ILI display controllers, such as
ILI9881c, can reuse and extend it with their own register initialization
sequences.

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-09-17 07:50:50 -07:00
Hoang Nguyen
1732be110f drivers: mipi_dsi: Initial support for RZ/A3M
Add mipi_dsi driver support for Renesas RZ/A3M

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
2026-09-17 07:50:50 -07:00
Hoang Nguyen
bfe0d8dce0 drivers: display: Initial support for RZ/A3M
Add display driver support for Renesas RZ/A3M

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
2026-09-17 07:50:50 -07:00
Benjamin Cabé
05c3c0f08f drivers: sensor: lis2dh: re-arm INT2 when one shared trigger remains
lis2dh_trigger_anym_tap_set() tears down both INT2 event sources
(any-motion and tap) and disables the GPIO interrupt before storing the
new handler, but returned early on handler == NULL, permanently killing
the other trigger still registered on that line. Only return early when
neither handler is registered, so lis2dh_start_trigger_int2() re-arms
whichever source remains.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-17 07:50:02 -07:00
Benjamin Cabé
b083295083 drivers: sensor: lis2dh: complete power-mode ODR validation
The runtime ODR setter only rejected 1620 Hz outside low power mode,
so 5376 Hz wrote the reserved CTRL_REG1 code 0b1010 in normal/high
resolution mode, and 1344 Hz in low power mode programmed code 0b1001
which means 5376 Hz there. Reject both unsupported combinations with
-ENOTSUP.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-17 07:50:02 -07:00
Benjamin Cabé
3f58fb9074 drivers: sensor: lis2dh: fix negative die temperature conversion
The raw temperature is a left-justified two's complement value, so the
fractional bits are always a positive addend to the signed integer part.
Negating the fraction for sub-zero readings moved them further from zero
(-0.25 C was reported as -1.75 C); renormalize val1/val2 instead.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-17 07:50:02 -07:00
Benjamin Cabé
01e0f85436 drivers: sensor: lis2dh: check read status in SPI update_reg
lis2dh_spi_update_reg() discarded the result of the register read and
merged the mask into an uninitialized stack byte, writing garbage bits
back to the device while reporting success. Propagate the read error
instead, matching the I2C backend's contract.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-17 07:50:02 -07:00
Hsiu-Chi Tsai
c8f051949c drivers: i2s: esp32: report an error when a chunked RX reload fails
The RX callback reloads and restarts the DMA for each chunk after the
first. If either call fails it leaves through rx_disable, which only
stops the transfer, so the state is left as it was and i2s_read()
waits for data that can no longer arrive.

Every other error exit in that callback sets I2S_STATE_ERROR before
leaving. These two did not; the gap predates this series.

Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
2026-09-17 07:49:42 -07:00
Hsiu-Chi Tsai
caea3a03cd drivers: i2s: esp32: return the DMA's in-flight mem-slab block
A stopped stream loses one mem-slab block per DROP: the block the DMA
was writing is never returned, so the slab runs dry and a later
i2s_write() waits on it forever.

On GDMA, free it once dma_stop() has quiesced the channel, and stop
the I2S unit before the DMA on RX so nothing keeps filling the FIFO.

ESP32 and ESP32-S2 have no GDMA reset, so their stop path still does
not free. Their ISR runs the callback only on EOF, though, so the
block is already back from the DMA there and the callbacks return it
before reporting a descriptor error. The DROP leak on those two parts
is left alone; I have no ESP32 or ESP32-S2 to run a fix on.

Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
2026-09-17 07:49:42 -07:00
Hsiu-Chi Tsai
57909affec drivers: dma: esp32: quiesce the channel when stopping it
GDMA_INLINK_STOP_CHn is a command strobe with no acknowledge, so a
channel can still be writing to the descriptor buffer after
dma_stop() has returned, and the caller then frees a buffer the DMA
overwrites. Reset the channel so the stop is observable, and clear
the events the abandoned transfer latched: the reset writes
conf0.in_rst and leaves int_raw set, while dma_reload() and
dma_start() do not clear.

An AXI channel cannot be reset mid-transaction, so every reset site
(configure, reload and stop) now goes through one helper that
aborts, waits for the reset to become available, resets, then
releases the abort (esp-idf 4393a0d0728b).

I have no ESP32-P4, so the AXI path is build-tested only.

Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
2026-09-17 07:49:42 -07:00