Commit graph

28,390 commits

Author SHA1 Message Date
Alain Volmat
3b0704974c video: gc2145: perform first-second switch for CSI RGB565
Correct the RGB565 format generated by the GC2145 in case of CSI based
RGB565 by setting the Page 0 BYPASS_MODE register switch bit in order
to generate RGB565_LE instead of RGB565_BE.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-11-05 11:34:41 +02:00
Alain Volmat
6b7ad26213 video: stm32_dcmipp: fix parallel interface RGB565 handling
On parallel interface, the DCMIPP is expecting data in what
corresponds to the RGB565_BE formats, aka

	     D7 D6 D5 D4 D3 D2 D1 D0
	     -----------------------
cycle 1:     R4 R3 R2 R1 R0 G5 G4 G3
cycle 2:     G2 G1 G0 B4 B3 B2 B1 B0

The Zephyr RGB565 video format corresponds to the RGB565_LE
hence perform a SWAPCYCLE when RGB565 is used as input format
on parallel interface.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-11-05 11:34:41 +02:00
Andreas Schweigstill
869881ef21 drivers: disk: sdmmc_stm32.c: fix HAL_*_ConfigWideBusOperation
This fixes a compilation error in sdmmc_stm32.c. Depending on the
definition of CONFIG_SDMMC_STM32_EMMC now either
HAL_MMC_ConfigWideBusOperation() or HAL_SD_ConfigWideBusOperation()
gets called.

Signed-off-by: Andreas Schweigstill <andreas@schweigstill.de>
2025-11-04 19:07:52 -05:00
Mathieu Choplain
8619248629 drivers: usb: dc: stm32: fix usb_disable() deadlock on certain series
During a teardown sequence performed by the USB DC stack's "usb_disable()",
the controller is first disabled by calling "usb_dc_detach()", which turns
off the USB controller clock in the STM32 implementation. "usb_disable()"
then disables endpoints by calling "usb_dc_ep_disable()" on each of them,
which is merely forwarded to HAL_PCD_EP_Close() by the STM32 driver. This
order of operations means that the latter operation is actually operating
on the no-longer-clocks USB controller! Up until recently, memory accesses
to MMIO of unclocked peripherals in STM32 SoCs would not cause issues, even
if the resulting access was a no-op (read returns zero, write is ignored),
so everything worked fine even if the access was *technically* illegal...
However, on newer series with a different bus fabric, accesses to unclocked
peripherals will instead deadlock the SoC!

Prevent illegal accesses inside "usb_dc_stm32_ep_disable()" by checking if
the USB controller clock is enabled before calling HAL_PCD_EP_Close(), and
skipping the call if it isn't. This allows "usb_disable()" to complete on
series such as STM32N6.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-11-04 14:00:32 -05:00
Daniel DeGrasse
3d075c4e68 drivers: i2c: i2c_dw: make target stop callback after read/write callbacks
In target mode, issue the stop callback from the I2C DW driver after the
read/write callbacks. This mirrors the behavior of other I2C target mode
drivers, and allows target handler code to correctly service any pending
read or write requests before it handles the stop condition.

Fixes #98675

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-11-04 13:45:34 -05:00
Patryk Koscik
1bd934dbba drivers: uart: ambiq: enable driver for apollo4x
Enable Ambiq serial driver for the Apollo4x SoC series.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2025-11-04 16:53:51 +02:00
Patryk Koscik
0b89d298a1 drivers: uart: ambiq: make driver compatible with apollo4x
This patch makes `uart_ambiq.c` compatible with the Apollo4x SoC series.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2025-11-04 16:53:51 +02:00
Mario Paja
fcaf35ccb3 drivers: i2s: stm32 sai code cleanup
Replace series-specific macros with generic macros shared across
multiple STM32 series to improve readability and maintainability.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-11-04 07:19:50 -05:00
Qingsong Gou
302064c9a5 drivers: i2c: fix CI CMakeStyle error
Replace CMAKE tabs with spaces

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-11-04 07:05:39 -05:00
Arun Kumar Nagelly
4b9bbc5006 drivers: bluetooth: hci: siwx91x: add RF power config
Add vendor-specific RF power mode configuration during HCI setup
for SiLabs SiWx91x devices. This configures the BLE TX power
index in the controller's RF subsystem.

The implementation sends a vendor command (OCF 0x0006) with
protocol mode (2) and power index (RSI_BLE_PWR_INX) during the
setup phase. This ensures proper RF power configuration before
normal Bluetooth operations begin.

Technical details:
- Uses bt_hci_cmd_alloc() with manual HCI header construction
- Command opcode: 0xFC06 (OGF=0x3F, OCF=0x0006)
- Parameters: protocol_mode=2, power_index from RSI_BLE_PWR_INX
- Executed during bt_hci_setup callback

Signed-off-by: Arun Kumar Nagelly <arnagell@silabs.com>
2025-11-04 09:26:46 +00:00
Keith Packard
3e615fa533 drivers: comparator: Silence GCC 14 uninitialized variable warning.
When the renesas-rv-lvd driver is built with SDK 1.0 using GCC 14, the
compiler emits a spurious uninitialized variable warning because it can't
follow the control flow to figure out that the variable wasn't ever used
without being initialized. Work around this by simply initializing it
to one of the valid values.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-11-04 11:26:34 +02:00
Marcelo Cunha
1c2d7f48ee sensor: bq274xx: fix design energy calculation
In the function bq274xx_gauge_configure it was being used an hardocded
value of 3.7V instead of using the design voltage parameter defined in
the device tree.

Signed-off-by: Marcelo Cunha <mcunha@petsafe.net>
2025-11-03 16:59:14 +02:00
Khaoula Bidani
c28d779432 drivers: spi: stm32: Fix race condition causing lockup in half-duplex mode
This patch adds a check for the EOT (End Of Transfer) flag
inside the polling loop in spi_stm32_half_duplex_switch_to_receive().
If EOT is set, the transfer is already complete and the loop
is exited, preventing the lockup.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
2025-11-03 16:59:05 +02:00
Sergei Ovchinnikov
38f8925a91 drivers: mfd: npm13xx: add delay between timer strobing and hibernate
When using I2C clock frequency >= 250 kHz, it's been observed that the
nPM1300 would unexpectedly wake up before requested time has expired. Add
a delay between applying a new timer value and triggering hibernate to
mitigate this.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2025-11-03 10:41:55 +02:00
Yuval Peress
bf0e0b3cad adc: esp32 add missing header
Without this header the logic in adc_esp32.c will never have either
ADC_CALI_SCHEME_CURVE_FITTING_SUPPORTED or
ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED defined. This means
that we always see the warnings aout uncalibrated samples.

Signed-off-by: Yuval Peress <yuval.peress@gmail.com>
2025-11-02 12:34:34 -05:00
Declan Snyder
63868e4301 drivers: mdio_nxp_enet: Remove mistaken busy wait
This busy wait was for debugging purposes and left in by mistake.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-11-01 08:38:28 -04:00
Declan Snyder
51f457088d drivers: ksz8081: Start monitoring phy after init
For some reason, a regression happened where the phy monitor was never
happening. Fix by starting the monitor at the end of init function. The
monitor will then reschedule itself from then on.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-11-01 08:38:28 -04:00
Mario Paja
497209c74e drivers: i2s: mcux sai update TX state after queue is empty
This change sets the TX state to ready after the TX queue
has been emptied.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-10-31 20:04:53 -04:00
Benjamin Cabé
a6a520da26 drivers: fuel_gauge: remove dead code in set_prop functions
Remove useless assignments to `val` parameter in sbs_gauge_set_prop()
and bq27z746_set_prop(). Since `val` is passed by value, modifying it
has no effect. Also remove unused `tmp_val` variable.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-10-31 20:03:00 -04:00
Martin Hoff
6366bd63af drivers: serial: silabs: fix eusart driver with xg22 soc
This commit introduces a compatibility layer for older EUSART hardware
that lacks the RXTO interrupt. It fix the test uart_async_api when using
xg22 soc.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-31 22:40:49 +02:00
Martin Hoff
504eb7d39e drivers: serial: silabs: fix eusart driver when parity param is nok
When running uart_elementary on the xg22 SoC, some tests are failing due
to the lack of checks inside the configuration function. This patch adds
a check for the parity parameter.
I've also noticed an error in the ISR function where we check all the
ISR flags and not only the enabled ones. It has no impact but needs to be
changed in order to be accurate.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-31 22:40:49 +02:00
Declan Snyder
70e45b7039 drivers: spi_mcux_flexcomm: Fix spi slave count check
The current implementation checking for the validity of the spi slave
number is wrong. First of all, there is an off by one error where it
allows SPI_CHIP_SELECT_COUNT value as a valid slave, when really it
should be that value minus one. Secondly, it doesn't take into account
the fact that having software controlled GPIO CS can technically have
any number of slaves on the bus. So fix by finding the max of these two
values and fixing the off by one mistake. Also, for RW612, only one HW
native CS is available due to SOC pinmux limitations.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-31 22:40:40 +02:00
Jun Lin
62b1e1c28d driver: i2c: npcx: workaround invalid stop condition
The I2C state machine may fail to generate a valid STOP condition.
This may happen when the firmware sets the STOP bit in SMBCTL1 register
approximately half an SMB clock cycle following the last ACK bit in the
transaction.
Note:
  1. This issue is not expected to occur when the core clock runs at
    the default frequency (15 MHz). However, since more applications
    reuquires higher core clock frequency, this commit introduce the
    bypass to prevent the potential risk.
  2. Only NPCXn variant chips require this workaround.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2025-10-31 10:38:04 -04:00
Chekhov Ma
f4522490b9 driver: gpio: pca_series: fix pca6416 test issue
There are multiple issues in this driver:
1. gpio_pca_series_part_cfg_pca6416 is not using correct macros
2. gpio_pca_series_interrupt_handler_standard not updating input when
   no interrupt configured

Fixing these issues.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2025-10-31 10:23:23 -04:00
Mathieu Choplain
2e998cf17d drivers: usb: udc: stm32: use instance MPS for IN endpoints capabilities
When setting endpoint capabilities, the driver uses the MPS stored in each
instance's configuration for OUT endpoints, but used a hardcoded 1023 for
IN endpoints.

Use the instance MPS when preparing IN endpoints' capabilities too.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-10-31 10:22:29 -04:00
Wojciech Slenska
0468c5fb42 drivers: serial: stm32: don't disable DMA in circular mode
When cyclic mode is enabled, do not disable RX.
This mode ensures continuous availability of RX buffers.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2025-10-31 10:21:47 -04:00
Wenxi Xu
503df3e69e drivers: dma: stm32: add null callback checking
Fix the STM32 DMA driver did not check if the optional dma_callback was
set in dma_stm32_configure(). This could lead to a hard fault when an
interrupt occurs and the callback is NULL, even though the API allows
the callback to be omitted.

Fixes #97454
Signed-off-by: Wenxi Xu <xuwenxi0517@gmail.com>
2025-10-30 18:38:39 -04:00
Mathieu Choplain
2e7ad10247 drivers: usb: udc: stm32: use addr_before_status capability
Instead of snooping SETUP packets for SET_ADDRESS request to call the HAL
SetAddress() function manually, mark device with the addr_before_status
capability such that the UDC stack will call udc_stm32_set_address()
before submitting status by itself.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-10-30 18:38:29 -04:00
Ali Hozhabri
7a593ede3e drivers: bluetooth: hci: Fix the issue about the TRNG peripheral instance
Fix the issue regarding passing the TRNG peripheral instance to the driver.

Increase the SYSTEM_WORKQUEUE_STACK_SIZE when CONFIG_BT is set.
According to the log of thread analyzer for beacon sample, 1048 bytes
are needed. So, it's been increased to a safer value.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-30 18:38:02 -04:00
Ali Hozhabri
57ebf79d87 drivers: entropy: Modify the recover_seed_error function for WB0x
Exclude the WB0x series from discarding data 12 times from the RNG data
register.

Add a comment to the recover_seed_error function explaining the reason
for reading and discarding data from the RNG data register 12 times.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-30 18:38:02 -04:00
Ali Hozhabri
d7074f2747 drivers: entropy: Fix non-stop RNG ISR firing for STM32WB09
Fix the TRNG driver issue regarding non-stop ISR firing for STM32WB09 by
clearing RNG_IRQ_SR_ERROR_IRQ flag.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-30 18:38:02 -04:00
Allen Zhang
82f419de74 drivers: flash: Fixed the typo in clear_flash_caches
elif should be else

Signed-off-by: Allen Zhang <chunfeng.zhang@nxp.com>
2025-10-30 11:54:03 -04:00
Allen Zhang
86b346e097 drivers: flash: Added clear_flash_caches function for MCXW2XX
MCXW2XX ROMAPI provide the function FLASH_CacheClear to clear the cache.
The SMSCM is not supported on MCXW2XX platform.

Signed-off-by: Allen Zhang <chunfeng.zhang@nxp.com>
2025-10-30 15:15:35 +02:00
Jordan Yates
3dc72db57e wifi: nrf_wifi: named MAC address choice
Add a name to the "Wi-Fi MAC address type" choice symbol so that the
default can be updated on a per-board basis.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-30 15:14:59 +02:00
Guotao Zhang
ec970a635e drivers: bluetooth: h4: Fix check for sufficient buffer size
When alloc the evt buffer,such as the adv report, only compare the
remaining data len, should aslo consider the hdr_len, because the
hdr also copy to alloced buffer.if not consider the hdr, then
hdr + remaining data may larger than alloced buffer, because the
alloced buffer is not enough,then will assert when receive the
remaining data.

Signed-off-by: Guotao Zhang <guotao.zhang@nxp.com>
2025-10-30 15:14:20 +02:00
Qingsong Gou
4bb1c676cc drivers: dma: sf32lb: fix dma compile error
Fix dma clock compile error

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-10-30 15:13:25 +02:00
Abhinav Kulkarni
c0d1519891 drivers: wifi: nxp: Fixed host sleep issue
Fixed hostsleep issue for IW416 and IW612 socs

Signed-off-by: Abhinav Kulkarni <abhinav.kulkarni@nxp.com>
2025-10-29 20:30:22 -04:00
S Mohamed Fiaz
5828ba5ea1 driver: pwm: pwm_silabs_siwx91x: fix pm actions when PM is enabled
This fix addresses the issue encountered when power management (pm)
is enabled, as the PWM test suites utilize the GPIO driver, which
now incorporates the latest power domain enhancements and requires
CONFIG_POWER_DOMAIN to be enabled. Power domain functionality
manages device power actions such as turning on and off.

Accordingly, the pm device support for the pwm_silabs_siwx91x
driver has been updated to align with the recent power domain
improvements.

Signed-off-by: S Mohamed Fiaz <Fiaz.Mohamed@silabs.com>
2025-10-29 14:29:34 -04:00
Tomas Gudelevičius
e8043a48ac drivers: modem: use pm_device_driver_init() in modem_cellular.c
Remove Device Runtime PM "hack" used for modem cellular driver
initialization and use pm_device_driver_init() instead.

Signed-off-by: Tomas Gudelevičius <tomas.gudelevicius@draeger.com>
2025-10-29 20:19:00 +02:00
Anas Nashif
303af992e5 style: fix 'if (' usage in cmake files
Replace with 'if(' and 'else(' per the cmake style guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-29 11:44:13 +02:00
184ee44620 drivers: clock_control: fix the ch32v003/006 build
A recent commit added support for the CH32V30x/20x PLL multiplier. The
code is protected by a `IS_ENABLED(...)` but uses a constant that
doesn't exist for the CH32V00x, breaking the build.

Tested by building samples/basic/blinky for the ch32v003evt and linkw.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2025-10-28 20:20:49 -04:00
Mohamed Moawad
3559dd93ea drivers: spi: dw: Skip version detection on aux-reg platforms
The version register is not accessible through aux-reg interface,
So skip it entirely on platforms with aux-reg device tree property.

Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
2025-10-28 20:17:26 -04:00
Tim Pambor
084609a7bb drivers: spi: shell: fix deprecation warning
Remove deprecated delay parameter from SPI DT macro.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-10-28 20:11:39 -04:00
Jérôme Pouiller
f3e72b094f drivers: dma: siwx91x: Fix DMA_ADDR_ADJ_NO_CHANGE w/ memory destination
GPDMA does not support DMA_ADDR_ADJ_NO_CHANGE with a memory buffer. This
feature is required fro the SPI driver. Hopefully, SPI driver is the only
user of this feature.

Therefore, this commit introduces a hack for SPI. When the user want to
ignore the Rx data (= when he pass a NULL pointer for the Rx buffer),
rather than overwriting the destination in a loop, we just disable the rx
DMA.

This introduce a limitation: since Rx DMA stop early, any following Rx
request will start earlier than expected. Therefore, this patch breaks
cases with interleaved Rx buffers. In other words, the NULL buffer must be
the last one.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Jérôme Pouiller
e515c414a8 drivers: spi: siwx91x: Fix compatibility with gpdma
Because of limitation of gpdma, DMA Rx won't run if user doesn't specify
destination buffer.

Thus, the DMA Rx may stop before the end of the full transaction. So, wait
on DMA Tx instead.

Then, the SPI data won't be consumed by the DMA. We need to properly reset
the fifo before to start a new transaction (it is better to ensure we start
with a clean state before every transaction).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Jérôme Pouiller
42eff40bdc drivers: dma: siwx91x: Fix DMA_ADDR_ADJ_NO_CHANGE w/ memory source
GPDMA does not support DMA_ADDR_ADJ_NO_CHANGE with a memory buffer. This
feature is required for the SPI driver. Hopefully, SPI driver is the only
user of this feature.

Therefore, this commit introduces a hack for SPI. When the user request an
Rx transaction, rather than copying content of mosi_overrun parameter, it
configures the DMA to fill the destination memory (with either 0s or 1s).
Obviously, this only works if mosi_overrun is 0x00 or 0xFF. Hopefully, none
will need any other value.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Jérôme Pouiller
b359d5d29b drivers: dma: siwx91x: Simplify variables naming
Since the single-linked list management is well localized, the variable
names can now be abbreviated a bit.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Jérôme Pouiller
2fa6e07eef drivers: dma: siwx91x: Simplify descriptors list creation
The management of the single-linked list was made in various places:
  - RSI_GPDMA_BuildDescriptors()
  - after sys_mem_blocks_alloc()
  - at the end of the loop

Centralize it at the end of the loop.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Krzysztof Chruściński
182a6c62b1 drivers: timer: nrf_rtc: Kconfig clean up
Remove redundant enabling of NRF_RTC_TIMER in SoC specific files
and replace it with default y in the NRF_RTC_TIMER definition.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-10-28 17:42:38 +02:00
Yasushi SHOJI
3e4e1c52fb drivers: timer: Improve wording for AMD Xilinx PS TTC support
Clarify that the AMD Xilinx PS Triple Timer Counter (TTC) is used in both
Zynq UltraScale+ MPSoC (ZynqMP) and Versal platforms. Update the device
tree binding description and Kconfig accordingly.

Also, rephrase the Kconfig help text to fix grammar issues and improve
clarity.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2025-10-28 17:42:17 +02:00