Commit graph

25,525 commits

Author SHA1 Message Date
Benjamin Cabé
ab9a2f52ba drivers: gpio: npm2100: properly handle I2C write return value
properly check return code from i2c_reg_write_byte_dt effectively
making it possible for gpio_npm2100_port_set_masked_raw to error out since:

if (ret != 0U) {
	return ret;
}

was dead code before this fix.

Fixes CID-444376

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-30 16:20:45 +01:00
Ibrahim Abdalkader
33ec0276b8 drivers: video: video_stm32_dcmi: Sanity-check frame size.
Add a check to ensure the frame size does not exceed the video buffer
size defined by `CONFIG_VIDEO_BUFFER_POOL_SZ_MAX`. Even if the sensor
supports the resolution, the frame size could overflow the buffer.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-01-30 16:20:17 +01:00
Ibrahim Abdalkader
a4ce71dc70 drivers: video: video_stm32_dcmi: Fix DCMI video buffer release.
Ensure the DCMI video buffer is released only after the DCMI
has been fully stopped. This prevents potential access to the
buffer while the DCMI is still active, avoiding undefined behavior.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-01-30 16:20:17 +01:00
Jukka Rissanen
ae978de237 drivers: wifi: winc1500: Use strncpy instead of strcpy
The strcpy is unsafe so use strncpy and pass the ssid length
as a maximum amount of chars to copy.

Fixes #81917
Coverity-CID: 434719

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-01-30 14:09:59 +01:00
Jukka Rissanen
c28baf830d drivers: wifi: winc1500: Initialize wifi_scan_result struct
The wifi_scan_result struct needs to be initialized to 0 so that
the ssid gets properly null terminated.

Fixes #81971
Coverity-CID: 434570

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-01-30 14:09:47 +01:00
Fabian Barraez
9c993bd0e3 sensor: grow_r502a: fix: untrusted array index read
- Fixed Coverity CID 366275 by adding bounds check on
packet length.

Signed-off-by: Fabian Barraez <fabianbarraez@gmail.com>
2025-01-30 07:20:29 +01:00
Hubert Miś
1ee6990fc4 drv: ft8xx: user data in the callback function
The user of the ft8xx driver can register a callback function called
on a touch detection interrupt event. This function is extended to
include a user-defined pointer. The user-defined pointer helps to share
a callback with multiple driver instances.

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
2025-01-30 02:01:34 +01:00
Hubert Miś
51e732c3ac drv: ft8xx: support multiple instances
Improve the FT8xx display driver to support multiple driver instances.

The ft8xx_reference_api.h still follows the FT8xx programming guides,
limiting the usage of the driver to one instance.

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
2025-01-30 02:01:34 +01:00
Nazar Palamar
fb1c9c880f drivers: serial: CAT1 UART driver: add ASYNC_API functionality
Add ASYNC_API functionality

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2025-01-30 02:00:50 +01:00
Eric Holmberg
de3ce03319 drivers: wifi: esp32: connect to highest signal AP
The station-mode channel scan method is currently set to WIFI_FAST_SCAN
which ignores the signal strength and connects to the first channel found
which may result in poor WiFi bandwidth.

Change the scan mode to scan all channels and connect to the channel with
the highest RSSI.

Fixes #84488

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2025-01-29 22:30:42 +01:00
Ryan McClelland
8f0ffbbb34 drivers: sensor: st: replace i2/3c_burst_write
i2/3c_burst_write comes with a warning where this combined write
synthesized by thsi API may not be supported by all I2/3C
devices. Replace with i2c_write instead with a buffer combining
the address and data.

The Kconfig STMEMSC_I2C_WRITE_BUFFER_SIZE was added to set the
size of the buffer pushed to the stack.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-01-29 22:30:25 +01:00
Gerson Fernando Budke
427749fe29 drivers: dma: sam0: Fix crc reset
The #83556 fixes an error related to DMA initialization which resets
the DMA CRC part. However, the samd/e5x do not have this module inside
DMA controller which causes a compile error. This fixes the issue
checking if the DMAC_CTRL_CRCENABLE macro is defined.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-01-29 20:33:56 +01:00
Benjamin Perseghetti
e399c168a1 sensor: icm42688: Fix broken build and streaming.
Makes driver actually build again.
Fixes scaling, q32 encoding, bit shifts, and register mappings.
Also enables High Resolution mode (a unique and beneficial
feature of the chip when used with streaming).

Co-authored-by: James Goppert <james.goppert@gmail.com>
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2025-01-29 15:17:44 +01:00
Karol Lasończyk
057de458e2 drivers: adc: Add support for gain 2/7 in nRF devices
Extend current adc gains with new entry 2/7.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2025-01-29 15:13:19 +01:00
Sergei Ovchinnikov
2d343589bb drivers: regulator: npm1300: workaround for LDO HW bug
There is a HW bug in nPM1300 LDO which causes the LDO output voltage to
reach its target very slowly in specific cases. This is worked around by
performing an additional i2c read shortly after an LDO is enabled.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2025-01-29 15:12:40 +01:00
Alexandre Rey
033e2227b1 drivers: usb: Fix macro USB0 undefined for certain socs
Some NXP socs use USBFS0 macro as base address for accessing the USB
registers, rather than USB0.
It generates compile-time errors, since USB0 is not defined.
Fix by defining USB0 if USB0 is not defined and USBFS0 is.

Signed-off-by: Alexandre Rey <alx.rey@icloud.com>
2025-01-29 11:03:18 +01:00
Maxmillion McLaughlin
b50bb7c2e5 drivers: gnss: Add geoid separation to gnss_info
Currently altitude is only provided above MSL. Adding
geoid seperation allows for ellipsoidal height to be
determined.

Signed-off-by: Maxmillion McLaughlin <max@sorcerer.earth>
2025-01-29 11:02:42 +01:00
Thomas Stranger
3652918f5e drivers: sdhc: fix infineon cat1 gpio initialization
Initialize the cyhal_sdio_config, such that the init
function won't do the pin configuration.
The gpios are setup using the zephyr pinctrl driver already.

Before the latest hal update the values were ignored and
the gpio configuration completely skipped.
But this is no longer the case and this commit
fixes that by setting the gpio pins to nc,

Also, explicitly set sdio_config.clock to NULL, to make
it clearer that the driver will check for that.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2025-01-29 07:08:58 +01:00
Thomas Stranger
b0583fc9e5 drivers: sdhc: fix infineon cat1 resource type initialization
The driver should use resource type SDHC not SDIODEV.

In a older HAL version the value was not used as parameter
for clock initialization so it didn't matter, but breaks
the initialization of the driver with the latest hal.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2025-01-29 07:08:58 +01:00
Marcin Lyda
5100850767 drivers: rtc: Add Texas Instruments BQ32002 RTC driver
This PR adds support for BQ32002 RTC chip.

Supported functionalities:

* Time setting/reading
* Alarm setting/reading
* Calibration setting/reading
* IRQ frequency configuration

Tested on nRF52833-DK board.

Signed-off-by: Marcin Lyda <elektromarcin@gmail.com>
2025-01-29 07:08:28 +01:00
Vegard Storheil Eriksen
3dc60a68c4 drivers: pinctrl: stm32: Ignore NO_REMAP pins when handling AFIO remaps
Some peripherals (e.g. ethernet) have remaps only on some of the pins.
Pins without remaps do not conflict and must be ignored to correctly
process the remaps.

Signed-off-by: Vegard Storheil Eriksen <zyp@jvnv.net>
2025-01-29 07:08:06 +01:00
Fabio Baltieri
6ba3274373 rtc_shell: add shell device filtering
Add shell device filtering using DEVICE_API_IS.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Fabio Baltieri
2575bfc9b2 counter_timer_shell: add shell device filtering
Add shell device filtering using DEVICE_API_IS.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Fabio Baltieri
b5c6b6c4e5 wdt_shell: add shell device filtering
Add shell device filtering using DEVICE_API_IS.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Fabio Baltieri
7ee8b49c4a spi_shell: add shell device filtering
Add shell device filtering using DEVICE_API_IS.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Fabio Baltieri
e93118f906 sensor: add few missing shell device filters
Add shell device filtering using the existing sensor_device_check to all
remaining sensor shell commands.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Fabio Baltieri
54564d15a7 flash_shell: add shell device filtering
Add shell device filtering using DEVICE_API_IS.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Fabio Baltieri
678d7e680c eeprom_shell: add shell device filtering
Add shell device filtering using DEVICE_API_IS.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Fabio Baltieri
a6a39c74e7 can_shell: add shell device filtering
Add shell device filtering using the existing can_device_check API for
CAN shell commands.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-01-29 04:17:47 +01:00
Benjamin Cabé
a253fe27c9 drivers: ov2640: fix integer underflow in retry logic
Properly stop retrying instead of underflowing uint8_t
fixes CID-487667 and CID-487767

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-28 23:43:31 +01:00
Benjamin Cabé
3f81c69b2b drivers: gc2145: fix integer underflow in retry logic
Properly stop retrying instead of underflowing uint8_t
fixes CID-487682 and CID-487631

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-28 23:43:21 +01:00
James Roy
e9a5b48b6c drivers: gpio: Fix uninitialized variable in gpio_pca_series
Fix uninitialized val variables scanned by Coverity.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-01-28 23:41:19 +01:00
Neil Chen
35a489e3be drivers: syscon: update syscon driver to add lpspi clock
Add lpspi clock support

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2025-01-28 23:41:08 +01:00
Ibrahim Abdalkader
5af9d55b73 drivers: video: ov7670: Use default YUYV/RGB565 order.
TSLB[3] swaps the YUYV/RGB565 output.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-01-28 18:24:51 +01:00
Ibrahim Abdalkader
1d6a80ca7c drivers: video: ov7670: Use a free-running pixel clock.
The STM32 DCMI capture seems to stop when the pixel clock is
disabled during horizontal blank. This patch switches pixel
clock to free-running, which shouldn't have any effect on other
capture devices.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-01-28 18:24:51 +01:00
Ibrahim Abdalkader
ec7628b9b3 drivers: video: ov7670: Implement missing video API functions
Add the missing stream_start and stream_stop API functions
(the driver doesn't work without them) and implement video
controls for horizontal mirror (hmirror) and vertical flip.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-01-28 18:24:51 +01:00
Guillaume Gautier
6602896520 drivers: gpio: stm32: add support for stm32n6
Add GPIO support for STM32N6

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-01-28 18:14:45 +01:00
Guillaume Gautier
7930d9c113 drivers: pinctrl: stm32: add pinctrl for stm32n6
Add pinctrl driver for STM32N6

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-01-28 18:14:45 +01:00
Guillaume Gautier
daeb2a8377 drivers: clock: add stm32n6 clock
Add STM32N6 clock driver.
Supported clocks are LSE, LSI, HSE, HSI, PLL1-4, IC1-20,
peripheral clock and CPU clock.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-01-28 18:14:45 +01:00
Yishai Jaffe
6686d82a7f drivers: si7006: add support for vin supply
Added support for vin supply which seems to be needed for the radio
boards in order to power on the sensor.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-28 18:14:09 +01:00
Tobias Pisani
1ec660d916 drivers: udc: stm32: Fix RX FIFO min size
On USB HS, the previous lower limit of 64 is too small, the value
160 has been chosen apparently through trial and error.

See 1204aa25 for the original implementation in the old device driver.

Signed-off-by: Tobias Pisani <mail@topisani.dev>
2025-01-28 18:13:59 +01:00
Tobias Pisani
227058d01c drivers: udc: stm32: set the hs capability if high speed is available
This fixes usbd_caps_speed(), which is used in sample_usbd_init, and the
documentation. Without it, no high speed configuration would be added.

Signed-off-by: Tobias Pisani <mail@topisani.dev>
2025-01-28 18:13:59 +01:00
Tobias Pisani
7b19e4f19b drivers: udc: stm32: Offload data callbacks to thread
All HAL callback handling is offloaded to a separate thread, as they
involve non isr-compatible operations such as mutexes.

Fixes #61464

Signed-off-by: Tobias Pisani <mail@topisani.dev>
2025-01-28 18:13:59 +01:00
Matthias Alleman
d0e98b2425 drivers: input: cy8cmbr3xxx: add support for cy8cmbr3xxx input driver
Support for the cy8cmbr3xxx input driver is added.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2025-01-28 14:13:08 +01:00
Alberto Escolar Piedras
dfb02f409a drivers: entropy: nRF CRACEN: Fix comment
Correct the comment that tells how long it takes to get
random numbers. The old comment was too optimistic.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-01-28 09:50:28 +01:00
Ibrahim Abdalkader
b58671fd1a drivers: video: video_stm32_dcmi: Use video buffers for DCMI buffer.
Instead of reserving a static (possibly unaligned) buffer for DCMI,
this patch reserves and holds one of the video buffers to use as the
main DCMI buffer. This buffer will be aligned (using the alignment
specified in the config) and will either be allocated from `video_common`
pool or a shared multi-heap (if enabled).

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-01-28 09:50:16 +01:00
Michał Stasiak
9a47667468 drivers: clock_control: nrf: start HFXO when using LFSYNTH
When using synthesized low frequency clock, HFXO should be running
to ensure correct frequency.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2025-01-28 09:47:06 +01:00
Raymond Lei
f96b78b030 drivers: i2s: Fix TX transfer stopping issue in some corner cases
In previous implementions, when there is no buffers in TX queue in a TX
callback context, TX will be stopped immediately. It is not correct
because there may still TX blocks in DMA TX transfer queue.
TX should only be stopped when DMA queue is empty and no more in I2S TX
queue.
Another modification is to set correct TX water FIFO level.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2025-01-28 09:46:56 +01:00
Khoa Nguyen
b6b5b6031f drivers: gpio: Fix bug for gpio driver Renesas RA
Get build error when using a gpio port that has port_irq_names
property isn't defined. This commit aim to fix this bug.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-01-28 07:57:03 +01:00
Pisit Sawangvonganan
8983a610a3 drivers: udc: stm32: fix DOUT stage handling for st_stm32_usb
In the device that has `DT_DRV_COMPAT` equal to `st_stm32_usb`,
its behavior differs from `st_stm32_otghs` and `st_stm32_otgfs`
due to the underlying `HAL_PCD_IRQHandler`.
As a result, calling `usbd_ctrl_feed_dout` for the DOUT stage is not
compatible with the `st_stm32_usb` device.

Instead of calling `usbd_ctrl_feed_dout`, we still require flushing
the TX FIFO to the host.
This is achieved by calling `HAL_PCD_EP_Receive` with `len` = `0`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-01-28 00:04:50 +01:00