Commit graph

28,390 commits

Author SHA1 Message Date
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
Afonso Oliveira
16e3b0b85c drivers: interrupt_controller: riscv: imsic: use micsr_* functions
Update the IMSIC driver to use the renamed micsr_* indirect CSR
access functions instead of the old icsr_* names.

Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
2026-01-29 13:38:34 +01:00
Flavio Ceolin
6d64ee11ea drivers: crypto_smartbond: Fix comments indentation
Fix indentation in multiple comments in this driver.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-01-29 09:06:50 +01:00
Flavio Ceolin
bc5512f431 drivers: crypto_smartbond: Fix typos
Fix multiple typos in crypto_smartbond driver.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-01-29 09:06:50 +01:00
Flavio Ceolin
3edbd9236b drivers: crypto/mcux_dcp: Avoid race condition
Avoid race condition when allocating sessions.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-01-29 09:06:50 +01:00
Flavio Ceolin
c22d225bcb drivers: crypto_ataes132a: Wrong constant in init
ataes132a_state is an array of CRYPTO_MAX_SESSION length.

This constant must be used when iterating over its elements
and not ATAES132A_AES_KEY_SIZE (even they having the same
value).

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-01-29 09:06:50 +01:00
Charles Hardin
4c23db41ee drivers: pwm: stm32: show the period cycles for the 16-bit limit error
The settings and calculations are often done in micro or nano seconds
and the result is not always shown. So, just add the period cycles as
part of the error message to get the calculated value.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2026-01-29 09:04:39 +01:00
Phuc Pham
957929d634 drivers: adc: Add ADC support for Renesas RZ V2H, V2N
Add ADC driver support for Renesas RZ V2H, V2N

Signed-off-by: Phuc Pham <phuc.pham.xr@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2026-01-29 09:04:01 +01:00
Alex Kar
4cc27a1996 drivers: i2c: sam: fix garbage reads when following a write
The interrupts should only be enabled after the START condition is set
by either writing to TWIHS_THR(for writes) or by writing TWIHS_CR_START
to TWIHS_CR. Otherwise, the TXCOMP interrupt may fire before the driver
is ready, causing invalid reads and the semaphore to deadlock.

Link: https://ww1.microchip.com/downloads/en/DeviceDoc/SAM-E70-S70-V70-V71-Family-Data-Sheet-DS60001527D.pdf
Signed-off-by: Alex Kar <github@alexkar598.dev>
2026-01-28 21:58:52 +01:00
Miika Karanki
3ab167bd72 drivers: serial: uart_stm32: fix IRQ lock not released on error path
In uart_stm32_async_rx_buf_rsp(), when the provided RX buffer is not
located in non-cacheable memory, the function would return -EFAULT
while still holding the IRQ lock acquired at the start of the critical
section. This causes a system deadlock as interrupts remain disabled
indefinitely.

The nocache validation check has been moved outside the critical
section to ensure proper error handling. The check is performed before
acquiring irq_lock(), maintaining the same validation behavior while
preventing the lock from being held during the early error return.

Fixes a bug where async UART RX operations with improperly
placed buffers would hang the system.

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2026-01-28 21:58:35 +01:00
Chun-Chieh Li
2a39d8de41 usb: udc: numaker: move dummy usbd/hsusbd to separate header
Move dummy USBD/HSUSBD register defines to separate header file
so that the code can be more clear.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-01-28 21:56:40 +01:00
Chun-Chieh Li
da3dacc7a1 drivers: usb: udc: numaker: fix submit condition
Fix submit condition for non-control transfer. Do submit when any
of the following conditions is met:
1. Transfer buffer (net_buf) is full
2. Last packet size is less than mps
3. Isochronous transfer

USB mass may request C1 for sector size (512 bytes)-aligned and C2
for CBW (13 bytes).

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-01-28 21:56:40 +01:00
Chun-Chieh Li
4a31b21942 drivers: usb: udc: numaker: support m333x hsusbd
Add support for Nuvoton NuMaker M3331 series HSUSBD device driver

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-01-28 21:56:40 +01:00
Chun-Chieh Li
bfa832f930 drivers: usb: udc: numaker: fix compile error on m2l31x
With USBD and HSUSBD re-organized, SoC must have USBD and HSUSBD at
the same time to pass compile. However, M2L31 just has USBD and meets
compile error with HSUSBD unsupported. To avoid adding too many
conditional (#if condition) code for the error, create one dummy
HSUSBD device definition for M2L31 to pass compile.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-01-28 21:56:40 +01:00
Chun-Chieh Li
295bacd836 drivers: usb: udc: numaker: fix control out failure in hsusbd
For HSUSBD, Control transfer with Data OUT stage will break. This is
caused by FIFO flush which cannot be done timely even though in Setup
token interrupt handler. For this, error recovery with FIFO is not
done in Setup token/packet handler and rely on USB reset handler to do
it as catch-all.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-01-28 21:56:40 +01:00
Chun-Chieh Li
9568c499f5 drivers: usb: udc: numaker: add config for disabling USB on unplug
Some SoC series allow USB controller to be disabled temporarily
on unplug, and then enabled back on re-plug. Add support for such
configuration option in DT and UDC driver.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-01-28 21:56:40 +01:00
Chun-Chieh Li
e89a90c52e drivers: usb: udc: numaker: fix retrieval of setup packet
Change to retrieve Setup packet by the copy which is readily copied
from H/W register in ISR

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2026-01-28 21:56:40 +01:00
Felix Wang
e8dafd27d9 drivers: pwm: Add PWM mode support for tpm
Add support for center-aligned PWM mode in addition to the existing
edge-aligned mode. When center-aligned mode is configured, adjust
pulse and period cycles by dividing by 2 to maintain correct timing.

Add validation checks in PWM capture functionality to edge-aligned
mode only, as capture is not supported in center-aligned mode.

Assign the value directly to avoid re-calculating period_cycles
based on pwm_freq in TPM_SetupPwm, which could lead to precision loss.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2026-01-28 16:13:11 +01:00
Felix Wang
f0acc1d770 drivers: pwm: Fix bugs in tpm
Replace interrupt register checks with explicit capture_active flag
to track capture state. This provides more reliable state management
and fixes potential race conditions when checking if capture is active.

Also optimize TPM_SetupPwm call to only configure the specific channel
being set instead of all channels, improving efficiency.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2026-01-28 16:13:11 +01:00
Martin Stumpf
564cabce71 drivers: fpga_ice40: rework spinlock usage
The driver uses spinlocks for synchronization (due to strict timing
requirements) which makes it defacto incompatible with almost all SPI
backend drivers, as most of them use `k_sem_take` internally.

This change reworks the driver in the following way to solve this
problem:

- Replace driver locks with `k_mutex`
- Run the `load` functions on the system workqueue to execute them on
  a cooperative priority
- Use additional local spinlock in the `bitbang` driver variant to ensure
  precise timing

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2026-01-28 16:12:42 +01:00
Martin Stumpf
097928d633 drivers: fpga_ice40: Fix assert in CS hack
The ICE40 driver uses a CS hack that effectively 'steals' the CS pin
from the SPI driver during `load` by setting the CS pin id to 0.

This triggered the newly introduced assert during gpio_set.

This change introduces a hotfix for this where, instead of setting the
CS pin to 0, it sets the entire CS to 'hardware based'.

It is still a hack and should be reworked at some point.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2026-01-28 16:12:42 +01:00
Benjamin Cabé
e7ae93b39f drivers: sensor: tmag5273: fix typo in log message
fixes what seems to be a copy-paste error

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-01-28 14:42:50 +01:00
Gatien Chevallier
841a7cb13c drivers: otp: stm32_bsec: don't use kernel objects in pre-kernel
When in pre-kernel, kernel objects may not be in a usable state.
Therefore, guard k_mutex_lock()/k_mutex_unlock() usage with
!k_is_pre_kernel().

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
2026-01-28 14:41:45 +01:00
Yves Wang
1b69944e5e drivers: edac: mcux_erm: fix incorrect preprocessor macro usage
The driver was using EDAC_NXP_ERROR_INJECT instead of the correct
CONFIG_EDAC_NXP_ERROR_INJECT Kconfig symbol for conditional compilation.

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2026-01-28 14:41:30 +01:00
Sylvio Alves
fbafad0520 drivers: video: esp32: fix camera sensor init race condition
Move camera XCLK setup from DVP driver (POST_KERNEL) to esp_lcd_cam.c
(PRE_KERNEL_2) to ensure the image sensor receives clock before its
I2C initialization. This fixes a race condition where sensors like
ov2640 would fail to respond during probe because XCLK wasn't yet
configured.

Also adds timestamp to captured video buffers and removes a noisy
error log for set_selection when the source returns -ENOSYS.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-01-28 08:33:10 +01:00
Roman Pustobaiev
598e7c13f3 drivers: video: stm32_dcmipp: fixing driver initialization issue
when pipe 1 or 2 is selected and parallel bus is chosen
HAL_DCMIPP_PARALLEL_SetConfig is failing, since it gets called twice
and driver is already in HAL_DCMIPP_STATE_READY state

Signed-off-by: Roman Pustobaiev <romanpustobayev@gmail.com>
2026-01-28 08:32:49 +01:00
Pieter De Gendt
800ec66680 drivers: ethernet: eth_nxp_enet: Support MAC address configuration
Add support for a MAC address from NVMEM memory.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-28 08:32:37 +01:00
Kevin Chan
7c1725b949 drivers: wifi: change WIFI_INIT_PRIORITY value
Wifi chip module may depend on SDHC(SDIO) module.
Currnetly, default init. priority is
CONFIG_WIFI_INIT_PRIORITY(80) & CONFIG_SDHC_INIT_PRIORITY(85).
It causes the issue.

Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
2026-01-28 08:30:56 +01:00
Eran Gal
bcc8d963e1 drivers: i2c_dw: Add SDA_HOLD tx,rx config
Adds an optional configuration for SDA_HOLD_TX and SDA_HOLD_RX in
the Designware I2C driver.

Signed-off-by: Eran Gal <erang@google.com>
2026-01-27 15:20:51 -06:00
Fin Maaß
3c63100522 drivers: serial: litex: fix is pending
include enabled state for the irq
when checking for pending irqs.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-27 15:20:09 -06:00
Benjamin Cabé
9b54c46e7e drivers: can: adopt SHELL_HELP in CAN shell module
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on flash usage.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-01-27 15:17:47 -06:00
Gatien Chevallier
9d8e06fc92 drivers: ethernet: stm32: remove parts of MAC legacy implementation
Remove parts of the legacy implementation in eth_stm32_hal_common.c for
the loading of the MAC address when the device-tree is used. Use
net_eth_mac_load() for all these cases that were not destined for
production-ready products.

When cfg->mac_cfg.type == NET_ETH_MAC_DEFAULT, it means that neither
"zephyr,random-mac-address", "local-mac-address" or "nvmem-cells" were
used. For this case, keep the legacy property-less implementation to
avoid compilation errors and have a default, backward-compatible case.

Warning: this commit causes backward compatibility breakage for
implementations using "zephyr,random-mac-address" or "local-mac-address"
properties.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
2026-01-27 10:25:10 -06:00