Commit graph

25,525 commits

Author SHA1 Message Date
Luis Ubieda
a2acc86429 fix: icm42688: fix: Override FSR settings when high-res is enabled
When IMU is set to stream with High-res mode, the FSR settings are
fixed for ICM42688 at 16g and 2000dps.

Unless this is enforced, the driver will provide incorrect scaling for
readings coming through streaming when the current FS setting is any
different than these.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-07-08 13:38:36 -05:00
Gaetan Perrot
087b7b8890 drivers: ethernet: xilinx: remove unused variable
Clean up unused variable 'ret' and 'link_state' in eth_xilinx_axienet.c to
improve code clarity.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-08 13:37:47 -05:00
Gaetan Perrot
c86f570401 drivers: ethernet: sy1xx: remove unused variable
Clean up unused variable 'rand_mac_addr' in eth_sensry_sy1xx_mac.c to
improve code clarity.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-08 13:37:47 -05:00
Lidor T
0654fb49d8 counter: cmsdk_apb_timer: Use clock freq from DT clocks
Previously, the CMSDK APB timer driver hardcoded the
counter clock frequency to 24 MHz, which limits reuse
across SoCs and boards with different timer clock
sources.
This patch replaces the hardcoded frequency with a value
derived from the device tree's `clocks` phandle, using
the `clock-frequency` property of the referenced clock
controller node. If the property is missing, it falls
back to a default 24 MHz and issues a build-time
warning.

Signed-off-by: Lidor T <lidor@exibit-iot.com>
2025-07-08 13:36:58 -05:00
Johann Fischer
56b359b8f5 drivers: udc_dwc2: do not throw error when FIFO settings can be reused
When the endpoint is re-enabled, check if the current FIFO settings can
be reused. Further work is needed to improve FIFO memory handling for
more advanced interface configurations.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-07-07 16:06:34 -05:00
Armando Visconti
0d7c751bad drivers/sensor: lis2dux12: add 'return' if data has to be dropped
In lis2dux12_read_status_cb() add a return instruction in case of
SENSOR_STREAM_DATA_NOP/SENSOR_STREAM_DATA_DROP.

Fixes: CID 529855

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
df1832e32d drivers/sensor: lsm6dsv16x: add 'return' if data has to be dropped
In lsm6dsv16x_read_status_cb() add a return instruction in case of
SENSOR_STREAM_DATA_NOP/SENSOR_STREAM_DATA_DROP.

Fixes: CID 529864

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
79c098a9d9 drivers/sensors: st: fix Null pointer dereferences
Fix Null pointer dereferences in lis2dux12_read_status_cb() and
lsm6dsv16x_read_status_cb().

Fixes: CID 529873
Fixes: CID 529862

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
1d8bd6bd53 drivers/sensor: lis2dux12: fix uninitialized variable fifo_mode
Set fifo_mode structure to zero and initialize it properly according
to what interrupt event the user has selected.

Fixes: CID 529871
Fixes: CID 529865

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
5792a429c8 drivers/sensor: lsm6dsv16x: fix unreachable code in decoder_decode()
Fix unreachable code in decoder_decode() as reported by Coverity scan.

Fixes: CID 529878

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Van Petrosyan
960a6f036e sensor: lis2dh: cache CTRL1 on PM_DEVICE_ACTION_TURN_ON
Cache CTRL1 into reg_ctrl1_active_val inside lis2dh_init_chip()
in the PM_DEVICE_ACTION_TURN_ON path.  This prevents the first
runtime-PM RESUME from writing 0x00 to CTRL1 and disabling the sensor
when runtime-PM is enabled.

Fixes: #92196

Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
2025-07-05 11:56:00 -05:00
Yong Cong Sin
9696765b56 drivers: syscon: remove unnecessary checks for dev pointer
The `dev` pointer passed to the implementation should never be `NULL`,
remove the checks.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2025-07-04 16:42:53 -10:00
Jordan Yates
9c6e6d781d drivers: lora: rylrxxx: fix snprintf usage
The second argument should unconditionally be the size of the output
memory area, not computationally derived from the input payload length.
The previous length validations would be incorrect when
`cmd_len == CONFIG_LORA_RYLRXX_CMD_BUF_SIZE`, as `snprintf` would be
told the output buffer was `CONFIG_LORA_RYLRXX_CMD_BUF_SIZE + 1` bytes
long.

Fixes #92619
Fixes #92624

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-07-04 16:40:46 -10:00
Peter Mitsis
ec80ab5bb6 drivers: timer: Clean up Cortex-M systick Kconfig
Makes the choice CORTEX_M_SYSTICK_LPM dependent upon the
CORTEX_M_SYSTICK to prevent its default from showing up in
the .config of projects that do not use the CORTEX_M_SYSTICK
timer driver.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-07-04 16:40:31 -10:00
Peter van der Perk
41ef8c3c2f drivers: spi_nxp_lpspi: Don't fetch clockrate from api during configure
The clock get rate api can be slow in certain targets and thus slowing
each SPI transaction. Instead on startup fetch the clock rate and store
this in ram. Then each spi configure action is simply reading that
variable

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-07-04 14:21:35 -10:00
Fin Maaß
19a3b217e5 drivers: ethernet: nxp: don't fail with -EALREADY
don't fail with -EALREADY being returned from
phy_configure_link.

Fixes: #92281
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-04 14:20:55 -10:00
Benjamin Cabé
ee2b9a4e6d drivers: virtio: move virtio headers to zephyr/drivers
Virtio headers are moved to zephyr/drivers/ as they have no reason to be
top-level headers since virtio is a driver class.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-04 15:49:54 -05:00
Raffael Rostagno
26818ee100 drivers: clock_control: esp32c6: Fix clock init at JTAG reset
Peripheral clocks are currently not being disabled for JTAG reset
condition, which causes driver init failures when debugging the SoC
with JTAG. Fix by disabling all clocks for this reset type.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-07-04 15:49:17 -05:00
Gaetan Perrot
9207749e83 drivers: sensor: bma4xx: Avoid potential overflow
Coverity reports a potential integer overflow in the accel_range
computation due to the use of a left shift on an int type.

CID 520269: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)

Even though the register value is constrained to 0–3 by the BMA456 spec,
and no real overflow occurs, an explicit cast to int64_t prevents false
positives and aligns with safe coding practices.

Fixes: #90517

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 15:49:09 -05:00
Gaetan Perrot
ad38ef7333 drivers: counter: Fix redundant identical condition
There was an unnecessary nested `if` in `ifx_cat1_counter_init` with the
same condition already checked in the outer block.

This results in dead and redundant code with no functional impact but
harms readability.

The inner `if (rslt != CY_RSLT_SUCCESS)` was removed to clean up the
function.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 15:48:58 -05:00
Gaetan Perrot
f1c27b6e4a drivers: counter: Fix possible null pointer dereference
The function counter_rz_gtm_set_alarm was accessing alarm_cfg->flags and
alarm_cfg->ticks before verifying that alarm_cfg is non-NULL.

This could lead to undefined behavior or crashes if a NULL pointer is
passed.

The pointer check has been moved before any dereference to fix this bug.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 15:48:49 -05:00
Ryan McClelland
b6d955c648 drivers: i3c: check addr slot is free only if it's different
The bus helpers for SETDASA and SETNEWDA could have the same
dynamic address assigned as it's static addr for SETDASA or
as it's dynamic addr for SETNEWDA. (Althrough, only a clown
would set the new dynamic address to the same old dynamic
address, it is still a valid address to set to).

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-07-04 13:08:33 -05:00
Sylvio Alves
c358861280 drivers: i2c: esp32: drop transfer log error
Drop LOG_ERR calls from driver level related to transfer calls.
Application can handle the result and decide whether to log or not.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-07-04 13:08:23 -05:00
Sylvio Alves
5b876d4c4c drivers: uart: esp32: apply correct mask for TX/RX signal inversion
Build a combined mask from the tx_invert and rx_invert flags and pass it
to uart_hal_inverse_signal(). Only invoke the HAL call when the mask is
non-zero, preventing unintended inversions and eliminating redundant
calls when no inversion is requested.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-07-04 13:08:14 -05:00
Alain Volmat
772fbfe9cc display: stm32: ltdc: fix RGB565/BGR565 format to match sample expectations
The LTDC RGB565 format corresponds to the PIXEL_FORMAT_BGR565 format.
Update the LTDC driver to advertise PIXEL_FORMAT_BGR565 as the supported
format instead of PIXEL_FORMAT_RGB565. This change ensures correct color
rendering in the sample display application and enables usage of the
video capture sample application.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-07-04 13:07:55 -05:00
Alex Hogen
075662d8dc drivers: i2c: gecko: Fix EFM32 I2C target
clang-format on drivers/i2c/i2c_gecko.c

Signed-off-by: Alex Hogen <alex@edt.com>
2025-07-04 13:07:45 -05:00
Alex Hogen
257bcb8d58 drivers: i2c: gecko: Fix EFM32 I2C target
Fix I2C target implementation so NACKs are issued if the callback returns
an error. This allows for proper signaling to the I2C host when commands
or data are invalid for the I2C target.

Signed-off-by: Alex Hogen <alex@edt.com>
2025-07-04 13:07:45 -05:00
Alex Hogen
92f7e8d84b drivers: i2c: gecko: Fix EFM32 I2C target
Fix compile error due to unknown macro when building CONFIG_I2C_TARGET for
Silabs Thunderboard EFM32GG12 (SLTB009A). The previous macro exists in
(all?) EFR32 part headers but not EFM32.

Signed-off-by: Alex Hogen <alex@edt.com>
2025-07-04 13:07:45 -05:00
Van Petrosyan
4197953d3f drivers: modem_cellular: fix bg95dial cmd resp
bg95 modem should respond "CONNECT <text>" when run dial cmd
similar to eg25g

Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
2025-07-04 13:07:12 -05:00
Etienne Carriere
9b022972d8 drivers: rtc: stm32: narrow backup domain access window during interrupts
Change backup domain access gating in STM32 RTC interrupt handler
to only request access when RTC registers ar to be modified
instead of during the whole RTC interrupts service including
interrupt consumer callback execution.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
2025-07-04 13:06:36 -05:00
Etienne Carriere
007d3e3c85 drivers: rtc: stm32: fix unbalanced backup domain access request
Fix the backup domain access request in STM32 RTC initialization that
was unbalanced in case of clock configuration failure.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
2025-07-04 13:06:36 -05:00
Etienne Carriere
c35ddccce4 drivers: counter: stm32: Fix RTC write access requests
Add missing backup domain access requests in STM32 RTC counter
driver that are needed to modify RTC registers.

Remove backup domain access requests in rtc_stm32_read() since this
function only reads RTC registers and backup domain access protection
protects RTC registers against write accesses only.

Fixes issue 92511.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
2025-07-04 13:06:36 -05:00
Gaetan Perrot
de1fa4776b drivers: sensor: bmp581: add const qualifier when casting
Add the 'const' qualifier when casting 'dev->config' to 'struct
bmp581_config *' to preserve const-correctness and fix SonarQube warning :

 "A cast shall not remove any const or volatile qualification from the
 type of a pointer or reference."

This improves maintainability by respecting the const contract and resolve
static analysis issues.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 13:06:22 -05:00
Gaetan Perrot
032c5301de drivers: sensor: bmp581: fix potential null dereference
Move null check for 'dev' before dereferencing it to access dev->config.

This ensures the check is meaningful and avoids undefined behavior in case
of a null device pointer.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 13:06:22 -05:00
David Leach
a132ebfe17 drivers: watchdog: Add enableWait setting for wdt_mcux_imx_wdog
When WDT_OPT_PAUSE_IN_SLEEP option is passed in set enableWait flag
in addition to the enableStop.

Fixes #86437

Signed-off-by: David Leach <david.leach@nxp.com>
2025-07-03 11:57:17 -05:00
Jonathan Nilsen
b18c326946 soc: nordic: move nrf_ironside from drivers/firmware to soc/nordic
Move the IronSide APIs to soc/nordic from drivers/firmware since
these are vendor specific APIs. The header files are now included
from <nrf_ironside/*.h>. Adjust code that uses these APIs accordingly.

Also move the DT binding for "nordic,ironside-call" from
bindings/firmware to bindings/misc.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-02 17:57:45 -05:00
Grzegorz Swiderski
75dd614437 drivers: firmware: nrf_ironside: Update the spelling
s/IRONside/IronSide/g

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-02 17:57:45 -05:00
Chaitanya Tata
4bd1d39c67 wifi: nrf70: Fix system work queue stack size override
Defaults cannot be overidden (even with configdefault extension), they
only work if the original symbol is defined after the override e.g.,
"drivers and then subsys/net" but for kernel symbols,the default value
overrides don't work due "kernel and drivers" order, the kernel defines
the original symbol with the default and then it cannot be overridden.

Move the kernel symbol override to the original definition to make it
affect. Else any sample that uses nRF70 but doesn't enable WPA
supplicant ends up with 1024 and crashes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-01 19:04:00 -05:00
Gaetan Perrot
7d5902dd1b drivers: akm09918c: fix null dereference in submit function
Fix a null pointer dereference in akm09918c_submit(), where writeByte_sqe
was dereferenced before checking if it was NULL.

Coverity reported this as CID 516247: the pointer returned by
i2c_rtio_copy_reg_write_byte() may be NULL, and accessing its `flags`
field before checking leads to undefined behavior.

Move the access to writeByte_sqe->flags after confirming both
writeByte_sqe and cb_sqe are valid.

Fixes: CID 516247

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-01 19:03:19 -05:00
Mike J. Chen
9eaed805c1 drivers: audio: dmic_mcux: init active_buf_idx when setting up dma
In case the dmic had previous been run and stopped,
make sure active_buf_idx is initialized to 0 when
setting up dma on start, otherwise the dma callback
can return the wrong buffer.

Also purge the rx_queue before freeing the slab buffers,
to minimize risk of any async read request getting
back a slab buffer that is freed.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-07-01 19:03:07 -05:00
Declan Snyder
2e0357c4c4 drivers: spi_nxp_lpspi: Fix extra byte issue on v1
The interrupt handling was not deterministic before because it relied
on "guessing" if the lpspi was a v1 type that was stalling due to design
errata. This obviously ended up being wrong in some cases. So we really
need to fix this so that it is deterministic, and my idea to do that is
to explicitly count how many words we have written to the TX fifo
throughout the whole transfer.

As a side effect of making the IRQ more deterministic, we can't support
the SPI_HOLD_ON_CS flag for v1 LPSPI anymore. It is fundamentally
impossible due to the fact that the transfer can only complete in
hardware as a result of CS deasserting. If this is absolutely a
requirement to support this flag in the future, my recommendation is to
update the driver so that it muxes the pin to a gpio before ending the
transfer, but that would kind of defeat the point of having a native CS,
at least at the end of the xfer.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-01 11:00:43 -10:00
Ofir Shemesh
b2d7094f15 drivers: ethernet: nxp_enet: Fix PHY configure for fixed-link config
Update the driver to handle -ENOSYS from phy_configure_link(), which is
now returned when the cfg_link callback is missing (e.g., in fixed-link
PHYs).

Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
2025-07-01 10:59:32 -10:00
Pisit Sawangvonganan
b8a8173c1f drivers: kconfig: fix typo
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `drivers` directory.
Additionally, incorporates a fix recommended by the reviewer.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-07-01 10:58:54 -10:00
Cong Nguyen Huu
c52ba71f94 drivers: introduce support Peripheral Sensor Interface (PSI5) driver
This driver allows to communication (send, receive) with PSI5 device

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2025-07-01 10:53:59 -10:00
Alberto Escolar Piedras
3197e7a89d drivers/fuel_gauge/lc709203f: Avoid declaring var right after label
Avoid the following clang error
`error: label followed by a declaration is a C23 extension`
by writing this switch case as a codeblock.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-01 05:56:25 -10:00
Łukasz Stępnicki
24322c609f drivers: nrf_ironside: dvfs abb analog status workaround
Until register ABB->STATUSANA is visible it must be checked using
defined offset to base ABB register.

Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
2025-07-01 10:14:58 -05:00
Fabio Baltieri
b15404f998 uart_bridge: log the device name on bitrate changes
Add a log for the device name on bitrate changes, without this it's very
hard to understand what's going on in a system with multiple bridges.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-06-30 17:39:09 -05:00
Adam Kondraciuk
e77f942cff drivers: timer: nrf_grtc_timer: add last_count initialization
The GRTC counter is not cleared at startup, therefore the
`last_count` variable needs to be initialized accordingly.
This change:
- Prevents overflow of the `sys_clock_announce()` int32_t parameter
- Ensures the correct uptime value, which should be reset during
  initialization

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2025-06-30 15:23:44 -05:00
Tim Lin
0c627e94c8 drivers/pinctrl: ite: Don't clear FUNC3 setting unless alt_func is FUNC3
Previously, FUNC_3 related setting were cleared unconditionally,
regardless of the selected alternate function. This could
unintentionally disable FUNC_3 settings when configuring other
alternate functions.

This change ensures that FUNC_3 gcr/ext bits are only cleared
when alt_func is IT8XXX2_ALT_FUNC_3.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-06-30 15:19:49 -05:00
Imran Sajjad
63ebb75083 soc: imxrt: mimxrt1011 i2s clock fix
Fix for compiling i2s drivers on the NXP mimxrt1010_evk board.
For mimxrt1011, the defines kCLOCK_Sai2... are not defined as the sai2
peripheral does not exist. Trying to compile gives error. Fixed by adding
check for device tree node around code that uses the defines. Also added
same for sai1 and sai3. Thanks @lucien-nxp, @ZhaoxiangJin from NXP.

Signed-off-by: Imran Sajjad <imran.sajjad@iconfitness.com>
2025-06-30 15:19:24 -05:00