Commit graph

25038 commits

Author SHA1 Message Date
Armando Visconti
ea072d31ff drivers/sensor/: lis2dux12/lsm6dsv16x: use helpers
Make use of rtio_read_regs_async() and rtio_flush_completion_queue()
helpers in lis2dux12 and lsm6dsv16x sensor drivers.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-10-07 17:43:32 +03:00
Raffael Rostagno
1d2f012fbe drivers: counter: rtc: esp32: Add LP TIMER support
Add support to LP TIMER peripheral, for ESP32-C6 and ESP32-H2
RTC counter support.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-10-07 12:47:45 +02:00
Raffael Rostagno
01d430826e drivers: counter: rtc: esp32: Fix cancel alarm condition
Disable RTC interrupts when cancelling alarm, and clear callback
data, to make sure no ISR/callback is serviced after alarm is
cancelled. Also, check programmed ticks in ISR to make sure
alarm triggered is not an outdated/cancelled event.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-10-07 12:47:45 +02:00
Raffael Rostagno
16632333a2 drivers: counter: rtc: esp32: Fix overflow case
Fix alarm setting when timer has overflown beyond 32-bit boundary.
Timer is 48-bit, so it requires high word to be programmed along
the 32-bit word managed by the driver.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-10-07 12:47:45 +02:00
Seppo Takalo
5fa605af17 drivers: modem: cellular: nRF91: Remove periodic chat script
Remove periodic chat script as the AT+CEREG=1 notifications are already
enabled.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-07 12:47:19 +02:00
Fabian Blatz
bae6e3563b drivers: rtc: Add nxp,pcf85063a driver
Adds a driver implementation for the pcf85063a I2C rtc.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-10-07 12:47:07 +02:00
Davi Herculano
d1493b60d6 driver: i2s: fix nxp i2s fifo combine values
MCUX defined RX fifo combine names and the
references need to be adjusted in the i2s driver.

Signed-off-by: Davi Herculano <davi.herculano@adam-audio.de>
2025-10-07 11:01:01 +02:00
Elmo Lan
c0a421c329 drivers: i2c_dw: Avoid spamming NACK error messages
NACK message now log with LOG_ERR_RATELIMIT
instead of LOG_ERR to reduce log noise.

When scanning I2C device,
receiving a NACK is expected behavior and not necessarily an error.
Logging it at LOG_ERR causes unnecessary clutter in the logs.

Therefore, the log level is change to LOG_ERR_RATELIMIT for NACK cases.

Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
2025-10-07 10:59:52 +02:00
Jordan Yates
adecb09978 modem: select UART_USE_RUNTIME_CONFIGURE
Override any defaults for `UART_USE_RUNTIME_CONFIGURE` when using
`CONFIG_MODEM_CELLULAR`, as the baudrate update feature depends on it.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-07 10:59:18 +02:00
Charles Hardin
2bfd76425a net: ip: account for the size in the inet_ntop code path
The code was writing to the dst without a verification check on
size which is not appropriate. The guard on the arguements should
be enforced and so just ensure the size is larger then the
definition of the strings from POSIX and return an error in those
cases.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-10-07 10:59:08 +02:00
Alexander Kozhinov
7eb3b41e7d drivers: comparator: implement stm32 comparator driver
implement the driver for the stm32 comparator peripheral

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2025-10-07 10:58:31 +02:00
Jiafei Pan
8e0486d291 drivers: watchdog: wdog32: add imx9352 support
On i.MX 93 platform, no need to clear interrupt flags, otherwise it
will not trigger reset.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Joe Zhou <zhongcai.zhou@nxp.com>
2025-10-06 20:17:50 -04:00
Jiafei Pan
9f6a74506f drivers: watchdog: wdog32: add MMIO mapping support
Added MMIO mapping support in order to support on Cortex-A Core.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-10-06 20:17:50 -04:00
Jan Kablitz
be0e98388c drivers: sensor: st: lis2du12: add SENSOR_TRIG_DELTA support
Extend the LIS2DU12 accelerometer driver with SENSOR_TRIG_DELTA
support. The detection is based on the slope between successive
channel readings. Support for setting SENSOR_ATTR_SLOPE_TH and
SENSOR_ATTR_SLOPE_DUR is added as well. In line with other sensors,
SENSOR_ATTR_SLOPE_TH is configured in SI units (m/s^2) and
SENSOR_ATTR_SLOPE_DUR in samples relative to the ODR. The new trigger
can be mapped either to the same GPIO as the data-ready interrupt or
to a dedicated one.

Signed-off-by: Jan Kablitz <jan.kablitz@8tronix.de>
2025-10-06 15:10:01 -04:00
Daniel Schultz
15d2990b24 drivers: gpio: Add driver for Aesc Silicon
Add basic support for the Aesc Silicon GPIO controller.

This IP core has internal tri-states and therefore a read,
write and direction registers. Additionally, it has advanced
monitoring capabilities for interrupt generation; low or
high leve and rising or falling edge.

Interrupt support will be added later when ElemRV supports
interrupt in Zephyr.

Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
2025-10-06 20:03:28 +03:00
Mike J. Chen
8cd010b701 drivers: mbox: imx_mu: return early in ISR when done
Change the ISR code to return once all pended interrupts
are handled instead of continuing to iterate over
all channels. Common occurence is just for one interrupt
bit to be set so no need to check all bits in all channels
if only one bit is pending.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-10-06 20:03:16 +03:00
Mike J. Chen
13e0588cd2 drivers: mbox: imx_mu: change order of interrupt handling
Handle notification interrupt before data interrupt of
a channel. Notification interrupts are more commonly
used (e.g. for ipc) and clearing the interrupt ASAP
helps reduce the possiblility that the sender finds
the interrupt already pending if it tries to send multiple
ipc messages in quick succession.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-10-06 20:03:16 +03:00
Mike J. Chen
3c80b15aef drivers: mbox: imx_mu: handle all interrupts for a channel
Handle all interrupts for a channel before going to next
channel. Previous code did an if/else check, so if both
a data rx interrupt and a notification interrupt were pending
for a channel, only one would be handled in the ISR. The
ISR would have to fire again (probably would be still pending)
for the other interrupt to be processed. This could even
lead to starvation/delay if another data rx interrupt got
pended again.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-10-06 20:03:16 +03:00
Mike J. Chen
593e2b5fed drivers: mbox: imx_mu: Remove extra interrupt handler layer
Change to pass the device node to IRQ_CONNECT and remove
the intermediate interrupt handler that has to call
DEVICE_DT_INST_GET() to get the device pointer.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-10-06 20:03:16 +03:00
Mike J. Chen
04778ff6cc drivers: mbox: imx_mu: ignore TriggerInterrupt failures
The ipc backends, like icmsg.c, don't expect errors when
using mailbox send for notifications. In some places,
icmsg.c ignores the return value of the mailbox send,
in some places it propagates the error up, and in some
places it asserts.

icmsg only uses the mailbox send with NULL msg as a means
to interrupt the other processor, and all data is passed
via shared memory. So it is safe to ignore the case when
the interrupt is already pending, since the other
processor should handle the pending message when it gets
around the handling the interrupt. As long as the order
of clearing the interrupt is before the handling of the
data, there should be no case where not pending a new
interrupt when one is already pending would result in missing
any new message.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-10-06 20:03:16 +03:00
Adam Kondraciuk
60af28e3f5 drivers: timer: nrf_grtc: Move GRTC initialization to early init
GRTC is used by the logger, so it must be initialized
as early as possible. On the other hand, clock requests
are allowed once the clock control API has been initialized.
This PR introduces a two-stage GRTC initialization to meet
these requirements.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2025-10-06 20:02:28 +03:00
Daniel DeGrasse
79bfd9525e drivers: sdhc: mcux_sdif: report 4 bit bus support
SDIF peripheral supports 4 bit bus width, report this correctly

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-10-06 20:00:29 +03:00
Alberto Escolar Piedras
61e12a4c75 drivers: wifi: eswifi: Fix callback prototype
net_tcp_accept_cb_t takes a socklen_t as 3rd argument,
which type was changed in
c546c1cad1
and is not anymore equivalent to size_t.
So let's correct it.

As a freebie, let's define that function as static as it is.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-06 20:00:20 +03:00
Jordan Yates
f047a412e0 modem: cmux: auto calculate work buffer sizes
Automatically size the CMUX work buffers based on
`CONFIG_MODEM_CMUX_MTU`. This eliminates a Kconfig variable that would
otherwise need to manually be kept in sync. The option to extend the
size of these buffers is still provided through
`CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-06 09:37:26 +02:00
Jordan Yates
e15a65ca23 cellular: update access technologies
Update the defined access technologies to align with the 3GPP standard
TS 27.007. Definitions were copied from version v18.6.0.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-06 09:37:00 +02:00
Jilay Pandya
215df9f320 tests: stepper_api: check is_moving in stepper_api tests
add is_moving check to already existing stepper_api move_by
and move_to tests.
delete corresponding redundant test cases from drv84xx

bugfixes in step_dir_stepper_common.c
- start_stepping shall return 0 instead of return ret since
timing_source_start can return 1 depending on which timing
source in selected
- stop timing source before triggering steps_completed event

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-10-06 09:36:35 +02:00
Jilay Pandya
ee909efaf8 tests: stepper_api: drop test_run_zero_step_interval_correct_position
Setting 0 as microstep interval is invalid. If microstep_interval is
not set then the motion related functions should return -EINVAL.

drop test_run_zero_step_interval_correct_position

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-10-06 09:36:35 +02:00
Ali Hozhabri
51fc4405ac drivers: bluetooth: hci: Add PM support to the STM32WB0x HCI driver
Add PM support to the STM32WB0x Bluetooth HCI driver.

Implement PM event register to wake up the device for its BLE events.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Ali Hozhabri
e4a8b272ec drivers: serial: Enable UART wake-up line in STM32
Enable UART wake-up line in STM32 driver.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Ali Hozhabri
85318a9e19 soc: st: stm32: Provide PM support for STM32WB0x
Provide PM support, specifically suspend-to-ram, for STM32WB0x.

Enable STM32_RADIO_TIMER Kconfig parameter when PM is set.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Ali Hozhabri
bdb41c0ebd drivers: timer: Enable STM32WB0_RADIO_TIMER Kconfig parameter
Use radio timer as the system timer when Bluetooth is used.

Modify CMakeLists.txt to compile radio timer driver when
STM32WB0_RADIO_TIMER is enabled.

Remove the common parts from hci_stm32wb0.c that are present
in the radio timer driver.

Set and retrieve the appropriate value for SYS_CLOCK_TICKS_PER_SEC and
SYS_CLOCK_HW_CYCLES_PER_SEC respectively.

Define radio_timer node and its properties.

Enable radio_timer node in nucleo_wb0x boards.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Ali Hozhabri
84f7098f8f drivers: timer: Provide radio timer driver for STM32WB0x SoCs
Provide radio timer driver for STM32WB0x SoCs.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Ali Hozhabri
f9655654ab drivers: Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for STM32WB0
drivers due to the misunderstanding of its definition.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Fabio Baltieri
37717b229f sys: util: rename Z_MIN Z_MAX Z_CLAMP to min max and clamp
Rename these three macros to an unprefixed lower-case variant. This is
normally not done for Zephyr macros (see container_of) but in this case
it seems like a good idea to adopt the lowercase names to:

1. have the same convention as the equivalent Linux macros, helping devs
   working cross project recognizing (mis)use patterns.
2. make it somewhat intuitive that the lowercase ones are meant to be
   used in functions while the uppercase ones are to be used for static
   evaluation.

Add few c++ guards to avoid colliding with std::min and std::max.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-10-03 21:14:11 -04:00
Loic Domaigne
0dddf35b40 drivers: mfd: axp192 fix EXTEN switch control value
Currently, EXTEN switch control (mapped to GPIO5) is always 0, due to a bug
in the shift value. This has been reported in Coverity CID 353647.

Following the AXP192-X Datasheet, the EXTEN switch control status is
given by bit 2 of the register 10h. If "GPIO5" corresponds to EXTEN
Switch control (AXP192_GPIO5_OUTPUT_MASK is 0x04U), then the shift
AXP192_GPIO5_OUTPUT_SHIFT should be 2, not 3.

Signed-off-by: Loic Domaigne <tech@domaigne.com>
2025-10-03 21:13:31 -04:00
Sylvio Alves
b96687170f driver: led_strip: do not set uart supported
Let the vendor driver defines whether ASYNC is supported.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-10-03 21:07:33 -04:00
Michał Stasiak
ccef0cf132 drivers: pinctrl: nrf: use HAL defines
Replaced MDK symbols with defines from HAL.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2025-10-03 21:07:13 -04:00
Daniel Baluta
54545430e4 drivers: sai: Fix compile time error with clang
After commit 524b72ce40 ("toolchain: llvm: Provide working
BUILD_ASSERT macro") when compiling with clang we have actual
checks and a real assert check using _Static_assert.

Now, when compiling with clang (used by Xtensa internal toolchain)
we get the following error.

$ zephyr/drivers/dai/nxp/sai/sai.c:968:29: error: static_assert expression
 is not an integral constant expression

We get this in asserts like this:

BUILD_ASSERT(SAI_DLINE_COUNT(inst) != -1, "...").

This expands to (reduced the macro to easier understand the context):

_Static_assert(((((((I2S_Type *)(uintptr_t)(1493499904U))) ==
((I2S_Type *)(0x59040000u)))

... and clang complains that this is not a constant expression.

So, in order to fix the compile time error remove the compile time
asserts and replace them with runtime checks.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Fixes: commit 524b72ce40 ("toolchain: llvm: Provide working
BUILD_ASSERT macro")
2025-10-03 21:02:45 -04:00
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