Commit graph zephyr/drivers
Author SHA1 Message Date
Ali Hozhabri
9a440ec18f drivers: bluetooth: hci: Introduce bt_spi_close to support bt_disable
Introduce bt_spi_close function to support bt_disable implementation
in applications.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 12:52:30 +03:00
Pierrick Guillaume
27b0e47f3b drivers: hwspinlock: sqn: add reg-width dts property
The size of each spinlock register might vary depending on the SoC.
Make it configurable in the devicetree.

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
2025-10-03 12:52:18 +03:00
Pierrick Guillaume
2c86e65e71 drivers: hwspinlock: sqn: use cluster id instead of core mpidr
Using the mpidr of the core to lock the hwspinlock meant it acted as
a spinlock in the cluster itself, which is exactly the opposite of what we
tried to achieve.
Additionally, this tied the driver to the arm architecture, even though the
HW was not.

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
2025-10-03 12:52:18 +03:00
Pierrick Guillaume
7678c85498 drivers: hwspinlock: update default init priority
HWSPINLOCK drivers should be initialized very early in the kernel life, so
they can be used by other drivers without breaking their init dependencies.
Use the default init priority (40), instead of default device init
priority (50).

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
2025-10-03 12:52:18 +03:00
Pierrick Guillaume
176e2a424f drivers: hwspinlock: add zephyr spinlock per hwspinlock
HWSPINLOCK are used to protect accesses to shared resources between
clusters. However, we don't want to sleep or be preempted while holding
a HWSPINLOCK. This means we need to lock IRQs while holding the
HWSPINLOCK.
Moreover, in an SMP context, we need to protect accesses to a HWSPINLOCK
between cores, so it is not possible to lock or release the same
HWSPINLOCK multiple times.

Introduce a zephyr spinlock per HWSPINLOCK to counter those issues. User
facing APIs have been udpated to take into account those changes, and a new
hwspinlock_dt_spec struct has been added to align with other subsystem on
the management of complex device's data.

Take the opportunity to rename public APIs to match the naming scheme of
normal zephyr spinlocks:
hwspinlock_lock -> hw_spin_lock
hwspinlock_trylock -> hw_spin_trylock
hwspinlock_unlock -> hw_spin_unlock

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
2025-10-03 12:52:18 +03:00
Pierrick Guillaume
403b4ef84b drivers: hwspinlock: remove syscall support
HW spinlocks are not supposed to be used by user application. They are used
to protect shared resources between clusters. Consumer of such spinlocks
should be other drivers in kernel space.
Moreover, syscalls were actually not generated properly because of
a missing call to zephyr_syscall_header() in CMakeLists.txt.

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
2025-10-03 12:52:18 +03:00
Alvis Sun
6664958107 drivers: flash: npcx: support GDMA operation for NPCXn and NPCKn
1. Introduced GDMA support for efficient data transfer in the
NPCX FIU QSPI driver.
2. Refactor flash driver mutex handling to enhance concurrency safety,
preventing other threads from preempting erase/write operations during
UMA until mutex release.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2025-10-03 12:51:55 +03:00
Quang Le
50eb0fb847 drivers: gpio: renesas: Fix fail case pin_get_config
Add condition to check whether the pin is set as output before
reading the output high or low for gpio driver of Renesas RZ

Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-10-03 12:51:33 +03:00
Hou Zhiqiang
a3e9b59139 drivers: pinctrl_imx: add mimx9111 support
Add pinctrl driver support for MIMX9111.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Jiafei Pan <jiafei.pan@nxp.com>
2025-10-03 12:51:13 +03:00
Hou Zhiqiang
d84317fe61 drivers: clock: ccm_rev2: add mimx9111 support
Add clock driver support for MIMX9111.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Jiafei Pan <jiafei.pan@nxp.com>
2025-10-03 12:51:13 +03:00
cyliang tw
e29c4143bb drivers: rtc: modify Nuvoton numaker driver for compatibility
For compatibility, do not use spare registers to store mask data.
RTC mask data can be generated through the calendar and time mask
registers at runtime.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2025-10-03 12:50:36 +03:00
Jordan Yates
b5177b159a modem: modem_cellular: assert reset pin for duration
Assert the reset pin for the duration specified by the modem
(`reset_pulse_duration_ms`) when booting, instead of immediately
de-asserting the pin.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-03 12:49:47 +03:00
Jordan Yates
54088f69c3 modem: modem_cellular: prioritise reset pin on failure
Prioritise asserting the reset pin when a script fails instead of the
power pin, as the reset pin is a "harder" reset mechanism.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-03 12:49:47 +03:00
Jordan Yates
131bec5b1b modem: modem_cellular: delay after reset de-assert
Add a delay after de-asserting the reset pin before pulsing the power on
pin, if both are enabled.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-03 12:49:47 +03:00
Jordan Yates
0ba20dd96c modem: modem_cellular: revert baudrate on reset
Revert the UART port baudrate to its original value after performing a
pin reset on the modem.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-03 12:49:37 +03:00
Erwan Gouriou
47ed50c31c drivers: ethernet: stm32n6: Use zephyr symbol for alignment attribute
Rather than symbol coming from the HAL, use zephyr `__aligned()` macro.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-10-03 12:49:14 +03:00
Erwan Gouriou
36192a4053 drivers: ethernet: stm32n6: Remove attributes from extern definitions
Compilers may not like that attributes are provides in actual and extern
definitions of symbols.
Removing them from extern definitions

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-10-03 12:49:14 +03:00
Erwan Gouriou
4a875c0b39 drivers: ethernet: stm32n6: Fix phy modes declarations
Phy modes declarations where not correctly placed for use with N6 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-10-03 12:49:14 +03:00
Alberto Escolar Piedras
d83ebce959 drivers/serial/uart_native_tty: Set TTY to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
07987cc539 drivers/serial/uart_native_pty: Set PTY to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
b850715a29 drivers/net/nsos: Set socket to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
19b181e58e drivers/input/linux_evdev: Close input file on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
e5d6e0ce24 drivers flash_simulator_native: Set flash file to close on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
9f00584eab drivers eth_native_tap: Set socket to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
d91565cd3a drivers eeprom_simulator_native: Set EEPROM file to close on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
01118e2657 drivers can_native_linux: Set socket to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set for them.
(This default behaviour is usefull for stdin/out/err so that new process
is kept connected to them, but it is very rare for it to be usefull for
any other descriptor)

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from using them (for example
if the child survives the parent but it does something else while keeping
a port open).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Sylvio Alves
7c1193c813 udc_dwc2: fix off-by-one in TX FIFO unset check
Fix the check in dwc2_unset_dedicated_fifo() that wrongly included the
current endpoint when testing for higher FIFOs. This caused false
warnings and early returns.

Use ~BIT_MASK(ep_idx + 1) to only test FIFOs above the current EP.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-10-02 21:59:14 +02:00
Jakub Michalski
30092cfcce drivers: virtio: virtio_pci: fix virtqueue overallocation
virtio_pci_init_virtqueues was allocating more virtqueues than
specified by num_queues param if data->common_cfg->num_queues
was greater than num_queues

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
2025-10-02 21:59:01 +02:00
Guillaume Gautier
d76e0004fe drivers: pwm: stm32: kconfig: remove ll_tim selection
Usage of stm32xxxx_ll_tim.c has been removed so we can also remove the
selection of USE_STM32_LL_TIM from the Kconfig.
Also remove the LL_RCC that plays no part in the driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-02 21:58:55 +02:00
Guillaume Gautier
1d2029a137 drivers: counter: stm32: kconfig: remove ll_tim selection
Usage of stm32xxxx_ll_tim.c has been removed so we can also remove the
selection of USE_STM32_LL_TIM from the Kconfig.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-02 21:58:55 +02:00
Guillaume Gautier
a02e1c70dd drivers: counter: stm32: rtc: remove init struct
Remove the calls to LL_RTC_Init, LL_RTC_DeInit and LL_RTC_ALMA_Init in
the RTC counter driver. This avoids calling functions from
stm32xxxx_ll_rtc.c.
They are replaced by a set of simpler functions from the header file.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-02 21:58:55 +02:00
Guillaume Gautier
bb2eb4e8b0 drivers: rtc: stm32: remove calls from ll source file
Remove all function calls for functions that are defined in the
stm32xxxx_ll_rtc.c and replaces them by simpler calls from the header file.
Also remove the use of LL_RTC_AlarmTypeDef since no functions from the
header file uses it.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-02 21:58:55 +02:00
Bjarki Arge Andreasen
5fd26a6cb7 drivers: adc: nrfx_saadc: implement PM device runtime
The NRFX SAADC device driver needs to implement PM DEVICE for it
to work with power domains, which is required for some SoCs. Inline
PM device runtime "self get/put" pm has been implemented for the
normal sync read API.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-10-02 21:58:14 +02:00
Luis Ubieda
f7dfcfbad6 spi: lpspi: Add include guards to common header file
Not motivated by any impacted functionality but rather following good
practices. Recursive inclusions may be confusing and hard to diagnose.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-02 21:57:37 +02:00
Luis Ubieda
97eb3eb1dd spi: lpspi: Extract FIFO length query helpers to common header file
To remove code duplication.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-02 21:57:37 +02:00
Luis Ubieda
df7b1a14b1 spi: lpspi: rtio: Re-introduce native RTIO support
This version is based on the CPU LPSPI driver, directly implementing
the submit call following the non-blocking asynchronous pattern.

This has been re-introduced after struggling to keep up with data
streaming applications, which demands reduced and controlled latency,
which for the default implementation (using RTIO workqueue) is not
guaranteed, due to being serviced by a thread-pool vs directly in the
ISR context.

This version includes limited feature-set, yet stress-tested:
- Required both rx-fifo and tx-fifo to be equal.
- 8-byte words supported only.
- SPI Controller-only supported (target mode not included).
- SPI_HOLD_ON_CS only supported with CS GPIOs.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-02 21:57:37 +02:00
Szymon Janc
9985a090fc bluetooth: hci: userchan: Implement close callback
This allows to use bt_disable() also in native_sim build.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-02 16:49:16 +02:00
Adam Mitchell
dcc61ae437 drivers: clock_control: Set maximum frequencies for CONFIG_SOC_STM32H742XX
Adds missing check to set maximum clock frequencies for stm32h742xx

Signed-off-by: Adam Mitchell <adam.mitchell@brillpower.com>
2025-10-02 16:49:08 +02:00
Alexander Kozhinov
783d4a141f opamp: adjust modes enum to avoid clash with STM32 HAL macros
In the enum opamp_functional_mode becomes prefix
OPAMP_FUNCTIONAL_MODE_ to avoid clash with STM32 HAL macros
The suffix _MODE were removed to make the names shorter

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2025-10-02 16:48:49 +02:00
Arthur Gay
181082e84e drivers: i2s: i2s_ll_stm32: add support for IO swap
This commit adds a new property in the device-tree bindings for swapping
the serial data input and output pins of the SPI/I2S peripheral for
STM32 microcontrollers that support it.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2025-10-02 16:48:29 +02:00
Arthur Gay
d1ea7534c6 drivers: memc: stm32_ospi_psram: make NCS boundary configurable in dt
Limit a transaction to a boundary of aligned addresses. Each PSRAM may
specify different configuration.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2025-10-02 16:48:11 +02:00
Arthur Gay
1e966ba478 drivers: memc: stm32_xspi_psram: make NCS boundary configurable in dt
Limit a transaction to a boundary of aligned addresses. Each PSRAM may
specify different configuration.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2025-10-02 16:48:11 +02:00
Arthur Gay
53f91ea8ed drivers: spi: spi_ll_stm32: add support for IO swap
This commit adds a new property in the device-tree bindings for swapping
the MISO and MOSI pins of the SPI/I2S peripheral for STM32 microcontrollers
that support it.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2025-10-02 16:48:04 +02:00
Alain Volmat
e7aa49c60b drivers: video: dcmi: correct clock_control_subsys_t cast
Correct the clock_control_subsys_t cast in calls of the
clock_control_ framework.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-02 16:47:53 +02:00
Alain Volmat
c3995b65ba drivers: usb: udc: stm32: avoid unnecessary clock_control_subsys_t cast
Avoid incorrect (clock_control_subsys_t *) incorrect cast and
remove the cast of pclken in calls to the clock_control_
framework.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-02 16:47:53 +02:00
Alain Volmat
00fd580132 drivers: mbox: stm32-hsem: correct clock_control_subsys_t cast
Correct the clock_control_subsys_t cast in calls of the
clock_control_ framework.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-02 16:47:53 +02:00
Alain Volmat
c927d9ee09 video: stm32: dcmipp: correct clock_control_subsys_t cast
Correct the clock_control_subsys_t cast in calls of the
clock_control_ framework.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-02 16:47:53 +02:00
Mario Paja
5a0d4e106d drivers: i2s: stm32_sai: add support for stm32g4xx series
STM32G4xx series shares several DMA configurations with
the other platforms. These changes aim to enable platform
specific DMA configuration and align them to other platforms.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-10-02 16:47:45 +02:00
Christian Mauderer
f042a1cca0 drivers: spi: mchp_mss: Avoid sending extra bytes
The driver did send some extra 0 bytes when the receive hasn't been
finished yet. This patch makes sure to avoid that.

Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
2025-10-02 16:47:38 +02:00
Christian Mauderer
a52206201c drivers: spi: mchp_mss: Handle NULL buffers better
At the moment, if you would pass a NULL buffer to the driver, the rx and
tx counts of that buffer would not advance. This patch fixes that.

Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
2025-10-02 16:47:38 +02:00