Commit graph zephyr/drivers
Author SHA1 Message Date
Anas Nashif
12ef92c921 Revert "drivers: timer: openrisc: do not drop a comparator match when rearming"
This reverts commit 2e1bbb20d0.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-22 10:27:24 -04:00
Anas Nashif
57359d618b Revert "drivers: timer: core: skip redundant rearms and protect catch-up reloads"
This reverts commit 4f6aebf11c.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-22 10:27:24 -04:00
Yeray Lois Sanchez
2b920af989 drivers: display: st7789v: make panel tuning properties optional
Some ST7789V panel integrations rely on the controller reset defaults
or on fixed power sequencing and must not receive the default power
and gamma configuration commands during initialization.

Instead of adding a bypass flag, make the power/gamma/tuning
devicetree properties optional (vcom, gctrl, lcm, gamma, porch-param,
cmd2en-param, pwctrl1-param, pvgam-param, nvgam-param, ram-param,
rgb-param) and only send a configuration command when its property is
present, following the existing vrhs/vdvs handling.

Existing boards set all of these properties, so their initialization
sequence is unchanged.

Signed-off-by: Yeray Lois Sanchez <yerayloissanchez@gmail.com>
2026-07-22 14:16:38 +01:00
Darcy Lu
9d1dece900 drivers: otp: Add support for Realtek RTS5817 OCOTP
This commit adds On-Chip OTP driver for RTS5817

Signed-off-by: Darcy Lu <darcy_lu@realsil.com.cn>
2026-07-22 14:16:16 +01:00
Mathieu Choplain
d310b65d7b drivers: ieee802154: fix CMakeLists formatting issues
Fix formatting issues in the driver class' listfile which caused CI
compliance checks failures.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-22 14:15:13 +01:00
Mathieu Choplain
21a39d0169 drivers: ieee802154: stm32wba: check correct variable for blobs_verify
Compatible existence should indeed be checked using the autogenerated
Kconfig option DT_HAS_ST_STM32WBA_IEEE802154_ENABLED as intended by the
code in the listfile; however, in CMake, Kconfig options have the
`CONFIG_` prefix as in C!

Update the listfile to check for compatible existence using the proper
variable (i.e., with the `CONFIG_` prefix).

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-22 14:15:13 +01:00
Benjamin Cabé
f92591d53b drivers: dac: dac161s997: Return an error on resolution mismatch
The init sanity check on the DAC_RES status field logged an error but
returned ret, which the preceding successful status read had set to
0, so a failed identity check still reported successful init. Return
-EIO.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:14:25 +01:00
Arkadiusz Grzelka
5e4a497236 input: cf1133: report through the common touchscreen helper
The driver reports raw controller coordinates straight to INPUT_ABS_X and
INPUT_ABS_Y, so none of the touchscreen-common orientation properties reach
it: a board wiring this part to a rotated or mirrored panel has no way to
describe that in devicetree. Every other touch driver in the tree goes
through input_touchscreen_report_pos().

Route both report paths through the helper and include
touchscreen-common.yaml in the binding. `select INPUT_TOUCH` comes with it:
input_touch.c is gated on that symbol, so without it the helper is never
compiled and the driver fails to link.

Behaviour is unchanged for existing users -- with none of the orientation
properties set the helper passes the coordinates through untouched.

Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
2026-07-22 14:14:13 +01:00
Benjamin Cabé
2bcf58806f drivers: input: rx_ctsu: Cache the wheel count in the report loop
Load the wheel count into a local before the report loop instead of
walking data->touch_instance.p_cfg->num_wheels on every iteration.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:13:49 +01:00
Benjamin Cabé
7cde7267b9 drivers: input: rx_ctsu: Cache the slider count in the report loop
Load the slider count into a local before the report loop instead of
walking data->touch_instance.p_cfg->num_sliders on every iteration.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:13:49 +01:00
Benjamin Cabé
982267d7a8 drivers: input: rx_ctsu: Constify the touch context tables
The devicetree-derived button, slider and wheel context tables are only
read, so mark them and their matching config pointer fields const; the
mutable runtime state already lives in separate arrays.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:13:49 +01:00
Benjamin Cabé
aa529b3d32 drivers: input: gpio_kbd_matrix: Hoist the changed-column mask
The changed-column mask is loop invariant, so compute it once before the
drive loop instead of reloading last_col_state through the escaped data
pointer on every iteration.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:13:35 +01:00
Benjamin Cabé
e7f46a04d4 drivers: input: gpio_qdec: Cache the idle polling mode
gpio_qdec_idle_polling_mode() only depends on the static const config,
so evaluate it once and reuse the result for the LED enable and disable
branches.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:13:22 +01:00
Benjamin Cabé
f9ccfc8e70 drivers: input: analog_axis: Cache the axis count in the log loop
analog_axis_num_axes() is defined in another translation unit and cannot
be inlined here, so cache its result in a local instead of calling it on
every loop iteration, matching the save and load helpers.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:13:09 +01:00
Benjamin Cabé
cd2fb185ac drivers: ethernet: sy1xx_mac: Use memcpy for TX linearize
Replace the byte-at-a-time per-fragment linearization loop with memcpy
and an equivalent up-front bounds check.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:58 +01:00
Benjamin Cabé
055c4bb8c0 drivers: ethernet: sy1xx_mac: Use memcpy for TX DMA copy
Replace the byte-at-a-time copy into the TX DMA buffer with memcpy.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:58 +01:00
Benjamin Cabé
5bfb26c0b1 drivers: ethernet: numaker: Cache last-descriptor check
Call synopGMAC_is_last_tx_desc() once and reuse the result instead of
evaluating it twice with identical arguments.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:48 +01:00
Benjamin Cabé
1f9200b6aa drivers: ethernet: wch: Snapshot RX descriptor status
Read the volatile RX descriptor status word once per frame and reuse
it. After OWN reads clear, the descriptor is CPU-owned and stable.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:34 +01:00
Benjamin Cabé
0c1f3e3133 drivers: ethernet: adin2111: Zero only the TX buffer pad
The whole SPI burst buffer was cleared even though the header and
payload are written unconditionally afterwards. Zero only the trailing
pad.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:22 +01:00
Benjamin Cabé
45a4e5b224 drivers: ethernet: adin2111: Hoist loop-invariant OA RX header
The OA data chunk header is constant across chunks. Compute it once
before the loop instead of on every iteration; the transmitted bytes
are unchanged.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:22 +01:00
Benjamin Cabé
d34c1c7295 drivers: ethernet: oa_tc6: Hoist loop-invariant RX header
The RX chunk request header is constant across chunks. Compute it once
before the receive loop; the SPI traffic is unchanged.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:12 +01:00
Benjamin Cabé
29d8ba7f01 drivers: ethernet: mchp_gmac_g1: Collapse RX descriptor writes
Replace the three read-modify-write operations on the RX descriptor
address word with one read and write producing the same value.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 14:12:01 +01:00
Jordan Yates
3d1412770a wifi: hwsim: ensure non-NULL memcpy arg
Fix SonarQube issue, possible `NULL` parameter passed to `memcpy`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-07-22 11:13:55 +01:00
Jordan Yates
a49098d26c dma: emul: use typedef instead of #define
Fix SonarQube issue (rule c:S5825).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-07-22 11:13:55 +01:00
Benjamin Cabé
1f21d40299 drivers: dma: mcux_lpc: Fix channel bounds check in get_status
get_status() indexed the channel table before validating the
channel and accepted a channel equal to the channel count, reading
one past the array. Validate first with an exclusive bound like
the other entry points.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:13:44 +01:00
Benjamin Cabé
66be6204a7 drivers: dma: esp32_gdma: Check RX configuration result
In the memory-to-memory path the RX configuration result was
immediately overwritten by the TX call, so a failed RX descriptor
setup was reported as success.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:13:37 +01:00
Benjamin Cabé
f380eff583 drivers: dma: stm32u5: Fix priority bounds check
A priority equal to the table size passed the check and read one
entry past the priority table.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:13:34 +01:00
Benjamin Cabé
5813cac8cf drivers: i2s: stm32: Fix inverted busy check on non-H7 parts
ll_i2s_dma_busy() returned true when the transmitter was idle (TX
empty and not busy), the opposite of its name, its H7 branch and
what both callers expect. A STOP or DRAIN issued mid-transfer
disabled the stream immediately, while one issued when idle parked
the stream in STOPPING forever. Return the negated expression.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:13:19 +01:00
Benjamin Cabé
c28db9baf0 drivers: watchdog: andes_atcwdt200: Fix overflow in timeout conversion
The millisecond timeout was multiplied by the external clock
frequency in 32-bit arithmetic, overflowing for timeouts above
131 seconds and programming a much shorter period than requested.
Do the conversion in 64-bit.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:13:10 +01:00
Maochen Wang
3b2bef1cb2 drivers: wifi: nxp: release ETH header frag after copy in TX path
In the zero-copy TX path, nxp_wifi_internal_tx() copies the Ethernet
header into the outbuf structure but keeps the original ETH header
net_buf attached to the net_pkt. This wastes one tx_buf slot per
packet while it sits in the WMM queue waiting to be transmitted.

Under heavy TX backpressure (e.g. during roaming with continuous
traffic), this doubles the effective tx_buf consumption per queued
packet, leading to premature tx_buf pool exhaustion.

After copying the ETH header, use net_pkt_frag_del() to release the
first fragment when it contains exactly the ETH header. The payload
fragment remains attached and the cursor position is unaffected since
it already points past the ETH header.

Assisted-by: WChat:Claude
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2026-07-22 11:13:04 +01:00
Holt Sun
5b1e30a595 drivers: counter: mcux_rtc: implement clock calibration
The counter API declares optional clock calibration ops in signed
parts-per-billion, but the Kinetis RTC counter driver did not
implement them, so counter_set/get_calibration returned -ENOSYS.

Implement them using the RTC Time Compensation Register. TCR[7:0]
configures the number of 32.768 kHz cycles per second as
(32768 - value) with value a two's-complement -128..+127, so a
positive value shortens the second and speeds the counter up,
matching the counter API sign convention. TCR[15:8] (CIR, interval
minus one) is kept at 0 to compensate every second, giving
ppb = value * 1e9 / 32768 (~30518 ppb per LSB, range ~+/-3.9M ppb).
set() rejects out-of-range values with -EINVAL and get() reports the
programmed (quantized) TCR/CIR value so a set()/get() round-trips at
the hardware resolution. The register is double buffered and safe to
write while the counter runs. Compensation counts oscillator cycles,
so the ops return -ENOTSUP when the prescaler runs from the LPO
clock.

Validated on frdm_k64f with tests/drivers/counter/counter_basic_api
(CONFIG_COUNTER_CALIBRATION=y): suite passes including the new
set/get calibration case sweeping +/-200000 ppb.

Link: K64 Sub-Family Reference Manual Rev.2 - ch44 RTC_TCR (44.2.4)
Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-07-22 11:12:57 +01:00
Benjamin Cabé
db3897bb6c drivers: display: max7219: Store shadow buffer row at loop index
The write loop read the retained row state from digit_buf[py] but
stored the updated segment back to digit_buf[y], so only the first
row of the shadow buffer was ever updated and later partial writes
merged against stale row data. Store at the loop index.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:12:31 +01:00
Benjamin Cabé
d36d911cfb drivers: display: renesas_lcdc: Derive HSYNC polarity from hsync-active
The HSYNC polarity was computed from the vsync-active timing
property, a copy-paste from the VSYNC line above, so a panel with
different sync polarities got the wrong HSYNC polarity. Use
hsync-active.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:12:19 +01:00
Benjamin Cabé
0a5bbe5524 drivers: flash: si32: Fix alignment check return values
flash_si32_valid_range() returns bool, but the write alignment
checks returned -EINVAL, which converts to true and marks
misaligned writes as valid. An odd size then made the write loop
read one byte past the source buffer. Return false as the other
checks do.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:12:10 +01:00
Benjamin Cabé
3260dea043 drivers: adc: ad405x: Fix async read callback name
The API table referenced ad405x_adc_read_async, which does not exist;
the function is adc_ad405x_read_async, so builds with
CONFIG_ADC_ASYNC failed.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:12:01 +01:00
Benjamin Cabé
57bdff230d drivers: pwm: silabs_timer: Fix channel bounds checks
num_channels is a count and channels are used as 0-based CC indices,
but both guards used '>', letting channel == num_channels index one
element past the valid range. Use '>='.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:11:50 +01:00
Benjamin Cabé
a12a50f713 drivers: pwm: max31790: Fix channel bounds checks
Valid channels are 0 to MAX31790_CHANNEL_COUNT - 1, but both checks
used '>', accepting channel 6 and addressing registers beyond the
per-channel ranges. Use '>='.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:11:39 +01:00
Benjamin Cabé
9bcf962b9b drivers: clock_control: alif: Convert source field width to a mask
The clock source mux update used the encoded field width (in bits)
directly as the clear mask, so only part of a multi-bit source field
was cleared and stale select bits could survive. Convert the width to
a bit mask with BIT_MASK().

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:11:30 +01:00
Benjamin Cabé
5a0f490e5b drivers: gpio: mcux_rgpio: Fix pinmux copy size
The memcpy used sizeof(pin_cfg), reading a whole pinctrl_soc_pin from
a single pinmux array element and past the end for the last pin. Use
sizeof(pin_cfg.pinmux).

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:11:20 +01:00
Benjamin Cabé
652d3ca81b drivers: pinctrl: rza2m: Fix POC0/POCSEL0 clear mask
The PIN_POSEL case AND-ed the two disjoint bit masks, producing 0, so
the old POC0/POCSEL0 values were never cleared and could not be set
back to zero. OR the masks, matching the POC2/POC3 cases.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:11:08 +01:00
Benjamin Cabé
b3bb5c89a0 drivers: clock_control: rza2m: Return an error for invalid dividers
The invalid divider-combination path returned !EINVAL, which is 0, so
rejected FRQCR combinations were reported as success without
programming the register. Return -EINVAL.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:10:57 +01:00
Benjamin Cabé
2377f6d625 drivers: spi: smartbond: Pass device to PM lock release in ISR
The async completion path handed the driver data pointer to
spi_smartbond_pm_policy_state_lock_put(), which expects the device and
forwards it to pm_device_runtime_put(). Pass dev, as every other call
site does.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:10:47 +01:00
Benjamin Cabé
33d45497e0 drivers: clock_control: mcux_scg: Fix FIRCDIV1 feature guard
The FIRC async div1 case was guarded by a misspelled
FSL_FEATURE_FSL_FEATURE_SCG_HAS_FIRCDIV1 macro that never exists, so
the clock was compiled out on every SoC and rate queries returned
-EINVAL. Use the correct feature macro name.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:10:20 +01:00
Benjamin Cabé
a3d7303542 drivers: intc: intel_vtd: Fix delivery mode selection
The fallback condition used ||, which is always true for two different
constants, so every interrupt was forced to IOAPIC_LOW delivery and a
requested IOAPIC_FIXED mode was discarded. Use &&.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:09:45 +01:00
Benjamin Cabé
5634d9097e drivers: intc: nxp_pint: Fix pin bounds checks
Four functions validated the pin index with '>' against
ARRAY_SIZE(pin_pint_id), letting pin == ARRAY_SIZE read one element
past the end of the array. Use '>=', matching nxp_pint_pin_enable().

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:08:43 +01:00
Benjamin Cabé
e4ce091487 drivers: clock_control: stm32f4: Fix missing comma in PLL SAI config
The STM32F413/F423 PLL configuration merged the R divider and post-R
divider into one macro argument due to a missing comma, so
LL_RCC_PLL_ConfigDomain_SAI() received four arguments instead of five
and the branch did not compile when selected.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:08:21 +01:00
Benjamin Cabé
c07bc03d9d drivers: clock_control: stm32mp13: Use SPI clock getter for SPI1
The SPI1 rate query passed an SPI clock-source selector to
LL_RCC_GetUARTClockFreq(), returning a bogus frequency. Call
LL_RCC_GetSPIClockFreq() like the other SPI cases and the mp1/mp2
drivers.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:08:21 +01:00
Benjamin Cabé
f474b557bf drivers: clock_control: stm32h7: Fix TIMPCLK2 base clock
The APB2 timer clock computed its rate from apb1_clock while testing
the APB2 prescaler, so APB2 timers reported APB1's frequency whenever
the prescaler exceeded the threshold. Use apb2_clock, as the H7RS
branch and every sibling series driver do.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:08:21 +01:00
Benjamin Cabé
9d47b1c967 drivers: sensor: icm40627: Fix undefined variable in init error path
icm40627_init() logged a failed bus check through an undeclared
'config' pointer and a nonexistent bus.bus member, breaking the build
when the driver is compiled. Point LOG_ERR_DEVICE_NOT_READY at the
underlying I2C bus device.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:07:46 +01:00
Benjamin Cabé
8d1d65c4b6 drivers: sensor: mpu9250: Make die temperature channel unconditional
The SENSOR_CHAN_DIE_TEMP case sat inside the CONFIG_MPU9250_MAGN_EN
guard, so temperature reads returned -ENOTSUP with the magnetometer
disabled even though the register is always fetched.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:07:46 +01:00