Commit graph zephyr/drivers
Author SHA1 Message Date
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
Jamie McCrae
d5df08a1cc mgmt: mcumgr: transport: uart: Add support for non-console raw mode
Adds support for using MCUmgr over UART (not via shell) in a raw
mode which does not include base64 and other SMP over console
encoding

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-27 10:23:45 -06:00
Jamie McCrae
891c2e3a9c drivers: console: kconfig: Fix MCUmgr names
Fixes the text case used for MCUmgr

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-27 10:23:45 -06:00
Benjamin Cabé
529bc3034a drivers: usbc: adopt SHELL_HELP in ppc shell module
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on code size.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-01-27 11:07:22 +00:00
Benjamin Cabé
5600f734db drivers: usbc: adopt SHELL_HELP in tcp_c shell module
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on code size.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-01-27 11:07:22 +00:00
Alain Volmat
914f2b0b5b video: correct video_print_ctrl behavior for integer_menu
Correct the behavior when printing interger menu values.
Current loop is not correct since it is waiting for a 0 value
to stop while for integer menu any value is possible.
Modify in order to loop until reaching the maximum number of
entries listed at the ctrl init time.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-01-27 10:56:27 +00:00
Alain Volmat
e71597cf56 video: video_ctrls: fix integer menu truncated type print
"integer menu" ctrl type is longer than the 8 bytes long
typebuf hence rename the type into "int menu" and increase
the typebuf buffer in addition to increase alignment during
print of the ctrl values.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-01-27 10:56:27 +00:00
Gaetan Perrot
2c0c5142a6 drivers: clock_control: tisci: drop redundant curr_state check
curr_state is known to be false when reaching the STARTING state
check, making the explicit '!curr_state' condition redundant.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-27 10:54:03 +00:00
Ryan McClelland
7fc848153c drivers: counter: add kconfig for enabling 64b tick api
Add a kconfig to be used as a flag for indicating if it supports 64b
ticks and another flag which will enable the 64b api. The kconfig
indicating that it supports 64b is a dependency of the kconfig that
will enable the api.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Ryan McClelland
779383e769 drivers: counter: add 64bit apis
Add apis for 64 bits.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Ryan McClelland
fd72085d9b drivers: counter: add kconfig for enabling 64b frequencies
Some counters, such as those that use fractional adders, tick at
resolutions greater than 4294967295Hz. This changes the freq in the common
info to a uint64_t. This adds a KConfig that can be selected by a driver.

This also has the counter ticks to sec (and vice versa) helper functions
call the get frequency for 64 bits if the kconfig is selected.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Ryan McClelland
65c2fc6c2f drivers: counter: stm32: implement counter set value api
Implement the counter_set_value api for the STM32.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Ryan McClelland
01a00d5593 drivers: counter: stm32: add counter reset
Add a reset counter api to set the time back to 0.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Gaetan Perrot
af7485c527 drivers: wifi: eswifi: core: make __parse_ipv4_address void
__parse_ipv4_address() never reports errors and always returns 0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-27 08:09:48 +01:00
Pieter De Gendt
941f1e6af5 drivers: otp: Add NXP MCUX OCOTP
Introduce an OTP driver for NXP's MCUX OCOTP.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-27 08:07:53 +01:00
Gaetan Perrot
cd1f21fa07 drivers: clock_control: renesas_rza2m_cpg: remove redundant init
The return value variable was initialized but always overwritten
before being evaluated.

Remove the redundant initialization to simplify the code.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-27 08:07:25 +01:00
Thomas Hebb
477568a2ae drivers: sdhc: imx_usdhc: Automatically mask SDIO interrupt
There are currently two other sdhc drivers that support this interrupt:
Infineon and Ambiq. Both those vendor HALs automatically mask the
interrupt after invoking the callback[1][2], expecting the user to
unmask it asynchronously once they've cleared the card's interrupt
condition.

The NXP usdhc driver doesn't do this and so is inconsistent with the
other two. This has caused bugs with higher-level drivers, such as the
AIROC Wi-Fi driver (#101100). Fix the issue by masking the interrupt
ourselves.

[1] 470f874ce4/mtb-hal-cat1/source/cyhal_sdhc.c (L1251-L1260)
[2] 5efc022852/mcu/apollo510/hal/mcu/am_hal_sdhc.c (L2256)

Fixes #101100

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2026-01-27 08:06:52 +01:00
John Batch
6289dbdc46 drivers: infineon: clock control: move clock selection to peripherals
Moves clock selection/assignment from the clock driver to the
peripherals that subscribe to the clock.  This allows multiple
devices such as PWM/Counters to share a peripheral clock.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-01-27 08:06:28 +01:00
John Batch
594dc62f8e drivers: infineon: sdhc: adds clock assignment to sdhc device init
Adds making a peripheral clock connection to the initialization for
SDHC.  Other updates to use the clk_dst field from the binding.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-01-27 08:06:28 +01:00
John Batch
9d4ae9b399 drivers: infineon: tcpwm: counter and pwm clock updates
Updates the Infineon Counter and PWM drivers based on the TCPWM device
to connect with a clock.  This update allows multiple devices to connect
to the same peripheral clock, and supports the TCPWM architecture of the
PSC3 device family.

Corrects initialization of the PWM on the PSC3 family to select the
correct output type.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-01-27 08:06:28 +01:00