Commit graph

24538 commits

Author SHA1 Message Date
Terry Geng
49308e45d2 drivers: adc: ads1x4s0x: Add ADS124S0X support into existing drivers
Refactor code for ADS114S08 (12 ch, 16 bit) to accommodate ADS114S06
(6 ch, 16 bit), ADS124S06 (6 ch, 24 bit), and ADS124S08 (12 ch, 24 bit).

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Terry Geng
cbcb2d8f12 drivers: adc: ads1x4s0x: Rename files, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Terry Geng
43079c8086 drivers: adc: ads114s0x: Rename variables, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Sylvio Alves
e472fb603e drivers: adc: esp32: delete previous calibration curve
In case channel_setup is called with a new attenuation
config, make sure previous calibration scheme is deleted properly.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-01-30 22:59:21 +01:00
Yasin Ustuner
d411b4f67b drivers: adc: Introduce AD7124 adc driver
This commit introduces ad7124 adc driver.

Signed-off-by: Yasin Ustuner <Yasin.Ustuner@analog.com>
2025-01-30 20:33:10 +01:00
Lukasz Majewski
d0d68d6b0f drivers: net: ot: Provide structure instance for HDLC RCP context
Without this patch the hdlc_iface_init() function assigns to
ot_hdlc_rcp_context structure pointer (*ctx) value of 0, as in the
NET_DEVICE_DT_INST_DEFINE() preprocessor macro the 'data' field is
set to NULL.

Afterwards, the ctx->iface is set to iface address passed to the function
(as well as the ctx->ot_context is set).
Writing those values to address 0x0 is catastrophic to for example
mimxrt1020, which uses ITCM memory (mapped from 0x0) to store flash
handling functions, as those are used to XIP code directly from
SPI NOR memory (as mximxrt1020 doesn't have internal flash).

In this particular case - the flash_flexspi_nor_erase() function is mapped
(i.e. relocated) to ITCM's 0x0 address. Overwriting first 8 bytes of it
causes the SoC to enter "Precise data bus error" exception.

The fix is to define the static instance of struct ot_hdlc_rcp_context
and pass its address to the NET_DEVICE_DT_INST_DEFINE() macro. As a result
its storage is now in RAM, not ITCM.

This issue has been discovered on UART based HDLC RCP communication, but as
it also may be problematic on the NXP driver, this patch fixes it too.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2025-01-30 20:26:53 +01:00
Declan Snyder
62b911feea spi_nxp_lpspi: Rewrite driver, fix native chip sel
To fix the native hardware chip select, we need to rewrite this driver
to not use the MCUX SDK handle abstraction, which does not fit the
zephyr use case.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-01-30 20:26:36 +01:00
Declan Snyder
0bb7ccbb0c drivers: spi_context: Functions for remaining len
Add functions to get remaining length in the transfer. Refactor a bit to
avoid duplicate code for the for loop that is the same as in the total
length function.

The difference between the total length and left length function is that
the current buffer total length is counted in the former and the current
buffer remaining length is counted in the latter.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-01-30 20:26:36 +01:00
Declan Snyder
9966d29957 dts: nxp,lpspi: Fifo property and fix delay desc
Add properties for describing RX and TX fifo sizes.

Also reformat some descriptions and fix the description of the
transfer-delay property which was incorrect. Since zephyr spi bufs are
not continuous, every possible Zephyr LPSPI driver must use
continuous transfer mode, for which the meaning of this delay has
nothing to do with the chip select.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-01-30 20:26:36 +01:00
Aksel Skauge Mellbye
120691a155 drivers: pinctrl: silabs: Add support for analog bus allocation
The GPIO peripheral on Silabs Series 2 devices is responsible for
allocating analog buses to analog peripherals. Enable support for
this in the pinctrl driver. Since these bus allocations are not
digital pins, introduce a new property silabs,analog-bus for this
purpose.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-01-30 18:30:01 +01:00
Mahesh Mahadevan
85bdab00de soc: mimxrt1180: Add USB support
This was tested on the MIMXRT1180 EVK board

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-01-30 18:29:33 +01:00
Mahesh Mahadevan
c3533472c1 drivers: hwinfo: Add support for MIMXRT1180
Add HWINFO support for MIMXRT1180

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-01-30 18:29:33 +01:00
Marcio Ribeiro
c3b53d0fa3 soc: esp32xx: makes esp_console_init() calling conditional
Makes the esp_console_init() calling during hardware initialization
conditioned to CONFIG_ESP_CONSOLE

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2025-01-30 16:21:13 +01:00
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