Commit graph

24538 commits

Author SHA1 Message Date
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
Sven Ginka
e38f3e1c3c drivers: mdio: sy1xx add support for mdio
Add mdio support for the sensry soc sy1xx.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-02-05 17:49:40 +01:00
Hieu Nguyen
3a7ccecdcd drivers: pwm: Initial support for RZ/G3S
Add PWM driver support for Renesas RZ/G3S

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Binh Nguyen <binh.nguyen.xw@renesas.com>
2025-02-05 17:49:00 +01:00
Martin Hoff
4a31f0227c driver: serial: silabs: implement asynch usart with dma
First implementation of asynchronous usart driver with dma support.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-05 15:02:35 +01:00
Martin Hoff
6f1debe6e7 driver: dma: silabs: Add silabs_ldma_block_append function
This function allows to not restart DMA engine for driver that gives
new buffer to the DMA engine while a transfer is ongoing.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-05 15:02:35 +01:00
Martin Hoff
c901551825 driver: dma: silabs: Add signal binding to support P2M and M2P transfer
Improve the silabs ldma driver to support P2M and M2P transfer. It also
adds signal binding to support source request binding in the dts.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-05 15:02:35 +01:00
Johan Hedberg
4618a272ce drivers: serial: silabs: Fix build for efm32wg_stk3800/efm32wg990f256
The gecko_uart.c driver supports both `silabs,gecko_uart` and
`silabs,gecko_usart` compat strings, however `PM_DEVICE_DT_INST_DEFINE()`
was missing when defining `uart` type instances. The
efm32wg_stk3800/efm32wg990f256 platform enables by default one
`gecko_uart` DT node and no `gecko_usart` nodes. This results in the
following build warning/error:

uart_gecko.c:673:12: warning: 'uart_gecko_pm_action' defined but not used

Add the missing call to `PM_DEVICE_DT_INST_DEFINE()`.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-02-05 14:58:28 +01:00
Tomasz Moń
9e050cd325 drivers: udc_nrf: Do not submit buffer more than once
When the UDC buffer gets submitted it should no longer reside in the
endpoint queue. While this commit does not address the underlying issue
of not being able to start transfer for whatever reason, it prevents the
problem from cascading into buffer double completion (e.g. receive
buffer double free in UAC2).

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-02-05 12:25:20 +01:00
Tomasz Moń
43880b930c drivers: udc_dwc2: Workaround hibernation exit glitch
DWC2 otg versions earlier than 5.00a are subject to randomly occurring
glitch on Hibernation Exit by Host Initiated Resume, Hibernation Exit by
Device Inititated Resume and Hibernation Exit by Host Initiated Reset.
When the glitch happens the device address is not correctly restored.
If the address is not correctly restored then the tokens addressed to
the device will timeout leading to host resetting the bus.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-02-05 10:21:13 +01:00
Tomasz Moń
b963c7d5eb drivers: udc_dwc2: Set bit 17 if needed on Hibernation Exit
Programming Guide states that bit 17 on PCGCCTL writes should be set if
the controller was enumerated for High Speed operation. Add the missing
bit set to adhere to the Programming Guide.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-02-05 10:21:13 +01:00
Peter Johanson
16b1d3c29e drivers: display: st7789v: Add ready time to startup
Add additional property to allow a configurable delay to the display
initialization to allow the st7789v to be ready to receive commands.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2025-02-05 10:20:52 +01:00
Duy Nguyen
633c5afb07 driver: eth: Fix phy-connection-type setting on RA8 ethernet
This commit fix the pin function configuration for mii and rmii
setting of Renesas RA8 ethernet driver
Correct pin function setting for mii is
PFENET = (uint8_t)(0x1 << R_PMISC_PFENET_PHYMODE0_Pos);
and rmii is:
R_PMISC->PFENET = (uint8_t)(0x0 << R_PMISC_PFENET_PHYMODE0_Pos);
Change code to intialize ping in driver init function, change
method of getting and checking via enum index of device tree.
Add build assert for invalid phy type.

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-02-05 08:16:02 +01:00
Stephan Linz
98cf437d7a drivers: sensor: maxim,ds3231: avoid compilation error
As the C language treats 'cases' similar to 'labels' the following
error can also occur when using switch statements when it encounters
a declaration immediately after a label:

drivers/sensor/maxim/ds3231/ds3231.c:77:3: error: a label can only
        be part of a statement and a declaration is not a statement
   77 |   const uint16_t raw_temp = data->raw_temp;
      |   ^~~~~

Signed-off-by: Stephan Linz <linz@li-pro.net>
2025-02-05 01:16:03 +01:00
Stephan Linz
cca2053448 drivers: rtc: maxim,ds3231: avoid compilation error
Because of wrong integer type syntax following error occurred:

drivers/rtc/rtc_ds3231.c:361:76: error: unknown type name 'u'
  361 | static int rtc_ds3231_alarm_get_supported_fields(
      |                    const struct device *dev, u int16_t id,
      |                                              ^

Signed-off-by: Stephan Linz <linz@li-pro.net>
2025-02-05 01:16:03 +01:00
Stephan Linz
2a793cf0f8 drivers: rtc: maxim,ds3231: avoid warnings about unused code
Compile warnings occurred in common standard use case
w/o RTC alarm and update.

Warning was:

drivers/rtc/rtc_ds3231.c: In function 'rtc_ds3231_init':
drivers/rtc/rtc_ds3231.c:808:33: warning: unused variable 'data'
                 [-Wunused-variable]
  808 |         struct rtc_ds3231_data *data = dev->data;
      |                                 ^~~~
drivers/rtc/rtc_ds3231.c: At top level:
drivers/rtc/rtc_ds3231.c:195:12:
        warning: 'rtc_ds3231_get_ctrl_sts' defined but not used
                 [-Wunused-function]
  195 | static int rtc_ds3231_get_ctrl_sts(const struct device *dev,
      |                                    uint8_t *buf)
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Stephan Linz <linz@li-pro.net>
2025-02-05 01:16:03 +01:00
Jilay Pandya
8272b36b5b drivers: stepper: tmc50xx: extend tmc5041 to tmc50xx
Extend tmc5041 to tmc50xx in order to accomodate tmc5072

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-02-05 01:14:47 +01:00