Commit graph zephyr/drivers
Author SHA1 Message Date
Nicolas Pitre
23ad0c4df5 drivers: timer: riscv_machine: use the generic timer core
Convert the RISC-V machine timer to system_timer_generic.h. The mtime
counter with its absolute mtimecmp compare is a COMPARE backend: the
driver keeps only z_clock_cycle_get() (mtime) and z_clock_set_compare()
(set_mtimecmp), and the core takes over the cycle-to-tick accounting, the
deadline math, the range clamp and the announce. smp_timer_init() primes
the per-hart comparator through z_clock_smp_prime() rather than reaching
into the core's baseline.

The public cycle counter applies the DT clock divider to raw mtime, so it
overrides the core's default sys_clock_cycle_get_32/64() via
Z_CLOCK_HAVE_CYCLE_GET_32/64. Behaviour is unchanged; timer_api and
context pass on qemu_riscv64.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Nicolas Pitre
ca254d5a1d drivers: timer: add generic tickless system-timer core
Every tickless system-timer driver reimplements the same tick accounting
by hand: the cycle-to-tick division, the announce baseline
(last_cycle/last_tick/last_elapsed), the tick-aligned deadline
computation and the range clamp. The logic is identical across the
free-running-compare drivers (arm_arch_timer, riscv_machine_timer, hpet,
...) down to the copied overflow-guard constant, and the small
divergences between the hand-rolled copies are a recurring source of
timer bugs.

Add system_timer_generic.h, an implementation header a driver includes
to get that accounting for free. It emits the tick-facing contract the
kernel calls (sys_clock_set_timeout(), sys_clock_elapsed(),
sys_clock_cycle_get_32/64()) and owns the baseline state, so the driver
is left with only cycle-domain primitives: read the counter, arm the
comparator (or program a relative reload), acknowledge the interrupt.

The header is included, not linked: the driver defines its constants and
static-inline primitives first, so the core inlines and constant-folds
against them (the per-tick divide becomes a multiply-shift, an unused
backend path is eliminated) on a plain -Os build with no LTO. Because
the header defines the global sys_clock_* symbols, a build that pulls in
two system timers fails at link time, which is the correct outcome. It
lives beside the drivers rather than under include/, as it is private to
them.

The core is complete on its own; the conversions that follow only use
it, they do not extend it:

  - Two backends: COMPARE (free-running counter plus an absolute compare
    register) and RELOAD (a relative down-counter, assumed to auto-reload
    so a non-tickless kernel needs no per-tick re-arm).

  - Counter width is a CYCLES_WIDTH knob: the core masks every delta to
    that width, so a counter narrower than 64 bits is used as-is, without
    software extension. The default is the native register width.

  - CYCLES_MAX bounds how far ahead a deadline is armed: half the counter
    span by default (the upper half is IRQ-latency headroom), a quarter
    span with Z_CLOCK_COUNTER_NONMONOTONIC, where the upper half instead
    flags a counter that momentarily reads backwards (a global timer seen
    from another CPU under QEMU SMP), so such a read is reported as no
    elapse rather than a huge forward jump.

  - The cycle rate is a CYCLES_PER_SEC knob (default the kernel system
    clock rate), from which the core derives the cycles per tick: a
    build-time-constant rate folds the division; a run-time rate
    (CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) is precomputed once in
    z_clock_init() and refreshed by z_clock_rescale() on a frequency
    change, so the driver never states cycles-per-tick itself.

  - Init and SMP bring-up helpers (z_clock_init(), z_clock_smp_prime()),
    and a z_clock_announce_from() entry for a driver that must keep work
    atomic with the announce.

No driver includes the header yet; conversions follow.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Nicolas Pitre
fa9b836416 kernel: timeout: drop the idle argument of sys_clock_set_timeout()
With low-power idle handoff now going through sys_clock_idle_enter(),
nothing passes idle == true to sys_clock_set_timeout() any more, so the
argument is dead. Drop it: sys_clock_set_timeout(uint32_t ticks) now
means exactly "program the next tick, N ticks out", nothing else.

This updates the prototype, the weak default, every in-tree timer driver
definition (including the out-of-tree-style board timer under boards/),
and the core call sites. For the five drivers with low-power behaviour
this only removes the now-unused idle argument that the previous change
left on set_timeout(); the handling itself stays in their
sys_clock_idle_enter().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Nicolas Pitre
7d0bb85adc kernel: timeout: add sys_clock_idle_enter() for low-power idle handoff
The idle argument of sys_clock_set_timeout() carries a distinct signal:
the CPU is entering low-power idle, here is its wakeup. Only the PM and
SoC power paths produce it (the timeout core always passes false), and
only a few drivers act on it to hand off to a low-power wakeup timer.

Introduce a dedicated sys_clock_idle_enter() hook for that, so the two
idle==true callers (subsys/pm and soc/nxp/rw) call it instead of
sys_clock_set_timeout(). Its weak default just programs the wakeup via
sys_clock_set_timeout(), so a driver with no low-power handling needs
nothing.

The five drivers that acted on idle (cortex_m_systick, esp32, xtensa,
mcux_os, stm32_lptim) move that handling into their own
sys_clock_idle_enter(), keeping their exact behaviour. Where the idle
path was self-contained it moves wholesale (cortex_m_systick, mcux_os,
stm32_lptim); where it shares the timeout programming, idle_enter()
calls set_timeout() first and then does its idle work (esp32), or shares
a small private helper (xtensa). set_timeout() keeps its now-unused idle
argument for the moment; nobody passes idle==true to it any more, which
lets the next change drop the argument entirely.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Nicolas Pitre
e5903e4796 drivers: timer: mcux_os: track the no-deadline state in sys_clock_unused()
mcux_os keeps a wait_forever flag (consumed by the counter-overflow wakeup
path) that it set when sys_clock_set_timeout() was called with the
SYS_CLOCK_MAX_WAIT sentinel. The kernel no longer passes that value; the
no-deadline case now arrives via sys_clock_unused(). Set the flag there and
program the match as far out as the hardware allows; clear it on a real
sys_clock_set_timeout().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Nicolas Pitre
269e2e618a drivers: timer: stop the clock via sys_clock_unused()
The kernel now signals "no timeout pending, uptime may drift" by
calling sys_clock_unused() instead of passing the SYS_CLOCK_MAX_WAIT
sentinel to sys_clock_set_timeout(). Move each driver's sloppy-idle
handling out of sys_clock_set_timeout() and into a sys_clock_unused()
implementation, and drop the ticks == SYS_CLOCK_MAX_WAIT comparisons.

Drivers that actively stop the counter (cortex_m_systick, arcv2, hpet,
mcux_sysctr, mcux_lptmr, sam0, ite, infineon, mchp_xec, realtek,
stm32_lptim) do so in sys_clock_unused(). The free-running compare
timers (nrf_rtc, mcux_rtc_jdp, max32_rv32) instead follow the renesas
model and simply stop reprogramming: the last compare still catches the
counter wrap and the next real timeout re-arms them, so an explicit
maximum-length wait would only add a needless periodic wakeup. nrf_rtc
keeps a one-line sys_clock_unused() that clears the flag consumed by its
overflow-trigger path; mcux_rtc_jdp and max32_rv32 need no override at
all, like the renesas drivers.

cmsdk_apb is the exception: it is an auto-reload down-counter, so not
reprogramming would keep firing at the previous (possibly short)
interval. It programs the maximum reload instead, matching what
non-sloppy idle already does, with a note that stopping the counter
would be the better but riskier improvement.

Resume is unchanged: the next sys_clock_set_timeout() restarts the
driver.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Nicolas Pitre
926f7c4c0f kernel: timeout: add sys_clock_unused() and decide sloppy idle centrally
The "no timeout pending, stop the clock" decision under
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE was expressed by next_timeout()
returning SYS_CLOCK_MAX_WAIT verbatim as a magic sentinel, which every
timer driver then had to recognise. Move the decision into the core and
give it an explicit, resumable interface.

Add a weak sys_clock_unused() hook (no-op default): the kernel calls it
when the timeout list is empty and sloppy idle allows uptime to drift,
in place of programming a wait. A driver may override it to actively
halt its counter; one that does not simply stops being reprogrammed and
quiesces on its own, so sloppy idle now works for every driver. Resume
is the next sys_clock_set_timeout(), exactly as before; the core keeps
no paused state.

next_timeout() no longer special-cases sloppy idle, so its empty-list
and far-timeout arms collapse to the same capped budget and
SYS_CLOCK_MAX_WAIT loses its sentinel meaning. The decision lives in
reprogram_next(), used only at the two sites where the list can drain
(abort, end of announce); the add path always has a pending timeout and
calls sys_clock_set_timeout() directly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Nicolas Pitre
7e681dbfbd drivers: timer: esp32_sys_timer: adopt the sys_clock_lock() scheme
The driver kept a private spinlock and used the legacy sys_clock_announce()
even though the kernel already holds its timer lock across the driver's
sys_clock_set_timeout() and sys_clock_elapsed() callbacks. Take that same
lock instead: the ISR and sys_clock_idle_exit() now use sys_clock_lock()
with sys_clock_announce_locked(), and set_timeout()/elapsed() simply assert
the lock is held rather than acquiring one of their own.

This drops a redundant lock and lets the upcoming low-power idle handling
avoid any locking of its own.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-07-21 18:02:43 -04:00
Fin Maaß
3df5fa4d3f drivers: ethernet: stm32: ptp: use BUILD_ASSERT
use BUILD_ASSERT for checking constant values.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-21 14:10:18 -04:00
Dhanoo Surasarang
390259c1cd drivers: flash: nrf_mramc: Resolve MRAM node from DT instance
The driver hardcodes DT_NODELABEL(cpuapp_mram) which does not exist
when building for cpuflpr since the node is deleted in the cpuflpr
dtsi. Use DT_INST(0, soc_nv_flash) to resolve whichever soc-nv-flash
child is present under the controller, matching the RRAM driver.

Signed-off-by: Dhanoo Surasarang <dhanoo.surasarang@nordicsemi.no>
2026-07-21 14:09:29 -04:00
Fin Maaß
a87d486e19 net: ethernet: remove ETHERNET_PTP from caps
net_eth_get_ptp_clock can be used instead to
check if ptp is supported, so remove ETHERNET_PTP.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-21 14:07:22 -04:00
Benjamin Cabé
e88ca1047e drivers: ethernet: xmc4xxx: Cache RX fragment in refill
Read dev_data->rx_frag_list[tail] once into a local when preparing
each RX DMA descriptor instead of dereferencing it twice.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-21 10:17:17 -04:00
Benjamin Cabé
44aff43597 drivers: input: paw32xx: Use the cached device in the work handler
The motion work handler already caches data->dev in a local, so reuse it
in both input_report_rel() calls instead of dereferencing data->dev
again.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-21 10:17:04 -04:00
Farsin Nasar V A
1180ffd0ab drivers: rtc: mchp: Initialize unsupported rtc_time fields
The get_time() and get_alarm_time() APIs left tm_yday, tm_isdst,
and tm_nsec uninitialized after populating the rtc_time structure.

Initialize tm_yday and tm_isdst to -1 (unsupported/unknown) and
tm_nsec to 0, matching the convention used by other RTC drivers
in Zephyr.

Signed-off-by: Farsin Nasar V A <farsin.nasarva@microchip.com>
2026-07-21 10:16:55 -04:00
Gang Li
4685e0927a drivers: wifi: nxp: Add Kconfig for external antenna gain
Add NXP_WIFI_EXT_ANT_GAIN Kconfig option to enable runtime
configuration of net antenna gain per sub-band via host command
API.
This kconfig is only applicable to RW61x.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2026-07-21 10:16:10 -04:00
Zafer SEN
0c1b0c7996 drivers: modem: tolerate extra OK responses during startup queries
Accept extra `OK` responses after `AT+KSELACQ?` and `AT+KSRAT?`
during HL78xx initialization. This keeps the chat script aligned
on firmware versions that return an additional `OK` for these queries.

Signed-off-by: Zafer SEN <zafersn93@gmail.com>
2026-07-21 10:14:36 -04:00
Zafer SEN
249511bb6e drivers: modem: hl78xx: skip GSM band configuration in AutoRAT mode
Treat AutoRAT operation the same as GSM when determining whether
band configuration should be skipped on HL7812 devices.

Do not attempt to configure band selection when GSM is enabled.

This includes AutoRAT mode, since the modem may fall back to 2G if the
other configured RATs are unavailable. Because GSM band configuration
is not supported in this context, band programming should be skipped
whenever GSM can be selected by the modem.

This avoids sending unsupported band configuration commands and aligns
the band configuration logic with the modem's RAT capabilities.

Signed-off-by: Zafer SEN <zafersn93@gmail.com>
2026-07-21 10:14:36 -04:00
Krzysztof Chruściński
ab802f362d drivers: clock_control: nrf: Start HFXO before starting HFXO24M
Even though HFXO24M automatically starts HFXO, it is much easier to
manage if HFXO is managed by software. Add requesting of HFXO when
HFXO24M is started.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-07-21 10:14:19 -04:00
Sylvio Alves
4fcf816317 drivers: spi: esp32: select the peripheral clock source
The driver reads the rate of the configured clock source and
calculates the timing divider against it, but never programs
the hardware mux that selects that source. The mux keeps its
reset value, so the peripheral runs from XTAL while the
divider assumes a PLL rate.

On esp32p4 the default source is the 480 MHz SPLL and the
reset value selects the 40 MHz XTAL, making every transfer 12
times slower than requested: a 1 MHz request measures 83 kHz.
Program the mux at init so it matches the rate the divider is
calculated from.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-07-21 10:14:08 -04:00
Liam Ogletree
184f1f8ad0 drivers: haptics: Documentation cleanup for haptic drivers
Unifies documentation for haptic drivers. Previously, CS40L26/27
showed up under "Files" in Haptics documentation while the other
three drivers showed up under "Topics".

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2026-07-21 10:12:25 -04:00
Raffael Rostagno
dd7855f7bb drivers: i2c: esp32: Attach sleep retention modules
Attach sleep retention modules to effectively enable TOP PD power down.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
af80c9c022 drivers: counter: esp32: Fix sleep retention
Adopt gptimer retention API and attach sleep retention modules
to effectively enable TOP PD power down.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
a3351d28f3 drivers: watchdog: esp32: Attach sleep retention modules
Attach sleep retention modules to effectively enable TOP PD power down.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
3fbf8cc6c8 drivers: mcpwm: esp32: Fix sleep retention
Adopt mcpwm retention API and attach sleep retention modules to
effectively enable TOP PD power down.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
e3e916d448 drivers: ledc: esp32: Attach sleep retention modules
Attach sleep retention modules to effectively enable TOP PD power down.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
a23d5c192b drivers: spi: esp32: Attach sleep retention modules
Attach sleep retention modules to effectively enable TOP PD power down.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
0f3a61dfc3 drivers: serial: esp32: Attach sleep retention modules
Attach sleep retention modules to effectively enable TOP PD power down.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
3868992de7 drivers: dma: esp32: Attach sleep retention modules
Without ATTR_ATTACH and sleep_retention_module_attach(), GDMA channels
are created but not retained, so peripheral_domain_pd_allowed() stays
false and TOP never powers down in light sleep. Fix lowers light sleep
current when GDMA and peripheral power down are enabled.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
86f7be1d6a drivers: dma: esp32p4: Fix sleep retention
Use aux variable to allow accessting the retention table's
group id.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Raffael Rostagno
c97616cdeb drivers: dma: esp32: Fix sleep retention
Recent HAL update moved GDMA sleep-retention definitions from
hal/gdma_periph.h into the esp_driver_dma component. Include gdma_priv.h
and use the new gdma_retention_desc_t / gdma_retention_infos names in
place of the removed gdma_chx_reg_ctx_link_t / gdma_chx_regs_retention.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:12:17 -04:00
Martin Hoff
9033070954 drivers: pwm: siwx91x: simplify channel active boolean checks
Replace explicit == true/false comparisons with idiomatic boolean
expressions in pwm_siwx91x_set_cycles().

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-07-21 10:10:42 -04:00
Martin Hoff
d67bc43898 drivers: pwm: siwx91x: add PM runtime management for PWM
This patch adds PM runtime management for the PWM peripheral. It allows
to block CPU from entering the sleep state when PWM is active.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-07-21 10:10:42 -04:00
Martin Hoff
0027a5dc8d drivers: clock_control: siwx91x: fix PWM clock rate retrieval
This patch ensure that clock_control_get_rate function returns the
correct clock rate for the PWM peripheral. PWM is clocked from M4
processor clock.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-07-21 10:10:42 -04:00
Samuel Slesar
435f99f332 drivers: watchdog: mcux_wwdt: support MCXL clock divider
Use the MCXL WWDT clock divider path when configuring WWDT0 from
the MCUX WWDT watchdog driver.

Signed-off-by: Samuel Slesar <samuel.slesar@nxp.com>
2026-07-21 10:09:15 -04:00
Samuel Slesar
a89e5b6015 drivers: clock_control: mcux_syscon: support MCXL WWDT clock
Use the MCXL WWDT clock gate and clock frequency helper when
handling MCUX_WWDT0_CLK.

MCXL uses kCLOCK_GateWWDT0 and CLOCK_GetWwdtClkFreq(), unlike some
other LPC-style platforms that use kCLOCK_Wwdt0 and CLOCK_GetWdtClkFreq().

Signed-off-by: Samuel Slesar <samuel.slesar@nxp.com>
2026-07-21 10:09:15 -04:00
Raffael Rostagno
023edb588c drivers: hci: esp32: PM support
Add PM support for HCI ESP32 driver. Update sleep retention
config for BLE power management.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-07-21 10:07:38 -04:00
Kurt Eckhardt
0b794298bb video: stm32_dcmi: Snapshot mode
Add the ability to run cameras in a logical
snapshot mode instead of always running
in video mode.  In particular, the camera
starts when you ask for an image to be dequeued
and stops when it receives an image.

There are two ways to setup to run in this mode:

a) Tell it to do so in the overlay by giving the DCMI object
the property: snapshot-mode

b) At run time:  I added a video control: VIDEO_CID_SNAPSHOT_MODE
Which can have the values
    0 - normal - continuous video mode
    1 - snapshot - snapshot mode enabled.

As mentioned in the snapshot modes, the HAL DMA is stopped after each
image and restarted when the user asks for another image.  I added a
timeout default to 1 second, that handles the case where sometimes
the HAL is silently not successful in retrieving an image.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
2026-07-21 10:06:50 -04:00
Kurt Eckhardt
de02f6db73 video: stm32_dcmi: HAL_DCMI_Stop failures now DBG
When HAL_DCM_Stop return an error code, their failure does not
appear to be a real failure, but instead it is more like it
simply did not have to do anything.  As such changed from reporting
it from LOG_WRN to LOG_DBG

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
2026-07-21 10:06:50 -04:00
Alberto Escolar Piedras
8994f40014 drivers: sensor: bmp581: ifdef static function
So it is only built when needed, and we avoid a compiler warning:
bmp581.c:59:19: error: unused function 'bmp581_pm_busy_check'

The issue was there since c68a25e4d5
but only became apparent in CI when its test was added in
f0802b645b

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-07-21 10:27:49 +02:00
Venkatesh Odela
51643b9984 drivers: ethernet: xilinx_axienet: avoid memcpy in TX and RX path
TX path: build a dma_block_config chain from net_pkt->frags and pass it
directly to dma_config(), eliminating net_pkt_read() into a static
buffer.

RX path: reserve one networking-stack net_buf per RX DMA descriptor via
net_pkt_get_reserve_rx_data(); on completion link the buf into a net_pkt
via net_pkt_frag_add() and pass it to net_recv_data() without memcpy.

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2026-07-20 16:44:16 -05:00
Venkatesh Odela
ce50fd98ac drivers: dma: xilinx_axi_dma: fix TX SG callback and ring reset logic
Two issues fixed for multi-fragment scatter-gather TX support:
 - Completion callback was fired per descriptor; now fires only on the
   EOF descriptor so the ethernet driver unrefs net_pkt once per packet.
 - Ring reset (memset, index reset, CURDESC write) is skipped when the
   DMA is not halted to avoid corrupting an active ring.

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2026-07-20 16:44:16 -05:00
BhuvanChandra DV
2b6b042de6 drivers: i2c: stm32: use I2C_DT_INST_TRANSFER_TIMEOUT per-bus timeout
Replace the fixed I2C_TRANSFER_TIMEOUT constant with a per-instance
k_timeout_t field stored in the driver config struct. The field is
k_timeout_t transfer_timeout, initialized at compile time using
I2C_DT_INST_TRANSFER_TIMEOUT() which resolves the timeout with the
following priority:
  1. zephyr,transfer-timeout-ms DT property on the controller node
  2. CONFIG_I2C_TRANSFER_TIMEOUT_MS (Kconfig default)
  3. K_FOREVER when the resolved value is 0

All k_sem_take() and sys_timepoint_calc() call sites in v1 and v2
use cfg->transfer_timeout directly -- no helper function needed.

Boards that omit the zephyr,transfer-timeout-ms DT property see no
behavioural change; falls back to CONFIG_I2C_TRANSFER_TIMEOUT_MS.

Signed-off-by: BhuvanChandra DV <bhuvanchandra.dv@rapyuta-robotics.com>
2026-07-20 16:43:07 -05:00
Benjamin Cabé
b5c8cae9be drivers: mbox: andes_plic_sw: Fix channel bounds check
channel_max holds the channel count, so accepting a channel equal
to it read one past the irq_sources array and let callers index
the callback arrays out of bounds.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-20 08:37:57 -05:00
Benjamin Cabé
87f047afb3 drivers: counter: stm32_rtc: Fix HSE async prescaler macro name
The async-prescaler default referenced _HSE_ASYNC_PRESCALER, a
truncated spelling of RTC_HSE_ASYNC_PRESCALER that is defined
nowhere, breaking the build for HSE-clocked RTC configurations
without the async-prescaler property.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-20 08:37:46 -05:00
Benjamin Cabé
3339140c9e drivers: input: crsf: Check channel sentinel before indexing
The channel_info pointer was formed before the channel == -1 check,
creating an out-of-bounds pointer for every unmapped channel. Move
the lookup after the guard.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-20 08:37:37 -05:00
Benjamin Cabé
3c2962778d drivers: i2c: andes_atciic100: Fix Fast-Plus configuration
The I2C_SPEED_FAST_PLUS case fell through into the unsupported
I2C_SPEED_HIGH case and returned -EIO. Add the missing break.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-20 08:37:26 -05:00
Benjamin Cabé
f9cc69ec8f drivers: i2c: dw: Fix mistyped devicetree macro
DT_INST_NODE_HAS_PROP was spelled with hyphens in the sda_hold_tx
initializer, so the i2c-sda-hold-time-ns property was silently
ignored.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-20 08:37:10 -05:00
Philipp Steiner
cb2357d6bb drivers: clock_control: test SIRC boolean value
DT_INST_NODE_HAS_PROP() reports whether a property is defined, not
the value of a boolean property. Binding-defined boolean properties
remain defined with value zero when absent, so the existing guards
still compile the SIRC paths on MCXW72.

Use DT_INST_PROP() for every sirc-supported guard. This excludes the
SIRC SDK calls on MCXW72 while preserving them on MCXW70 and MCXW71.

Verified with the three MCXW72 OpenThread configurations that failed
in Twister and with cpp.main.minimal on MCXW71.

Assisted-by: Codex:gpt-5
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-07-20 08:35:58 -05:00
Guillaume Gautier
ebc1228ab4 drivers: adc: stm32: improve error message for common sampling times
For ADCs that use a common register for sampling times, improve the error
message when the common registers are already set and can't accept a new
value.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-07-20 08:35:34 -05:00
Holt Sun
b80fadc143 drivers: counter: mcux qtmr: add capture support
Implement counter capture callbacks for MCUX QTMR timer channels. Each
Zephyr counter device maps to one QTMR channel, so the API accepts
channel 0 and uses the DT secondary-source property as the capture
input.

Reject capture in modes that already consume the secondary source and
keep alarm and capture ownership exclusive on the channel. Add reset
support so generic counter capture tests can prepare the timer state.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-07-20 08:34:24 -05:00