Commit graph

25,525 commits

Author SHA1 Message Date
Philipp Steiner
7632193e42 drivers: fuel_gauge: apply clang-format rules for the drivers
Format existing drivers according to clang-format rules.
Not all drivers were formatted, according to the clang-format rules,
this commit resolves this.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2025-09-04 21:03:48 +02:00
Philipp Steiner
175dc28b1f drivers: fuel_gauge: Refactor public driver interfaces
Refactor drivers so all have the same clean public interface.
With this change, all drivers have the same coding style.
This change does not change how the driver works and was tested with
the "fuel-gauge-build all test"

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2025-09-04 21:03:48 +02:00
Wajdi ELMuhtadi
f9081725cf drivers: sensor: wsen_isds_2536030320001: add sensor driver
Add wsen_isds_2536030320001 driver with
the corrected name and compatibility with
the hal update as well as added new features.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2025-09-04 21:03:10 +02:00
Vit Stanicek
1c0ae3cc18 drivers: dma_mcux_lpc: Sanitise chan. data overrun
Add a num_of_allocated_channels field to struct dma_mcux_lpc_config. Add
a a capacity check for dma_X_channel_data_arr in dma_mcux_lpc_configure.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-09-04 14:42:27 +02:00
Tony Han
1fd4886ad9 drivers: ethernet: phy: ksz8081: add support for interrupt mode
Enable Link-Up and Link-Down interrupts. On the interrupt handling
the monitor work is scheduled to update the link status and calling
corresponding callback routine.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-04 11:26:38 +02:00
Tony Han
44845e16b6 drivers: ethernet: ksz8081: move init_int_gpios() to after reset
Call ksz8081_init_int_gpios() after phy_mc_ksz8081_reset() due to
keep the configurations for interrupt.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-04 11:26:38 +02:00
Tony Han
e2113ce2c5 drivers: ethernet: ksz8081: fix internal flags for auto-negotiation
Update the internal driver flags to avoid setting DO_AUTONEG_FLAG
unconsciously when setting LINK_STATE_VALID.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-04 11:26:38 +02:00
Declan Snyder
10e379c7fb soc: mcx: Add mcx cmc hwinfo binding
Add a stupid binding for doc purposes. Terrible coupling when we have to
configure DT in order to generate documentation properly. At least we
get rid of one of the stupid HAS_MCUX_ kconfigs in the process.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-04 08:11:43 +02:00
Bas van Loon
8d417a31a2 drivers: sdhc: imx_usdhc: Add more verbose error reporting.
When USDHC_Reset fails, we should be more verbose about it failing. Add
the error prints here so that we can observe the failure in logs.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
2025-09-04 08:10:40 +02:00
Bas van Loon
04d40ecc68 drivers: sdhc: imx_usdhc: Fix USDHC_Reset reset type.
Probably a C/P error. This error was leading to reset timeouts as the
wrong mask is being used.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
2025-09-04 08:10:40 +02:00
Felix Wang
193e9170bb drivers: Counter: FTM Support on Zephyr
1.Update dts bindings to move clock-source properties from
nxp,ftm-pwm.yaml to nxp,ftm.yaml.
2.Provide counter driver based on FTM driver from NXP mcux-sdk-ng

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-09-04 08:10:20 +02:00
Carles Cufi
267469b503 flash: spi_nor: Fix VLA error when building with clang
The following error is issued by clang when building with
SPI_NOR_SFDP_RUNTIME enabled:

error: fields must have a constant size:
'variable length array in structure' extension will never be supported
1379 | uint32_t dw[MIN(php->len_dw, 20)];

Instead, hardcode the array length to 20 32-bit words (it's instantiated
in the stack anyway).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-09-03 21:21:27 +02:00
Mickael Bosch
bfea9cf94f drivers: serial: stm32: fix non-LP UARTs with PM
Re-configure the registers if they re erased because of a STOP2 low power
mode.

Return the error code when re-initializing the UART after a STANDBY low
power mode.

Fix few typos and comments.

Run clang format on uart_stm32_pm_action()

Signed-off-by: Mickael Bosch <mickael.bosch@linux.com>
2025-09-03 17:05:17 +02:00
Jeremy Dick
f7757d5f92 drivers: spi: spi_renesas_ra Remove reference to undefined PM device
Remove a reference to get a PM device that isn't defined

Signed-off-by: Jeremy Dick <jdick@pivotint.com>
2025-09-03 17:04:30 +02:00
Jeremy Dick
f51f86e13a drivers: spi: spi_renesas_ra Don't stop SPI transactions early
Don't stop polled SPI transactions early if they aren't read and write

Signed-off-by: Jeremy Dick <jdick@pivotint.com>
2025-09-03 17:04:30 +02:00
Jeremy Dick
f2fb6f5244 drivers: spi: spi_renesas_ra Use the correct hardware chip select
Choose the chip select based on the slave ID for SPI transactions

Signed-off-by: Jeremy Dick <jdick@pivotint.com>
2025-09-03 17:04:30 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Benjamin Cabé
7d45d3e821 driver: gicv3: doc: fix spelling errors in kconfig file
fixed a few typos / spelling mistakes

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Benjamin Cabé
89fef8aa6d doc: correct the spelling of "comparison"
s/comparision/comparison/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Miguel Gazquez
84cfd706e9 drivers: sensor: lsm9ds1: use consistent variable name data
In both lsm9ds1 and lsm9ds1_mag drivers, the device data structure is
generally referenced with the variable name data.
However, in the initialization functions, the variable was named
lsm9ds1 (or lsm9ds1_mag for the magnetometer), which breaks this
convention.

Rename these variables to data for consistency across the driver.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-09-03 14:58:30 +01:00
Miguel Gazquez
6ce58d4d71 drivers: sensor: lsm9ds1: add device PM support
Adds support for device PM for the lsm9ds1 sensor, putting the sampling
frequency of both the accelerometer and the gyroscope at 0 when the device
is suspended.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-09-03 14:58:30 +01:00
Johann Fischer
70a68dfe3c drivers: udc_kinetis: allocate control OUT length as multiple of MPS0
Controllers that use buffers directly must always allocate the length of
the control OUT buffer as a multiple of the control endpoint MPS.
Kinetis UDC driver explicitly checks the remaining buffer size and
finishes the transfer earlier.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-09-03 14:55:50 +01:00
Johann Fischer
d493523b76 drivers: udc_kinetis: fix typo and remove unused variable
Fix typo und remove unused variable, add a check for buffer allocation.
Do not disable controller on udc_disable.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-09-03 14:55:50 +01:00
Johann Fischer
e61cd224dd drivers: udc: do not reset odd buffer flag on endpoint enable
Some controllers, such as those used in Kinetis devices, do not provide
a way to reset the buffer descriptor flags for each endpoint. Do not
reset the odd flag on endpoint enable, as this will cause it to become
out of sync with the hardware.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-09-03 14:55:50 +01:00
Benjamin Cabé
11a9096c7c drivers: rtc: ds3231: fix uninitialized variable error
Until recently this driver wasn't built in CI. Now that it is, clang
is complaining about `err` possibly being uninitialized in case
`bitmask` is 255. Fix it by actually removing code that was
unnecessarily trying to access the uninitialized variable.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 11:04:07 +02:00
Erwan Gouriou
47de4d1d9e drivers: stm32: Make use of new GET_INSTANCE DMA macro
Use the new macro and factorize code when possible.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-03 11:03:31 +02:00
Erwan Gouriou
67d2281ffe drivers: stm32: Keep DMA stream offset handling internal to driver
In HAL based stm32 drivers, dma handling is done internally to HAL.
Though, in order to avoid a dma_config() call is done to ensure stream
will be set as busy in zephyr dma driver to avoid potential resource
sharing conflict.
This dma_config() call was done while taking into account
STM32_DMA_STREAM_OFFSET, which is wrong as it will prevent zephyr dma
driver to set the right stream as busy.
Fix this in impacted drivers.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-03 11:03:31 +02:00
Erwan Gouriou
db1d31e938 drivers: dma: stm32: Minor indentation fix
Makes it easier to grep.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-03 11:03:31 +02:00
Erwan Gouriou
b9577e6edb drivers: dma: stm32: Align channel offset handling in all API functions
To ease code understanding of offset handling within the driver,
harmonize its treatment within impacted functions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-03 11:03:31 +02:00
Erwan Gouriou
5e4bf3780d drivers: dma: stm32u5: Clean up stream offset code
STM32_DMA_STREAM_OFFSET is defined as 0 in case "dma u5" is in use.
Clean up code relating to this define.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-03 11:03:31 +02:00
Erwan Gouriou
d50ad1cfd9 drivers: disk: sdmmc: stm32l4: Select DMA if enabled in dt
On STM32L4, similarly to other STM32 series, enable DMA directly based
on dt configuration and avoid need to configure it at application level.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-03 11:03:31 +02:00
Tony Han
06fc36e496 drivers: ethernet: sam_eth: get the register address from parent node
Get the register address from the common parent node as the device
tree updated in the last commit.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-03 08:56:44 +02:00
Mario Paja
5af3adf66f drivers: i2s: stm32_sai: fix h7xx DMA configuration
This change fixes STM32H7xx dma configuration.
PeriphInc and MemInc should be the same for both directions.
MemDataAlignment should be set to DMA_MDATAALIGN_HALFWORD

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-09-03 01:44:22 +02:00
Aditya Chopra
32789e550d drivers: sensor: paj7620: Fix potential integer overflow in driver
Fix Coverity issue CID 524766: A potential integer overflow could occur
in paj7620_set_sampling_rate() due to multiplication of
sensor_value->val1 instance(which is of type int32_t) with 1000000
without typecasting it to int64_t.

Fixes #90482

Signed-off-by: Aditya Chopra <adityachopra2912@gmail.com>
2025-09-03 01:41:47 +02:00
Mario Paja
a5107fbc0a drivers: i2s: stm32_sai set mem_block to NULL after STOPPING
Set mem_block to NULL after the STOPPING command in order to exit
TX callback at the end of the buffer transmission.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-09-03 01:40:09 +02:00
Mario Paja
abb3c2a472 drivers: i2s: stm32_sai fix tx callback mem_block release
This change fixes a wrong buffer release on tx callback which
was not correctly fixed by
https://github.com/zephyrproject-rtos/zephyr/pull/94696.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-09-03 01:40:09 +02:00
Jeppe Odgaard
451193f2e3 drivers: sensor: explorir_m: check transceive return value in init
Check `explorir_m_uart_transceive`'s return value in `explorir_m_init` and
return the value if not 0.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-09-03 01:32:37 +02:00
Benjamin Cabé
abc03fe279 drivers: rtc: ds3231: make header file private
rtc_ds3231.h only contains register definitions and bitmasks used
internally by the driver - make this header file private.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 01:24:15 +02:00
Adib Taraben
4ca352b052 phy_adin2111.c: correctly assign state parameter with state from device
This fixes an unintialized variable access problem in callback.

Signed-off-by: Adib Taraben <theadib@gmail.com>
2025-09-03 01:18:54 +02:00
Shan Pen
cdd4460a31 drivers: disk: sdmmc_stm32: Add compatibility macros for STM32F4 SDIO
Add compatibility macros to map SDMMC constants to SDIO equivalents
for STM32F4 series MCUs. STM32F4 uses SDIO peripheral with SDIO_*
constants while newer STM32F7/H7 series use SDMMC peripheral with
SDMMC_* constants.

This fixes compilation errors on STM32F4 platforms where SDMMC_*
constants are undefined:
- SDMMC_CLOCK_EDGE_RISING
- SDMMC_CLOCK_BYPASS_ENABLE/DISABLE
- SDMMC_CLOCK_POWER_SAVE_ENABLE/DISABLE
- SDMMC_HARDWARE_FLOW_CONTROL_DISABLE

Fixes zephyrproject-rtos/zephyr#94896

Signed-off-by: Shan Pen <bricle031@gmail.com>
2025-09-02 21:40:24 +02:00
Liam Ogletree
97752191f4 drivers: flash: Add support for Atmel AT25 SPI flash variant
The AT25XV021A variant is a flash variant of Atmel's AT25 family
that adds extra protections, requiring additional writes to the
device to program or erase data.

This commit adds a flash driver for AT25XV021A devices instead of
modifying (1) the existing AT45 SPI flash driver or (2) the
existing AT24/25 EEPROM driver because this variant poses
fundamental changes that affect all aspects of the driver.

Notably,
 - AT25XV021A includes a second status register, and the format
	and functions of the existing status register is
	changed from the existing drivers.
 - AT25XV021A requires executing page or chip erase commands
	before writing, making it incompatible with the
	existing AT24/25 EEPROM driver.
 - AT25XV021A adds a software protection layer that requires
	extra writes before executing program or erase commands.

Tested writing to and erasing from an AT25XV021A device. Tested
reading from an AT25XV021A device across page boundaries. Tested
chip erase function. Tested driver initialization from varying
initial hardware states.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2025-09-02 21:40:07 +02:00
Terry Geng
1f53d6a2d3 drivers: spi: spi_pico_pio: Remove pio from ...data
Make use of the inline function to reduce unnecessary variables.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-09-02 21:39:55 +02:00
Terry Geng
814750d115 drivers: misc: pio_rpi_pico: Make pio_rpi_pico_get_pio inline.
The `pio` value is stored in the internal `pio_rpi_pico_config` structure
that is not exposed. However, it is the first element of the structure.
Here, I convert the pointer to `pio_rpi_pico_config` into a pointer to PIO
to access this value.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-09-02 21:39:55 +02:00
Joel Guittet
7837f5e509 drivers: wifi: esp32: fix integration of connection manager
Connection manager doesn't depends on ESP32 Wi-FI AP+STA mode.
This modification fix integration of connection manager binding
in the Wi-Fi ESP32 driver.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2025-09-02 18:43:56 +02:00
Jordan Yates
03513a6910 lora: lbm: choice of reported RSSI type
Add a choice of which RSSI type should be reported to the application
layer, packet RSSI (which stops at the noise floor) or signal RSSI
(which estimates the LoRa signal strength into the noise floor).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
611e14bd6d lora: lbm: enable SX126x RX boost option
Add the option to enable the RX boost mode in devicetree.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
38384e1233 lora: LoRa Basics Modem backend for SX12xx chips
As a first integration of the LoRa Basics Modem backend, implement the
LoRa API for the standard SX126x/SX127x chips.

Much of the logic from `lbm_common.c` is taken from the loramac-node
`sx12xx_common` implementation, but it should now be agnostic for all
LoRa RF transceivers.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
01c97e205d lora: shift drivers to dedicated loramac-node folder
Move the current implementation of the LoRa API using `loramac-node` to
a dedicated folder in preparation for the LoRa basics modem
implementation.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Erwan Gouriou
c7086c7e67 drivers: flash_stm32_xspi: Fix Dummy Cycles on MX66UM1G45G NOR at 200MHz
This commit is fixing configuration of mx66uw1g45g NOR when working
at 200MHz.
According to its specification, when running at 200MHz, this memory should
use a Number Dummy Cycles configuration of 20 (DC bits in CFGR2), which is
the device's default configuration.
Applying the 66MHz configuration as done today was preventing flash to run
at frequency higher than 100Mhz.

This commit doesn't solve the more generic problem of this driver which
is applying this 66MHz configuration universally, irrespective of the
frequency and the memory device, but fixes the configuration which was
reported broken today.

Providing a global change would require starting a clear split between XSPI
controller configuration an bus device configuration, which is what new
MSPI API intend to solve, so this will be tackled once this driver will be
available.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-02 15:54:56 +02:00
Benjamin Cabé
c820085376 drivers: timer: stm32: fix typo in kconfig help
Corrected the LSE frequency value from 32678 to 32768.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-02 15:54:48 +02:00