Commit graph

23353 commits

Author SHA1 Message Date
Bjarki Arge Andreasen
bb2833de54 drivers: i2c: i2c_nrfx_twis: patch dma buf mem section
The macros placing the DMA memory buffer in the appropriate
section in RAM was malformed. This PR fixes it.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-10 14:32:52 +01:00
Armando Visconti
89b24bdc85 drivers/sensor: st: fix ASSERT in fetch API
Many drivers use a wrong __ASSERT in the fetch API, where they just
use SENSOR_CHAN_ALL, while it is more common fetching the specific
sensor channel (i.e. SENSOR_CHAN_PRESS, SENSOR_CHAN_ACCEL_XYZ, ...).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-02-10 11:31:06 +01:00
Lukasz Majewski
85dc17a543 drivers: net: ot: Select UART_INTERRUPT_DRIVEN with UART RCP communication
The Openthread communication with RCP via UART (with HDLC protocol) is
performed with serial driver using interrupts. As it was tested with
echo_client sample program, the
CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN is defined by default for
it. This config selects aforementioned UART_INTERRUPT_DRIVEN.

Problem starts when somebody wants to integrated the driver as a standalone
one (without echo_client) as a part of user application.
In this situation the UART_INTERRUPT_DRIVEN is not defined by default and
there is no serial communication between RCP and HOST devices.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2025-02-10 11:30:17 +01:00
Gerson Fernando Budke
e6caa3a6b4 drivers: counter: sam: tc: Update sam4l freq idx 0
The Atmel sam4l have generic clock 5 enabled at 1024Hz.  Update sam4l
sam_tc_input_freq_table index 0 to reflect right value.

signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-02-10 11:30:02 +01:00
Sachin D Kulkarni
a6dfdb9b8c drivers: nrf_wifi: Use mode specific APIs
Update the nrf70 Wi-Fi driver to use the mode specific
APIs (as a precursor to enable combining modes as required).

Signed-off-by: Sachin D Kulkarni <Sachin.Kulkarni@nordicsemi.no>
2025-02-10 09:02:55 +01:00
Sachin D Kulkarni
922d207c59 drivers: nrf_wifi: Use mode specific data structures
Update the driver to use the updated mode specific
data structure names.

Signed-off-by: Sachin D Kulkarni <Sachin.Kulkarni@nordicsemi.no>
2025-02-10 09:02:55 +01:00
Johann Fischer
fa7752494d usb: host: rework usbh_xfer_alloc() parameters
The transfers require enpoint MPS for proper transaction handling,
assign it in the common place during transfer allsocation so that it can
be reused.
Some users, such as USBIP, may need to keep a reference to private data,
add a parameter for completion callback data.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
63bd9ac1d0 drivers: uhc: add opaque pointer to store upper layer private data
Add an opaque pointer to store upper layer private data and initialize
it with the USB host context during controller initialization. Use the
pointer in event processing to get the correct context.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
5d5de63d67 drivers: uhc: interrupt transaction handling
Add interrupt and start frame parameters and schedule transaction at
specific frame. Implement for virtual driver only.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
ae8ae4cf95 drivers: uhc_virtual: update SoF timer based on the bus speed
Update the SoF timer based on the bus speed of the connected device.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
a7c8a8d46d drivers: uhc: remove UHC transfer parameter addr and attrib
Address parameter/argument is no longer needed because we have a pointer
to the USB device. The Attrib parameter has never been used and will be
replaced by the interval and start-frame parameters in the future.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
7f53eca7c5 drivers: uhc_virtual: allow multiple transfers scheduled within a frame
With the current implementation, NACK claims all resources and prevents
scheduling multiple transfers within a frame. Place a number of
available transfers in a list at the beginning of a frame, and process
the transfers in a limited number of slots.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
a91740e1cf drivers: uhc: implement the dequeue function
Implement the dequeue function and remove the timeout parameter as it is
no longer necessary and can be handled in the upper layer. The dequeue
function is required for the USBIP implementation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
5012965046 drivers: uhc_virtual: fix SOF timer handling
Do not necessarily call k_timer_init() in the uhc_bus_resume()
implementation. Restart SOF timer after bus reset and in
uhc_sof_enable() implementation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Gang Li
92dd07e51b drivers: wifi: nxp: add WPA2-PSK-SHA256 support for l2
Add WPA2-PSK-SHA256 security type support for embedded supplicant.
Convert wifi key_mgmt to zephyr security type.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2025-02-10 07:26:07 +01:00
Tim Lin
608d94b869 drivers/gpio: ite: Validate num_pins to prevent untrusted loop bound
Added a build assert to limit num_pins to a maximum allowable value to
prevent potential out-of-bounds access or infinite loops.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-02-08 10:09:20 +01:00
Tim Lin
db0f20c6fb drivers/gpio: ite: Modify the format to comply with check_compliance.py
Modify the format to comply with check_compliance.py.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-02-08 10:09:20 +01:00
Daniel Baluta
715fbd1f81 drivers: dai: Add initial support for NXP MICFIL PDM IP
Introduce new DAI driver used for NXP's PDM MICFIL IP.
This block implements required digital interface to provide
a 24-bits audio signal from a PDM microphone bitstream in a configurable
output sampling rate.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2025-02-08 00:32:26 +01:00
Aurelie Fontaine
5213c2cba3 drivers: sensor: icm42670: add icm42370-P support
To support icm42370-p sensor, we renamed icm42670 to icm42x70
 as the driver is similar to ICM-42670-P/S in hal_tdk module.
Keep icm42670 source and header for dedicated code.

Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
2025-02-08 00:31:43 +01:00
Jiafei Pan
7a100c9b28 drivers: gpio: add driver for PCA6416 IO expander
The PCA6416A is a 16-bit general purpose I/O expander that provides
remote I/O expansion for most microcontroller families via the I2C-bus
interface.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-02-08 00:31:28 +01:00
Mahesh Mahadevan
b1df5f7e4f drivers: timer: Improve the accuracy of the MCUX OS Timer
1. The sys_clock_idle_exit function could be invoked multiple
   times. Hence add code so that is counter is stopped and the
   OS Timer is initialized once.
2. Reset the OS Timer when exiting low power modes where
   the OS Timer loses its state
3. Improve the cycles conversion algorithm. Round to the nearest
   microsecond when converting from ticks to microsecond rather
   than always rounding up to the next highest value.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-02-07 17:46:09 +01:00
Tomasz Moń
8348d9a2b7 drivers: udc_dwc2: Rework control endpoint feeding
In Completer mode SETUP data can always be received and therefore
endpoint 0 should only be enabled for OUT Data Stage and OUT Status
Stage.

In Buffer DMA mode, SETUP can only be received when endpoint is enabled
and therefore the software has to make sure that there is a buffer
available to receive SETUP data.

Rework the EP0 buffer feeding to adhere to DWC2 Programming Guide.
Synchronize the accesses with driver mutex to avoid interrupt related
race conditions.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-02-07 14:33:16 +01:00
Tomasz Moń
ea72b27f3d drivers: udc_dwc2: Stop OUT transfers on ZLP
The transfer is finished after ZLP is transmitted. Do not re-enable the
endpoint waiting for more data.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-02-07 14:33:16 +01:00
Tomasz Moń
a61afc8eb1 drivers: udc_dwc2: Allocate multiple of bMaxPacketSize0
Control OUT buffers must be multiple of bMaxPacketSize0 in Buffer DMA
mode. While the transfer can be configured to smaller values, DMA will
write data past the buffer (and transfer size counter will underflow) if
the packet on the bus is larger or if there are multiple back-to-back
SETUP packets.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-02-07 14:33:16 +01:00
Tomasz Moń
d4cc8de644 drivers: udc_dwc2: Add helpers to check operating mode
Use helper functions to check whether device is operating in Buffer DMA
or Completer mode. This allows compile time optimizations to remove DMA
handling code when DMA is disabled via KConfig symbol UDC_DWC2_DMA.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-02-07 14:33:16 +01:00
Khaoula Bidani
541c0959c3 drivers : clock_control: clean "STM32_SRC_SYSCLK"
clean up usage of usage "#ifdef STM32_SRC_SYSCLK"
and code under the "#else" from clock_stm32_ll_common.c.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-02-07 10:25:52 +01:00
Chun-Chieh Li
069d439119 drivers: wifi: esp_at: handle IP unquoted parsing with ESP-AT version <2.0
This fixes parsing error on AT+CIPDINFO with ESP-AT version discrepancy.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-02-07 10:25:35 +01:00
Chun-Chieh Li
d74cf047b1 drivers: wifi: esp_at: enable CONFIG_WIFI_ESP_AT_CIPDINFO_USE automatically
This fixes DNS resolve failure (CONFIG_DNS_RESOLVER) by enabling
CONFIG_WIFI_ESP_AT_CIPDINFO_USE (AT+CIPDINFO) automatically to get
peer ip-address and port, required by CONFIG_DNS_RESOLVER.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-02-07 10:25:35 +01:00
Remi Buisson
a4d863163b drivers: sensor: icp101xx: Add icp101xx support
Use official TDK Invensense driver for icp101xx sensor in tdk_hal module.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
2025-02-07 07:38:06 +01:00
Gerson Fernando Budke
f2fa8f965e drivers: rtc: sam0: Add realtime clock driver
Add Atmel sam0 rtc calendar driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-02-07 07:37:56 +01:00
Gerson Fernando Budke
fb6079999d dts: rtc: sam0: Add clock properties
Add properties to differentiate the timer counter operating modes. This
properties are necessary to spetialize the driver to be used as a normal
16/32-bit counter or to provide the clock/calendar functions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-02-07 07:37:56 +01:00
David Leach
50a044a33d drivers: sensor: fxls8974: fix size misalignment memory access
Coverity identified out-of-bounds access. A uint8_t being cast to
an enum is undefined in that the enum can be allocated 4bytes.

Change the internal function to use the base type of the variable,
uint8_t to avoid potential compiler size alignement problems.

Fixes #81927

Signed-off-by: David Leach <david.leach@nxp.com>
2025-02-07 02:24:17 +01:00
Tom Hughes
57f38844ee drivers: mfd: mfd_adp5585: Fix -Wsometimes-uninitialized warning
When building with clang it warns:

drivers/mfd/mfd_adp5585.c:59:6: error: variable 'reg_int_status' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (ret == 0) {
            ^~~~~~~~
drivers/mfd/mfd_adp5585.c:70:7: note: uninitialized use occurs here
        if ((reg_int_status & ADP5585_INT_GPI)
             ^~~~~~~~~~~~~~    && device_is_ready(data->child.gpio_dev)) {
drivers/mfd/mfd_adp5585.c:59:2: note: remove the 'if' if its condition
is always true
        if (ret == 0) {
        ^~~~~~~~~~~~~~
drivers/mfd/mfd_adp5585.c:54:24: note: initialize the variable
'reg_int_status' to silence this warning
        uint8_t reg_int_status;
                              ^
                               = '\0'

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-07 02:23:10 +01:00
Johann Fischer
ea3dbe99b3 drivers: udc_mcux_ehci: fix typo in transfer handler
If the to-host data stage length is less than that requested by the
host, but equal to or a multiple of MPS, the device should send a ZLP,
not receive it.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-06 17:46:42 +01:00
Kevin Wang
c6488fc5c6 drivers: flash: andes_qspi: check if spi is used as flash fetch device
XIP may indicate that the program is executed either in local memory
or flash. However, the SPI node is only used as a flash fetch device
when the program is executed in flash.
Therefore, optimize the related checks to ensure that when XIP is
enabled but the program is executed in local memory, the qspi flash
node can still be used.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2025-02-06 14:45:19 +01:00
Kevin Wang
72d7a0f548 drivers: flash: andes_qspi: Fix the bug when rx length exceeds 512 bytes
ATCSPI hardware limits single transfer to 512 bytes, so when reading
data over 512 bytes, it needs to be split into multiple transfers

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2025-02-06 14:45:19 +01:00
Dawid Niedzwiecki
3d372c048a drivers: flash: stm32h7: add support for blocking registers
Add support for blocking flash control registers and option bytes for
STM32H7 chips.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-02-06 14:45:06 +01:00
Dawid Niedzwiecki
def973f5b9 drivers: flash: stm32h7: add support for write protection
Add support for setting flash write protection per sector for STM32H7x
chips.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-02-06 14:45:06 +01:00
Dawid Niedzwiecki
4c6b097df3 drivers: flash: stm32h7: change place of memory barrier
Move the memory barrier to a function that commits option bytes.

This way the barrier doesn't have to be added before every call of the
commit_optb function.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-02-06 14:45:06 +01:00
Dawid Niedzwiecki
52f45b91a4 drivers: flash: stm32h7: change return value of write_opt
Change the return value of the write_opt function. If returns 0 if a
change of option bytes was not needed.

It gives callers of the function an information a commit of the option
bytes is needed.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-02-06 14:45:06 +01:00
Ibe Van de Veire
a21e9f02e6 drivers: dac: Add support for the SAM4S soc series
Add support for the SAM4S soc in the DACC driver.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
2025-02-06 10:43:17 +01:00
Francois Ramu
3086c69fb8 drivers: clock control of stm32f4 serie w/o clk 48M on PLL I2S
Some stm32f4, like the sm32f411 mcu have clk 48M on the main PLL output q
Some stm32f4, like the sm32f412 mcu have clk 48M on the PLL I2S output q
This PR is for selecting the right one

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2025-02-06 10:42:36 +01:00
Kamil Krzyzanowski
6065ddb3b5 drivers: flash: spi_nor: make wait_until_ready erase delay configurable
The erase time varies between different SPI NOR flash chips.
Some have typical erase times in the 20-25ms range, at which point the
default 50ms poll interval means we get half the possible erase speed.
With slower memory, or larger erases, 50ms might not be a lot, but for
block erases, if we are unlucky we may end up polling just as the it's
about to finish erasing, and have to wait another poll interval.

Signed-off-by: Kamil Krzyzanowski <kamnxt@kamnxt.com>
2025-02-06 10:42:06 +01:00
Wajdi ELMuhtadi
03b075d35a drivers: sensor: wsen_pads_2511020213301: add sensor driver
Add wsen_pads_2511020213301 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-02-06 07:45:13 +01:00
Konrad Sikora
6487b217ea drivers: sensor: Fix typos in TMAG5170 driver
Correct a couple of misspellings in the TMAG5170 sensor driver

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-02-05 23:48:52 +01:00
Charles Dias
73afa0bcbe drivers: video: ov5640: add DVP support
Improve the ov5640 video driver to provide parallel interface (DVP) support

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
2025-02-05 23:48:09 +01:00
Jonas Spinner
90b989cf0e drivers: sensor: st: add missing buffer size config
Previously, the Kconfig option CONFIG_STMEMSC_I3C_I2C_WRITE_BUFFER_SIZE
has been introduced to replace i2c_burst_write with i2c_write using a
buffer combining the address and data.
See commit 5f8da77ad3eaf0593107fd99253c1c13b3a98de0

Add missing buffer size config to stmemsc_i2c_write_incr to replace
fixed buffer size.

Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
2025-02-05 21:01:34 +01:00
Armando Visconti
b6604f160c drivers/sensor: lis3mdl: fix lis3mdl_sample_fetch API
Fix a runtime bug when both CONFIG_LIS3MDL_TRIGGER and CONFIG_ASSERT
are set. The correct assertion should verify that sensor channel is
either SENSOR_CHAN_ALL or SENSOR_CHAN_MAGN_XYZ.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-02-05 21:01:18 +01:00
Mohammed Billoo
2850be690d drivers: sensor: ams/tsl2591: Don't check return code of initial reset
The TSL2591 driver fails to initialize because the sensor responds with a
NACK on the initial RESET. Although the datasheet from Adafruit claims that
this is operation should be valid (RESET is part of the CONTROL register),
other sample non-Zephyr drivers provided by Arduino don't explicitly reset
the sensor on initialization (see
https://github.com/adafruit/Adafruit_TSL2591_Library/blob/master/Adafruit_TSL2591.cpp).
Thus, the assumption is that when the sensor is reset via software, it
doesn't respond to an ACK.

After removing the check for this initial RESET, the driver initializes
successfully.

Signed-off-by: Mohammed Billoo <mab@mab-labs.com>
2025-02-05 21:00:36 +01:00
Marek Matej
6e6ab2f8ab soc: espressif: Remove ESP heap and use heap adapter
Remove ESP heap from the sources. System heap is default heap.
Use heap adapter layer to configure used heap.
Use MEM_POOL memory request config to Wi-Fi and Bluetooth drivers.
Update the Wi-Fi and BLE memory needs.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-02-05 17:49:54 +01:00