Commit graph zephyr/drivers
Author SHA1 Message Date
Anas Nashif
68b5a582ca drivers: espi: rts5912: use portable IRQ pending API
Replace direct NVIC_*PendingIRQ()/NVIC_EnableIRQ()/NVIC_DisableIRQ()
calls with k_irq_clear_pending()/k_irq_set_pending()/k_irq_is_pending() and
irq_enable()/irq_disable(), dropping the driver's dependency on
cmsis_core.h where nothing else needed it.

RTS5912 is a plain-NVIC Cortex-M33, so the pending-state capabilities
are always available where this driver builds.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-10-29 15:38:34 -04:00
Anas Nashif
ae0131a7d6 drivers: counter: rts5912: use portable IRQ pending API
Replace direct NVIC_*PendingIRQ()/NVIC_EnableIRQ()/NVIC_DisableIRQ()
calls with k_irq_clear_pending()/k_irq_set_pending()/k_irq_is_pending() and
irq_enable()/irq_disable(), dropping the driver's dependency on
cmsis_core.h where nothing else needed it.

RTS5912 is a plain-NVIC Cortex-M33, so the pending-state capabilities
are always available where this driver builds.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-10-29 15:38:34 -04:00
Anas Nashif
00665e04ec drivers: adc: rts5912: use portable IRQ pending API
Replace direct NVIC_*PendingIRQ()/NVIC_EnableIRQ()/NVIC_DisableIRQ()
calls with k_irq_clear_pending()/k_irq_set_pending()/k_irq_is_pending() and
irq_enable()/irq_disable(), dropping the driver's dependency on
cmsis_core.h where nothing else needed it.

RTS5912 is a plain-NVIC Cortex-M33, so the pending-state capabilities
are always available where this driver builds.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-10-29 15:38:34 -04:00
Mark Wang
46838352a9 drivers: udc: mcux: do not fail enqueue after taking the buf
udc_mcux_ep_enqueue() put the request on the endpoint queue and then
returned the result of udc_mcux_ep_try_feed(), which may be error code.
The request was queued, but the error made a class that follows the API
contract release the buffer, so the net_buf ended up free in its pool
while still linked in the endpoint queue. The next allocation links the
same sys_snode_t into a second queue, splicing two endpoint queues or
making one cyclic.

A refused transfer does not lose the request: it stays at the head of
the queue and is fed again from udc_mcux_xfer_done() or the next
enqueue, and the dequeue operation cancels it. Keep it and report
success.

udc_mcux_ep_clear_halt() had the same problem.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2026-10-29 08:46:43 +02:00
Tim Lin
4a84e7a11e drivers/gpio: it82xx2: Support port get direction function
Implement port_get_direction for the it82xx2 GPIO drivers.
Report input and output pins from the GPIO control registers while
excluding disconnected pins.

test:
west build -p -b it82xx2_evb tests/drivers/gpio/gpio_get_direction/

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2026-10-29 08:46:09 +02:00
Otavio Salvador
e0a30bafe0 drivers: serial: native_tty: stop on a hung-up port
poll() reports a hung-up or failed tty as ready, so the interrupt
emulation thread called the UART callback forever while every read
failed: unplugging a USB serial adapter left the application spinning.

native_tty_poll_bottom(), the host side of the poll, now returns EIO on
POLLHUP and POLLERR, EBADF on POLLNVAL and the host's errno when poll()
itself fails, all as NSI_ERRNO_MID_* values, and the thread exits the
process naming the port and the error, as opening it does when it is
missing.

A poll() interrupted by a signal is not an error: it reports no data, and
the thread polls again on its next iteration.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2026-10-28 22:54:49 -04:00
Clément Le Goffic
0047c805f5 firmware: scmi: core: do not take a late reply for the next one
In interrupt mode, scmi_send_message() waits on the channel semaphore,
which the completion interrupt of the reply releases.
A reply arriving after the reply timeout still releases the semaphore,
so the next exchange does not wait, reads the shared memory before its
own reply is written, and every following exchange stays one reply
behind.
Reset the semaphore before sending in interrupt mode.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Clément Le Goffic <clegoffic@baylibre.com>
2026-10-28 22:54:44 -04:00
Johan Hedberg
a412f2cd41 Bluetooth: HCI: userchan: Prefer real time only as the chosen HCI driver
BT_USERCHAN selects NATIVE_SIMULATOR_PREFER_REAL_TIME, since a
controller behind the HCI User Channel runs in real time. BT_USERCHAN
is enabled whenever its devicetree node is, and native_sim.dts always
enables the node. Tests that set the zephyr,bt-hci chosen node to a
test HCI driver therefore also run in real time, so their sleeps and
expiring timeouts take the same amount of wall-clock time.

Select NATIVE_SIMULATOR_PREFER_REAL_TIME only when the User Channel
driver is the chosen HCI driver. Builds that use it, such as the
Bluetooth samples and the tests/bluetooth/classic suites, keep running
in real time.

Tested with twister on native_sim over the 49 test directories that
enable Bluetooth: 604 of 604 test cases pass, and the total execution
time of their 66 run configurations drops from 74 s to under 3 s, 60 s
of which were tests/bluetooth/host_disable.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-10-28 22:52:38 -04:00
Johan Hedberg
192ca77c69 soc: native: Add an option for drivers that interact with real time
NATIVE_SIM_SLOWDOWN_TO_REAL_TIME defaults to y when BT_USERCHAN or
WIFI_NATIVE_SIM is enabled, because both drivers talk to something that
runs in real time. The native_sim board thereby has to know about every
such driver.

Add NATIVE_SIMULATOR_PREFER_REAL_TIME for these drivers to select, and
let the board default to real time when it is set. The symbol lives in
Kconfig.soc, which every build sources, so that drivers can select it
unconditionally. No functional change.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-10-28 22:52:38 -04:00
Mateo Ivankovic
5593912fcb drives: flash: fix hard fault for MX25U12832FM2I02
Add JDEC case for Macronix MX25U12832FM2I02 to skip SFDP auto-parsing.
This forces 24-bit addressing instead of 32-bit addressing.
32-bit addressing resulted in hard faults where to board was not able
to start normally.
Tested on: phyCORE-RT1170

Signed-off-by: Mateo Ivankovic <mateo.ivankovic@inovex.de>
2026-10-28 22:52:04 -04:00
ShiRong Liu
8d3d94fb7d watchdog: cmsdk_apb: reject invalid feed channel IDs
The CMSDK APB watchdog supports only channel 0, but its feed callback
ignores channel_id. Requests for invalid channels therefore reload
the watchdog instead of returning -EINVAL.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: ShiRong Liu <sheltonliu.work@outlook.com>
2026-10-28 22:51:47 -04:00
Emin Ates
eee99ff35d drivers: serial: silabs: fix EUSART data bits with parity
The EUSART driver incorrectly increments the configured data width
when parity is enabled. Silicon Labs EUSART hardware configures data
bits and parity independently.

As a result, 7-bit configurations with parity use 8 data bits, while
8-bit configurations with parity use 9 data bits.

Remove the parity-dependent adjustment and map the requested UART
data width directly to the EUSART hardware configuration.

Signed-off-by: Emin Ates <m.emin.ates@hotmail.com>
2026-10-28 22:51:13 -04:00
Johann Fischer
1ad8b61982 drivers: gpio: mcux: select PINCTRL
The Kinetis PORT clock gate is opened by the pinctrl driver. The gpio
nodes have no clocks property, so gpio_mcux never enables the gate but
writes PORTx->PCR when it configures a pin. Once the UART driver is
disabled nothing else selects PINCTRL and the gate stays closed. On
frdm_k64f an application that only uses a button and an LED does not
work then.

Select PINCTRL like the other mcux GPIO drivers do.

Assisted-by: Claude:claude-sonnet-5.5
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-10-28 22:50:55 -04:00
Flavio Ceolin
57bf6640df drivers: bluetooth: h5: Drop event packets without payload
The buffer for an HCI event packet is allocated in the PAYLOAD state,
once the event code is known. A header that declares an event packet
with no payload skips that state, so h5_process_complete_packet() took
a NULL buffer and passed it to the HCI receive path, which reads it.
A controller, or anything on the UART line, could crash the host with
one such frame.

Reject the packet in the HEADER state, as the other packet types
already do when no buffer can be allocated.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-10-28 22:50:26 -04:00
Yuho Choi
ccd34294d5 drivers: flash: flexspi_mx25um51345g: check DTR alignment before irq_lock
When running XIP, flash_flexspi_nor_write() locks interrupts before
programming the flash. In OPI DTR mode, which is the default, the
check for an even offset and length runs after irq_lock() and returns
-EINVAL without calling irq_unlock(). A single misaligned flash_write()
call therefore leaves interrupts disabled and hangs the system.

Do the alignment check before entering the critical section. While
moving it, fix the comment, which called the offset "write size", and
compare the masked values explicitly.

The check was added after irq_lock() in
commit daf6de7b99 ("drivers: flash: flexspi_mx25um513: enforce write
size limit in DTR mode").

Build-tested for mimxrt595_evk/mimxrt595s/cm33 with the default OPI DTR
mode; not tested on hardware.

Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
2026-10-28 22:50:22 -04:00
Muhammad Waleed Badar
874573cc39 drivers: dp: fix STM32F1 pin access in the bit-bang backend
On STM32F1 the LL GPIO functions take the pin encoded as its BSRR bit
shifted left by 8, plus a CRL/CRH selector for the mode functions. The
STM32 backend passes BIT(pin), so LL_GPIO_SetOutputPin() and
LL_GPIO_ResetOutputPin() write 0 and SWCLK and SWDIO never toggle, and
LL_GPIO_SetPinMode() addresses the wrong field for pins 8 to 15. Every
transfer then fails with no ACK.

Convert the pin with stm32_gpiomgr_pinnum_to_ll_val(), which returns
BIT(pin) on the other series. The set and reset failure dates from
commit a361c45af6 ("drivers: dp: use atomic APIs for pin set/reset").

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-10-28 22:50:16 -04:00
Brenden Adamczak
8f87592ac5 driver: mipi_dsi: dsi_stm32: added a detach function
Added the call to detach/stops the MIPI DSI bus.

Signed-off-by: Brenden Adamczak <cerebralasylum1@gmail.com>
2026-10-28 22:50:06 -04:00
sree sreerajatha
902ae71ba7 drivers: ieee802154: Fix EFR32 Enhanced ACK Link Metrics probing
Fix EFR32 Enhanced ACK Link Metrics probing when multiple neighbors
register independent probing configurations.

The driver previously stored only one Link Metrics Header IE and
address pair. Registering a second SED/SSED replaced the first
neighbor’s configuration, causing subsequent Enhanced ACKs for
the first neighbor to omit the Vendor-Specific
Link Metrics IE.

Signed-off-by: sree sreerajatha <sree.sreerajatha@silabs.com>
2026-10-28 22:49:47 -04:00
TOKITA Hiroshi
14d396eff8 drivers: timer: riscv_machine: remove SYSTEM_CLOCK_DIVIDER config
This RISCV_MACHINE_TIMER_SYSTEM_CLOCK_DIVIDER was introduced for
the gd32vf103 where the CPU clock and mtime clock are different,
but it is now handled properly by timebase-frequency.
We will remove this as no one is referring to it anymore.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-10-28 22:49:42 -04:00
Bjarki Arge Andreasen
c7b21a904f drivers: spi: nrfx_spim: clear cs before suspend
Clear CS before suspending the SPIM device to ensure SCK remains
stable until CS is cleared. Suspending the SPIM device can result in
SCK changing state which a child device may see as a spurious clock.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-10-28 22:49:28 -04:00
Jamie McCrae
c941d11b9b drivers: usb_c: Fix missing shell Kconfig dependencies
Fixes Kconfigs to enable shell options that would show even with
the shell disabled

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-10-28 22:49:19 -04:00
Jamie McCrae
db75409003 drivers: flash: Fix misplaced bleeding Kconfig option
Fixes a Kconfig appearing outside of the flash menu and even being
selectable when the flash Kconfig was not enabled

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-10-28 22:47:19 -04:00
Benjamin Cabé
89af5832fe drivers: sensor: bme680: select the bus RTIO backend
The async API path defines its iodev with I2C_DT_IODEV_DEFINE or
SPI_DT_IODEV_DEFINE, which only exist with I2C_RTIO or SPI_RTIO.
Select the backend for the bus the sensor sits on, so boards with a
BME680 build with SENSOR_ASYNC_API, e.g. the sensor shell test.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5.5
2026-10-28 22:46:39 -04:00
Sylvio Alves
803844b56c drivers: pwm: esp32: update mcpwm period at counter wrap
The MCPWM timer period was always applied at once. Shrinking the
period while the timer runs can leave the counter above the new
peak, so it counts up to the 16-bit limit before it wraps and the
output stalls for seconds.

Apply the new period on the next TEZ event once the timer has
been started, as is already done for the compare value. The first
configuration of a timer still takes the period at once.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-10-28 22:46:29 -04:00
Sylvio Alves
f0b3b8210b drivers: pwm: esp32: enable the mcpwm clock source
Since commit a0f307bbcb ("drivers: clock_control: esp32:
initialize the clock tree"), an ESP32-P4 module clock source
stays gated until a driver enables it. The MCPWM driver selects
its source without enabling it, so the first MCPWM register read
in init raises a load access fault on ESP32-P4.

Enable the default MCPWM clock source before selecting it, as the
other Espressif drivers already do.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-10-28 22:46:29 -04:00
Erwan SZYMANSKI
c8b5a0bb23 drivers: input: gt911: raise up delay before i2c communication
When the Goodix GT911 touchscreen is powered on just before the
probe of its driver, the timing can be too short to read properly
the screen ID through I2C. Raise a bit the delay to ensure it can
work even when power on is really close to driver probe.

Signed-off-by: Erwan SZYMANSKI <erwan.szymanski@st.com>
2026-10-28 22:45:52 -04:00
Jordan Yates
b56f1aedd1 drivers: stepper: single CMake library
There is no need for a library per driver vendor, and most will be empty
even for applications that need the stepper API.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-10-28 22:45:47 -04:00
Brenden Adamczak
4b78a7bbe1 driver: display: stm32_ltdc: added L8 mode
Added the kconfig option that allows you to select L8 as a output option

Signed-off-by: Brenden Adamczak <cerebralasylum1@gmail.com>
2026-10-28 22:45:39 -04:00
Johan Hedberg
a6a701e882 Bluetooth: HCI: h4: Fix RX buffer race between rx_thread and the ISR
rx_thread allocated the buffer for a packet whose header was complete
while the ISR could still be receiving it. The ISR then allocated its
own buffer and read payload into it, rx_thread replaced it, and the
packet reached the host short while the ISR's buffer leaked, until no
RX buffer was left and reception stopped. Either a spare rx.ready token
(since commit 71ef6c6979 ("Drivers: Bluetooth: H4: Use a semaphore to
wake up HCI RX thread")) or a TX interrupt let the ISR in, as
uart_irq_rx_ready() need not depend on the RX interrupt being enabled.

Make the handover explicit: rx_thread allocates only after the ISR has
stopped RX for lack of a buffer, and only once it has delivered every
packet queued before that, whose buffer the allocation may need. Until
rx_thread hands the RX state back, the ISR leaves it alone and keeps RX
disabled. The header copy in read_header() was reachable only through
the race and goes.

Tested with the hci_uart bsim tests, also with every seventh allocation
in the ISR made to fail, and built for nucleo_h563zi. bsim does not run
the ISR in the middle of rx_thread, so the race was not reproduced.

Fixes #122956

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-10-28 22:45:28 -04:00
Johan Hedberg
24b4d49904 Bluetooth: HCI: h4: Fix buffer size check of the deferred allocation
When the ISR finds no free buffer, rx_thread allocates one and checks
that it holds the payload, but not the header copied in front of it. A
packet that fits only without its header is then written up to the
header length past the end of the buffer. read_header() has the same
check; commit ec970a635ea0 ("drivers: bluetooth: h4: Fix check for
sufficient buffer size") fixed only read_payload(). Check and copy the
header in one helper for all three.

Tested with the hci_uart bsim tests, also with every seventh allocation
in the ISR made to fail.

Fixes #122956

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-10-28 22:45:28 -04:00
John Batch
0223b88c5f drivers: i2c: infineon_pdl: assert that no transfer is in progress
The in progress check returns -EIO only after overwriting the shared
descriptors, and it cannot fire while the caller holds the semaphore.
The driver now asserts that no transfer is in progress before writing
the descriptors.

Assisted-by: Copilot:claude-opus-5.5
Signed-off-by: John Batch <john.batch@infineon.com>
2026-10-28 22:44:52 -04:00
John Batch
db5388d9ae drivers: i2c: infineon_pdl: reset the completion semaphore per message
A stale count on transfer_sem lets the next transfer report success
before the bus has done anything.  The driver now resets the semaphore
before each submission.

Assisted-by: Copilot:claude-opus-5.5
Signed-off-by: John Batch <john.batch@infineon.com>
2026-10-28 22:44:52 -04:00
John Batch
4199a9d469 drivers: i2c: infineon_pdl: end a transfer only on its own completion
The event handler releases a waiting controller transfer on any
non-error event unless a write-read is in progress, including events
from a registered target.  On an instance with a target registered, a
controller transfer can therefore return 0 before it completes.

This commit changes the handler to end a transfer only on the completion
event of the current phase, clearing the transfer state before waking
the calling thread.  The interrupt handler no longer clears the state on
its own.

Assisted-by: Copilot:claude-opus-5.5
Signed-off-by: John Batch <john.batch@infineon.com>
2026-10-28 22:44:52 -04:00
Benjamin Cabé
4c2013ccdb drivers: spi: stm32: log the frequency set by the prescaler
When the prescaler bypass is not available, the prescaler table starts
at a division by 2 and the table index is offset by shift, since commit
a0ffee2b92 ("drivers: spi: stm32: add support for baudrate prescaler
bypass"). The debug message of spi_stm32_configure() ignored this offset
and reported twice the actual frequency and half the divider.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5.5
2026-10-28 22:44:47 -04:00
Pete Johanson
d0b24c7557 drivers: intc: Add MAX32 RV32 IRQ trigger support
To fully support the arch tests, implement the ability to trigger an IRQ
for MAX32 RV32.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-10-28 22:44:42 -04:00
Fin Maaß
a9248bb79d drivers: ethernet: wch: do not set link address from set_config
set_mac_addr() is used by the ETHERNET_CONFIG_TYPE_MAC_ADDRESS case of
set_config and also called net_if_set_link_addr(). The caller of
set_config, NET_REQUEST_ETHERNET_SET_MAC_ADDRESS, updates the link
address of the interface itself once set_config succeeded, and the
driver should only register the initial address.

Only program the hardware in set_mac_addr(), and call
net_if_set_link_addr() from iface_init after it.

Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-10-28 22:44:37 -04:00
Krystian Hebel
3d5c640705 drivers: clock_control: smartbond: return -EINVAL for a bogus clock
smartbond_clock_control_on() and smartbond_clock_control_off() cast the
subsys to enum smartbond_clock and switch over it without checking the
range, so the default: case answers -ENOTSUP both for the clocks this
driver does not manage (DIVN_32M, HCLK, LP_CLK, SYS_CLK) and for values
that are not a clock at all: SMARTBOND_CLK_NONE and anything past the
last entry.

Check the identifier before the switch and return -EINVAL for it,
leaving -ENOTSUP to the clocks that are real but out of the driver's
hands. The *_by_ord() helpers discard the return value, so their
behaviour does not change.

Built for da14695_dk_usb and da1469x_dk_pro, with an object file
produced for the driver. No test in the tree hands an out of range
clock to this driver, so the changed paths stay uncovered by CI, and
they were not run on hardware.

Assisted-by: OpenCode:qwen3.8-flash-next-nvfp4-dgx-spark
Signed-off-by: Krystian Hebel <khebel@antmicro.com>
2026-10-28 22:44:33 -04:00
Krystian Hebel
2c63051d8a drivers: clock_control: mchp: return -EINVAL for unknown subsys
clock_mchp_on() and clock_mchp_off() report a subsystem they cannot
decode as -ENOTSUP, although clock_check_subsys() answers an out of
range instance or an unknown type with -EINVAL. -ENOTSUP belongs to the
clock that cannot be gated, which is a reachable answer for RTC and
MCLKCPU, MCLKDOMAIN on the SG_GC and CZ CA drivers: types
clock_check_subsys() accepts but clock_on() and clock_off() reject in
their default: case. Use -EINVAL for the argument.

Where a ret_val initialiser carries both answers, clock_mchp_on() in
PIC32CM JH and SAM D5X/E5X, it keeps -ENOTSUP and the validation
failure assigns -EINVAL. The one in PIC32CM PL only carried the
clock_on() failure, so take that return value instead.
clock_mchp_async_on(), get_rate(), set_rate() and configure() keep
their -ENOTSUP. The Doxygen of the SAM D5X/E5X on(), off() and
async_on() lists the new code.

Built for sam_e54_xpro, pic32cm_jh01_cpro, pic32cm_pl10_cnano,
pic32cm_sg00_cpro, pic32ck_sg01_cult and pic32cz_ca90_cult, with an
object file produced for each driver. No test in the tree hands an
invalid subsystem to these drivers, so the changed paths stay uncovered
by CI, and they were not run on hardware.

Assisted-by: OpenCode:qwen3.8-flash-next-nvfp4-dgx-spark
Signed-off-by: Krystian Hebel <khebel@antmicro.com>
2026-10-28 22:44:28 -04:00
Krystian Hebel
fc0de7eeae drivers: clock_control: mchp: propagate clock_on() error code
clock_mchp_on() reports every clock_on() failure as -ENOTSUP. In the
PIC32CK SG_GC, PIC32CM SG_GC and PIC32CZ CA drivers clock_on() brings
up a PLL through clock_on_pll(), clock_on_pll_out(), clock_on_dpll() or
clock_on_dpll_out(), all of which return -ETIMEDOUT when the lock bit
never sets. A clock that failed to start is thus answered with "this
clock cannot be turned off", which is neither what happened nor a
return value clock_control_on() is documented to produce.

Pass the clock_on() return value through instead. The other Microchip
clock drivers (SAM D5X/E5X, PIC32CM JH, PIC32CM PL) have no PLL to lock
in clock_on(), so their only non-zero return is the default: case for a
subsystem type that clock_check_subsys() has already rejected, and
nothing changes there.

Built for pic32ck_sg01_cult, pic32cm_sg00_cpro and pic32cz_ca90_cult,
with an object file produced for each driver. Not run on hardware: the
changed path is the PLL lock timeout, which needs a failing oscillator.

Assisted-by: OpenCode:qwen3.8-flash-next-nvfp4-dgx-spark
Signed-off-by: Krystian Hebel <khebel@antmicro.com>
2026-10-28 22:44:28 -04:00
Krystian Hebel
9f23535ba9 drivers: clock_control: ameba: return -EINVAL for a bogus clock idx
ameba_clock_on() and ameba_clock_off() answer a clock index at or
beyond AMEBA_CLK_MAX with -ENOTSUP. The index only names an entry of
ameba_clk_ctrl_reg_array, and every index inside that array is gated
the same way, so no clock is being declined and the thing that failed
is the argument. Report it with -EINVAL.

The copy of that check at the top of the parent loop in
ameba_clock_on() is about the driver's own table rather than the
caller: every entry has AMEBA_RCC_NO_PARENT today, so an index that is
neither that nor a valid entry can only come from a broken parent.
Return -EFAULT there instead of ending the walk with a successful 0.

Built for rtl872xd_evb, with an object file produced for the driver. No
test in the tree hands an out of range index to this driver, so the
changed paths stay uncovered by CI, and it was not run on hardware.

Assisted-by: OpenCode:qwen3.8-flash-next-nvfp4-dgx-spark
Signed-off-by: Krystian Hebel <khebel@antmicro.com>
2026-10-28 22:44:24 -04:00
Seppo Ingalsuo
dd838524a9 drivers: dai: intel: dmic: keep DMIC powered while any DAI is probed
The DMIC block is shared by the DMIC DAI instances, one per FIFO.
dai_dmic_remove() disabled the DMIC power and released ownership as
soon as no FIFO was active, even if another DMIC DAI instance was still
probed. With two DMIC DAIs in use, removing the first one powered the
block off under the second one. The next access to DMIC registers from
the second user, e.g. the mic privacy interrupt disable done when its
copier is freed, then failed with a load/store PIF data error.

Count the probed DMIC DAI instances and power the DMIC down only when
no other instance is still probed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2026-10-28 22:44:09 -04:00
Andrew Davis
8676d14d60 drivers: serial: stellaris: Use modern DT_INST_FOREACH helper
This driver was defining each instance using KConfig, we now have
DT_INST_FOREACH helpers to define multiple instances. Update to
this to allow arbitrary instance counts.

This then allows us to drop the KConfig symbols that once were
used for the above. But we do need to keep part of them around
in the SoC dir as these also set the power enable bits for these
devices. This could most likely be also updated to some form
of automatic PM handling, but for now just keep things simple.

Signed-off-by: Andrew Davis <afd@ti.com>
2026-10-28 22:43:55 -04:00
Andrej Butok
aa1d345793 adc: nxp: mcux_gau_adc: Clamp negative single-ended results
Read the result as int16_t and clamp negative values to 0.
The driver only supports single-ended conversions, for which the ADC
API defines unsigned samples.

It solves issue:
The GAU ADC result register holds a signed two's complement value.
An input at or near ground, such as the internal VSSA channel,
can convert to a small negative value.
The driver cast the result straight to uint16_t, so such a sample
wrapped to a wrong value close to 0xFFFF.

Tested on frdm_rw612
Used proprietary code for reading Internal analog ground (~0 V).

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-10-28 22:43:17 -04:00
Wojciech Jakubiszyn
d428551fa8 drivers: video: ov767x: support an input clock
The OV7670 and OV7675 need XCLK running before they answer on SCCB.
On boards where XCLK comes from a clock controller that is off at
boot, such as a pwm-clock node, the product ID read in init fails.

Add an optional clocks property to both bindings. When it is set,
the driver enables the clock before touching the sensor and waits
1 ms, the minimum time the datasheet asks for before the first SCCB
access. The clock specifier is passed as the clock_control subsystem,
taken from the id cell as for pwm-clock.

Tested on an ESP32-DevKitC with an OV7675, XCLK from a pwm-clock node
on LEDC: the sensor probes at boot without deferred init.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Wojciech Jakubiszyn <wojtekjakubiszyn@gmail.com>
2026-10-28 22:43:03 -04:00
Camille BAUD
85674fcbe2 drivers: spi: Enable BL808 SPI
Enable SPI on BL808

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-10-28 22:42:49 -04:00
Camille BAUD
190e91dbd8 drivers: gpio: Fix BL61x/CL/808 cache not taking init value into account
Cache the 'configure' initialization value.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-10-28 22:42:49 -04:00
Tom Burdick
24a8c0b483 drivers: sensor: shell: a stopped stream is not a read failure
A canceled submission now completes with -ECANCELED, so "sensor stream
<dev> off" prints "Read failed". Say the stream stopped instead.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
2026-10-28 22:42:39 -04:00
Adrien Lessard
1ba5543730 drivers: spi: stm32: make DMA support depend on a dmas property
With CONFIG_SPI_STM32_DMA=y and no enabled SPI node with a dmas
property, dma_callback() is never referenced and the build emits a
-Wunused-function warning. DMA support is useless without a DMA
channel, so make SPI_STM32_DMA depend on an enabled st,stm32-spi node
having a dmas property.

Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Adrien Lessard <adrien.lessard@rbr-global.com>
2026-10-28 22:42:16 -04:00
Jack Lai
1089dcfb10 driver: pwm: rts5912: power management
This commit introduces PM policy state locks
in the RTS5912 driver. It dynamically holds
the lock when the PWM duty cycle is strictly
between 0% and 100%, ensuring the clock
remains active during dimming.

Signed-off-by: Jack Lai <jack_lai@realtek.com>
Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
2026-10-28 22:42:11 -04:00
Takumi Ando
214339b069 drivers: spi: xlnx_zynqmp_gqspi: Fix baud-rate divisor updates
The divisor mask is unshifted, so clearing it affects bits 2:0 rather
than bits 5:3 of GQSPI_CFG. Old divisor bits remain set and are ORed
with the new value when changing the SPI frequency.

With a 300 MHz reference clock, switching requests from 40 MHz to
5 MHz and back leaves the clock at 1.171875 MHz instead of 37.5 MHz.
Shift the mask before clearing the divisor field.

Assisted-by: Codex:GPT-6
Signed-off-by: Takumi Ando <takumi@spacecubics.com>
2026-10-28 22:42:06 -04:00