Commit graph zephyr/drivers
Author SHA1 Message Date
Fin Maaß
9934d7e82d drivers: spi: litex: litespi: make the rxtx size a define
make the rxtx size a define, as this driver
does not support any other value and it's
also not configureable in litex.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-02 12:56:11 +01:00
Holt Sun
d73e311f4a drivers: serial: uart_mcux_lpuart: fix async RX race condition
Fix race condition between DMA ISR and work queue that caused RX
length underflow when calculating len = counter - offset.

Both mcux_lpuart_async_rx_timeout (work queue) and dma_callback
(ISR) modified rx_dma_params without locking, causing the ISR to
update counter/offset mid-calculation, resulting in integer
underflow and system crash.

Solution: Add irq_lock() protection around all rx_dma_params
accesses in async_evt_rx_rdy(), mcux_lpuart_async_rx_flush(),
and async_evt_rx_buf_release().

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-02-02 12:55:52 +01:00
Holt Sun
b07ed4bf93 drivers: serial: uart_mcux_lpuart: improve rx_enable error reporting
Split error handling in mcux_lpuart_rx_enable() to distinguish
between DMA status query failures (error) and busy status (debug).

- Use LOG_ERR for get_status failures with specific error code
- Use LOG_DBG for busy status (expected condition, valid -EBUSY)
- Improves debuggability by providing clearer diagnostic messages

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-02-02 12:55:52 +01:00
Pete Johanson
adb65bce2d drivers: flash: Allow configuring dummy byte count for RDID request
Different flash parts have different requirements on the number of dummy
bytes to send when issued a RDID request, so allow configuring the read ID
dummy byte count in devicetree for the MAX32 SPIXF flash driver.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-02 10:00:36 +01:00
Liu Gavin (CSS ICW ENG WFS SW WFSW 1)
85d353d450 drivers: wifi: infineon: fix channel and bandwidth configuration
Pass the selected channel and bandwidth to WHD, so the AP
enables on the requested channel/width.

Signed-off-by: Liu Gavin (CSS ICW ENG WFS SW WFSW 1) <Gavin.Liu@infineon.com>
2026-02-02 09:59:58 +01:00
Gaetan Perrot
4f3478391a drivers: wifi: nrf_wifi: remove redundant vif_ctx_zep initialization
Fix redundant initialization of vif_ctx_zep where the variable was
initialized at declaration and immediately overwritten before being
read.

Remove the redundant initialization to improve code clarity.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-31 17:30:30 +01:00
Grygorii Strashko
db1bea3ae2 drivers: xen: add XEN_EVENTS Kconfig option
The Xen events channel driver consume 72K of RAM, but may not be
required in all use cases.

Added a XEN_EVENTS Kconfig option so that Xen events can be gracefully
disabled if not required. Updated the relevant CMakeLists.txt and
Kconfig files to guard the inclusion of the Xen events driver and its
source files by this option.

Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
2026-01-30 16:56:52 -06:00
Pieter De Gendt
df62d2ac5b drivers: otp: Remove MCUX from NXP OCOTP compatible
MCUX should not be used as part of the compatible.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-30 18:04:46 +01:00
Gaetan Perrot
e819733d0f drivers: crypto: smartbond: fix typos in comments
Fix spelling and wording issues in comments.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-30 18:04:31 +01:00
Missael Maciel
9cbc6616c1 drivers: pwm: sctimer: Add PowerManagement support
pwm_mcux_sctimer driver doesn't support power management actions.
PM Actions added, as well support to save/restore for pwm channels
configurations after exitig from PM3.

Signed-off-by: Missael Maciel <davidmissael.maciel@nxp.com>
2026-01-30 18:02:27 +01:00
Aksel Skauge Mellbye
54bc3154e3 drivers: serial: silabs: Fix async race condition
When an async transfer finished quickly, the internal state of
the driver could come out of sync with the hardware. The tx/rx
enabled flag and PM lock was taken after starting the DMA
transaction, which caused issues if the DMA complete callback
was called before the flags were updated. Set the flag and take
the PM lock prior to starting the DMA transaction to avoid this.

Also release the PM rx lock upon successful completion of a
transfer. The lock was previously only released when the user
manually called `uart_rx_disable()`.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-01-30 06:00:41 -06:00
Alberto Escolar Piedras
4921a09793 drivers serial native_pty: Add DT property to connect to stdin/out
Add a device tree property to request connecting an instance to stdin/out
(on top of the command line option, and the kconfig option).

And clarify that the kconfig option applies to whichever is the
first instance in whatever order the DT logic happens to order them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-01-30 06:00:04 -06:00
Mathieu Choplain
2c51d3a783 drivers: clock_control: stm32u3: enable MSIx PLL mode only if requested
PLL mode on MSIK/MSIS should be enabled only if property `msi-pll-mode` is
present on the generator's DT node. However, the STM32U3 clock driver did
not check this property and unconditionally enabled PLL mode. This is an
issue because PLL mode requires an LSE generator to be provided, which was
asserted at build time, preventing usage of MSIS/MSIK without an LSE even
if the target application did not need the accuracy provided by PLL mode.

Fix by enabling PLL mode for each MSIx generator only if the `msi-pll-mode`
property is enabled on the corresponding DT node.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-30 05:58:35 -06:00
Arthur Gay
b6e40c34bd drivers: memc: stm32_xspi_psram: make refresh configurable in dt
Limit a transaction to a maximum length. Each PSRAM may specify
different configuration.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2026-01-30 05:57:34 -06:00
Arthur Gay
89b5151851 drivers: memc: stm32_ospi_psram: make refresh configurable in dt
Limit a transaction to a maximum length. Each PSRAM may specify
different configuration.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2026-01-30 05:57:34 -06:00
Camille BAUD
8edddc5ab2 drivers: clock_control: Improve overclock support for bl61x
Add more description, and a new overclock setting

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-01-30 05:56:02 -06:00
Camille BAUD
2d2bc6af01 drivers: regulator: driver for BFLB internal regulators
Drivers to manage BFLB SoC internal LDO11 regulators

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-01-30 05:56:02 -06:00
Qingsong Gou
afef16e841 drivers: spi: add spi driver support for sf32lb
Add spi driver for sf32lb platform

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2026-01-30 05:55:24 -06:00
Fin Maaß
1501ce3719 spi: litespi: correct max word size to 8
this driver wasn't really supporting
other word sizes than 8, so remove it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-30 11:06:38 +01:00
Guillaume Gautier
6809092944 drivers: spi: stm32: use dfs for data frame size
Harmonize the variable names frame_size, bytes_per_frame or word_size_bytes
by replacing them all with dfs, which is already used in the Zephyr SPI
driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
c85e063607 drivers: spi: stm32: replace register read by ll function
Replace the direct read from the registers by dedicated LL functions
since that they are now available.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
5308d39b75 drivers: spi: stm32: factorize dma requests
Define a single function to enable the DMA requests instead of duplicating
the same lines several times.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
d9dcb50bf4 drivers: spi: stm32: remove some unnecessary line breaks
This commit removes some line breaks from function definitions that were
not needed since it can fit on one line.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
f13931f150 drivers: spi: stm32: fix and simplify isr
In case of error from the spi_stm32_shift_frames, spi_stm32_complete
could be called twice if one of the condition with the transfer directiion
were true. To prevent this, add a return after the call to
spi_stm32_complete.

Simplify the if/else block with a single if since spi_stm32_complete is
called in every case.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
9164899d1b drivers: spi: stm32: use already existing function to shift frames
The functions spi_stm32_send_next_frame and spi_stm32_read_next_frame
already exist to send and receive next frame. Use them in slave mode
instead of doing it manually.
Additional checks with spi_context_tx_buf_on and spi_context_rx_buf_on are
done inside these functions but they are already done beforehand in slave
mode.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
7eebaa0e0c drivers: spi: stm32: rename variable for consistency
Rename spi_dma_data variable to data for consistency with the rest of the
file.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
655ad8564a drivers: spi: stm32: factorize transfer size setting
Create a new function that calculates and set the transfer size depending
on the transfer direction (for H7 compatibles).

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Bjarki Arge Andreasen
15d8d12096 drivers: serial: uart_nrfx_uarte: patch disable and pinctrl order
The UARTE instance must be disabled before the pinctrl state is
updated like it is done other places in this driver.

While the uarte is enabled, it controls the pins, keeping TX high
for example. Trying to apply pinctrl will have no effect other
than enabling pin retention, so the TX pin which should now be low
and configured as disconnected input, stays an output driven high.

Issue was discovered as the suspended UARTE was backpowering
devices connected to it because of the driven output pins.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-01-30 09:19:03 +01:00
Ren Chen
88688aee93 drivers: ps2: add it51xxx ps2 support
as title.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-01-30 09:18:29 +01:00
Fabrice DJIATSA
ed7dd4f011 drivers: serial: stm32: split cyclic RX wrap into two contiguous events
This change updates uart_stm32_dma_rx_flush() to detect the wrap case
and emit two contiguous UART_RX_RDY events in order:
- tail: [offset .. buffer_length)
- head: [0 .. counter)
This guarantees that each RX_RDY event satisfies offset + len <=
buffer_length.
Non-cyclic behavior and cyclic non-wrapping cases remain
unchanged.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-01-30 09:18:02 +01:00
Andre Stefanov
726a4cc7de drivers: stepper: gpio: honor update interval for work timing
The work-queue based timing source ignored the interval passed via
.update() and always scheduled using the configured microstep interval.
In single-edge mode the step/dir driver programs the timing source with
half the microstep period to generate the required high/low edges, so
ignoring .update() causes the step toggling rate to be wrong.

Store the timing-source interval on update and schedule work using that
value.

Signed-off-by: Andre Stefanov <mail@andrestefanov.de>
2026-01-29 19:23:26 -05:00
John Batch
0a661bd607 drivers: dma: Correcting size calculation in Infineon HAL DMA driver
Corrects an incorrect transfer size calculation when setting up DMA
transfers with a data size other than one byte.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-01-29 16:13:19 -06:00
John Batch
76737d01d8 drivers: dma: infineon: Fixing DMA configuration size and addresses
* Corrects DMA length calculation when data size is not one byte.
* Corrects incorrect descriptor address assignment in chain operations.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-01-29 16:12:56 -06:00
Carlo Caione
4303a3d7d8 lora: Fix bandwidth enum breakage in loramac-node driver
Commit 6b2f1c19ac changed the lora_signal_bandwidth enum values from
sequential indices (0, 1, 2) to actual kHz values (125, 250, 500).

With the new enum values (125, 250, 500), this causes on loramac-node an
array out-of-bounds access, resulting in undefined behavior and crashes
(USAGE FAULT: undefined instruction).

Fix this by adding a translation function that converts the Zephyr
bandwidth enum values to the array indices expected by loramac-node.

Fixes: 6b2f1c19ac

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-01-29 16:12:25 -06:00
Appana Durga Kedareswara rao
aa6386f2c3 drivers: serial: pl011: fix SBSA IRQ config function reference
Commit 45cde341dc ("drivers: serial: pl011: Allows mixed IRQ
settings.") introduced a bug where PL011_SBSA_CONFIG_PORT defines
the IRQ config function as pl011_irq_config_func_sbsa_##n but
IRQ_CONFIG_FUNC_INIT(n) references pl011_irq_config_func_##n,
causing a compilation error when building for boards with SBSA
UART and interrupt support enabled.

Fix by using the correct function name with the _sbsa_ suffix
in the SBSA config port macro.

Fixes: 45cde341dc ("drivers: serial: pl011: Allows mixed IRQ settings.")

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2026-01-29 16:11:53 -06:00
Aiden Hu
8534decf38 drivers: usb: uhc: handle stall status in transfer callback
Return -EPIPE when status is kStatus_USB_TransferStall.

Signed-off-by: Aiden Hu <weiwei.hu@nxp.com>
2026-01-29 16:09:42 -06:00
Jamie McCrae
80f19801b2 soc: sifive: sifive_freedom: Fix SoC Kconfig naming and issues
Fixes the Kconfig name of this so that it matches the value from
soc.yml, and deprecates the old name - this is required to support
future build system features. Additionally, it fixes an issue in
Kconfigs of this SoC of duplicating existing symbols

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-29 17:20:11 +01:00
Stefan Schwendeler
a82e5209d8 drivers: sensor: voltage_divider: Improves resolution to sub-millivolt
The calculation of the sensor value uses the intermediate value of the
function `adc_raw_to_microvolts_dt`. This results in a sensor value
with a resolution that is not below `voltage-divider-scaling` millivolts
which can be too rough for some applications.

Using `adc_raw_to_microvolts_dt` and 64-bit-based scaling improves
the resulting voltage resolution.
Therefore, the public function `voltage_divider_scale64_dt()` is
introduced, which performs the same as `voltage_divider_scale_dt()`.
This decision does not affect implementations that use the current
32-bit implementation of `voltage_divider_scale_dt()`.

Signed-off-by: Stefan Schwendeler <Stefan.Schwendeler@husqvarnagroup.com>
2026-01-29 17:20:02 +01:00
Zhaoxiang Jin
f3fc221f35 drivers: adc: mcux_lpadc: fix offset calibration and type casting
Fix offset calibration handling and improve type safety in the
LPADC driver:
- Change offset_a and offset_b from uint32_t to int16_t to match HAL API.
- Add explicit int16_t casts when initializing offset values from DT.
- Add conditional logic to handle platforms with single offset trim.
- Use LPADC_SetOffsetValue() with appropriate parameters based on
  FSL_FEATURE_LPADC_OFSTRIM_COUNT when auto-calibration is disabled.

This ensures proper offset calibration on all supported platforms and
prevents potential type mismatch issues.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-29 17:19:38 +01:00
Zhaoxiang Jin
6b18307011 drivers: adc: mcux_lpadc: fix code formatting and indentation
Fix inconsistent formatting in the LPADC driver by:
- Consolidating multi-line preprocessor conditionals onto single lines
- Aligning macro continuation backslashes consistently
- Fixing indentation in structure initialization and macro definitions
- Removing unnecessary line breaks in function calls

No functional changes, formatting cleanup only.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-29 17:19:38 +01:00
Henrik Brix Andersen
f28522e036 dts: bindings: can: nxp: flexcan-fd: remove number-of-mb-fd property
Remove the "number-of-mb-fd" property from the NXP FlexCAN FD binding. The
number of Message Buffers (MBs) supported by a given FlexCAN instance is
always specified in 8-byte sized MBs using the "number-of-mb" property
present in the "nxp,flexcan" binding.

The fact that the Zephyr FlexCAN shim driver sets the MB size to 64-byte
when CAN FD is enabled is purely a software construct which should not be
described in devicetree.

Each 512 byte message buffer RAM region can either contain up to 32 x
8-byte MBs or 7 x 64-byte MBs, so just calculate the number of CAN FD MBs
at driver build time.

The FlexCAN IP can either support 16 (CAN classic only), 32, 64, 96, or 128
8-byte MBs, so limit the property to these values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-01-29 17:19:15 +01:00
Pieter De Gendt
539b38d949 drivers: input: chsc5x: Ignore non touch events
Data that isn't a touch event needs to be discarded, especially after
wakeup when it's possible the read has no touch event.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-29 17:18:05 +01:00
Mathieu Choplain
29f1498257 drivers: sensor: stm32_vref: read calibration data once during init
Instead of reading calibration data (device-unique, but never changing!)
then multiplying the result with a constant as part of each conversion,
perform the read+multiplication once during init and cache the result.

This notably avoids frequently an ICACHE disable/enable cycle on STM32H5,
which is a somewhat slow operation.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-29 14:25:28 +00:00
Mathieu Choplain
98f450029e drivers: sensor: stm32_vref: move constants to instance configuration
Various fields were stored in the instance data despite being initialized
at compile-time to a constant value.
Move these fields to the instance configuration instead.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-29 14:25:28 +00:00
Tomas Groth Christensen
c73e59c5f4 dac: mcux_gau: fix output-voltage-range mapping on RW61x
Map DT range index to SDK values {0,1,3} on RW61x

Signed-off-by: Tomas Groth Christensen <tgc@foss.dk>
2026-01-29 14:25:16 +00:00
Qingsong Gou
d0f44beb3d drivers: i2c: sf32lb: add i2c dma support for sf32lb
Add i2c dma support for sf32lb platform

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2026-01-29 14:23:58 +00:00
Amneesh Singh
138d2bdc31 drivers: adc: adc_ti_am335x: fix register MMIO mapping
Bind registers to the local variable in the ti_adc_init() function
after mapping the address space via DEVICE_MMIO_MAP.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-29 13:44:20 +01:00
Amneesh Singh
8134b3b4e8 drivers: adc: adc_ti_am335x: add support for pinctrl
Support configuration of pins for ADC channels in the driver.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-29 13:44:20 +01:00
Amneesh Singh
267e3f39fc drivers: adc: ti_am335x: make internal reference optional
Allow using other references by removing the hard requirement on it being
internal. To be able to use internal voltage, the DT property ti,vrefp can
be used, otherwise it is ignored.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-29 13:44:20 +01:00
Gaetan Perrot
f12de94f3e drivers: adc: adc_npcx: fix typos in log and comments
Fix spelling and wording issues in log and comments.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-29 13:40:41 +01:00