Commit graph

23353 commits

Author SHA1 Message Date
Khoa Nguyen
c768144002 drivers: Correct value of event macro for all Renesas SoC
Since the RA2L1 uses the macro "ICU_EVENT" instead of
"ELC_EVENT" (which is currently used) to input into
the IELSR register, the ek_ra2l1 board cannot assign
any interrupts for any driver.

This commit aim to correct the Event macro to input correct
value for IELSR register on all the Renesas SoC by using
"BSP_PRV_IELS_ENUM" macro.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-02-28 18:29:17 +01:00
Jan Kowalewski
a9c59d6c85 drivers: timer: sam0: fix MCLK pointer and mask in init function
Init function uses undefined cfg variable causing compilation error.

Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2025-02-28 14:54:59 +01:00
Jeppe Odgaard
3a8dddcdad drivers: adc: stm32: use __maybe_unused
Replace conditional `ARG_UNUSED` with `__maybe_unused`. This is recommended
by coding style:
https://kernel.org/doc/html/latest/process/coding-style.html#conditional-compilation

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-02-28 14:53:17 +01:00
Måns Ansgariusson
467e15ddd3 drivers: rtc: rx8130ce: day alarm fix
The day alarm was not being set correctly. The day alarm should be set
using the WADA bit in the control register. This patch fixes the issue
by setting the WADA bit in the control register when setting the day alarm.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-02-28 14:51:43 +01:00
Emil Gydesen
210adaf399 drivers: Bluetooth: ipc: Add additional logging info
Add logging of the values that cause LOG_ERR statements.
This makes it easier to debug any issues that occur.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-28 08:01:46 +01:00
Declan Snyder
1ca895dc0e spi_nxp_lpspi: Reintroduce fast path no configure
Reintroduce the fast path that skips reconfiguring if we use the same
configuration, this fixes regression that causes a lot of latency at the
start of repeated transfers. Unfortuantely need to find alternative
workaround for S32K3 in order to do this instead of module reset, so
disable skipping for that platform.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-27 23:18:46 +00:00
Declan Snyder
09e31d6b42 spi_nxp_lpspi: Fix faulting register access
On some platforms, the module is not getting clocked until call to
LPSPI_MasterInit, this will be fixed soon with upcoming update to native
driver and will clock the module in driver init instead of start of
transfer, but for now, move this code within the condition check that
already exists for this purpose.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-27 23:18:46 +00:00
Johann Fischer
a05fd62119 drivers: usb: do not enabled nRF USBREG interrupt
The drivers still use the USBREG HAL driver which enables/disables the
interrupt by itself.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-27 23:18:39 +00:00
Declan Snyder
d46c382950 drivers: ethernet: Remove deprecated eth_mcux
This driver was deprecated and must be removed by Zephyr version
4.1 according to lifecycle/release guidelines.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-26 22:04:26 +00:00
Declan Snyder
2ba6ba8494 drivers: nxp_enet: Re-add EXT RMII CLK config
This config was missed when converting from eth_mcux to nxp_enet driver,
re-add it and use new one instead of old one.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-26 22:04:26 +00:00
Jun Lin
dee7927a21 drivers: flash: npcx: add k_usleep when polling busy status
Adding k_usleep while polling the flash's busy status yields the CPU
resource, giving lower-priority threads the opportunity to run.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2025-02-26 07:40:37 +01:00
Fabian Barraez
3295f7c5e2 drivers: sensor: si7060: fix: insecure data handling caught by coverity
- Checking each retval from read register before continue

Signed-off-by: Fabian Barraez <fabianbarraez@gmail.com>
2025-02-26 07:40:00 +01:00
Declan Snyder
0b843be90d drivers: spi_context: Add comments for context
Personally I found this file hard to understand at first,
but since now it is clear to me, I decided to put these comments
with my understanding to help anyone else who needs to use these.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-26 01:39:54 +01:00
Mahesh Mahadevan
cccd9619f4 drivers: nxp_flexio_spi: Fix transfer failures
This fixes failures seen with the SPI loopback test.
The fix waits for the TX and RX side to be complete
i.e when RX SHIFTBUF has been loaded from the RX Shifter
and the TX SHIFTBUF has transferred to the TX Shifter.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-02-26 01:39:25 +01:00
Johann Fischer
05fb46cb91 drivers: udc_stm32: handle ZLP flag for control transfers as well
I mistakenly assumed in the commit 6aaad0a5cd
("drivers: udc_stm32: handle ZLP flag") that the HAL driver would handle
ZLP flag in control transfers itself, but that does not seem to be the
case.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-25 20:41:03 +01:00
Jianxiong Gu
2fb35b10b8 drivers: tcpc: rt1715: Remove ALERT_EXTENDED handling
The RT1715 does not support TCPC_ALERT_EXTENDED_STATUS and
TCPC_ALERT_EXTENDED. This commit removes the related interrupt handling.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-02-25 15:14:45 +00:00
Jianxiong Gu
2b01c6c2b4 drivers: tcpc: rt1715: Refactor rx_fifo_enqueue
The original i2c_transfer setup was complex and contained an incorrect
message count. Replace i2c_transfer with i2c_burst_read.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-02-25 15:14:45 +00:00
Jianxiong Gu
ba45fb749f usb-c: tcpc: Fix TCPCI status register functions
CC_STATUS is an 8-bit register.
CC_STATUS and POWER_STATUS are cleared by the TCPC.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-02-25 15:14:45 +00:00
Axel Le Bourhis
e5a1c0bbe4 drivers: bluetooth: hci_nxp: fix unexpected command complete event
As the previous version of the MCXW71 BLE Controller wasn't sending a
command complete event after setting the BD address, we used a
workaround to directly send the HCI command without using zephyr's API.
Now, on the latest version of MCXW72 and MCXW71, this issue is fixed,
so we need to use `bt_hci_cmd_send_sync` to properly expect the
command complete event.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2025-02-25 15:14:18 +00:00
Marcio Ribeiro
71277577be driver: adc: esp32: fix read function
Compensates raw value reading before adc_read returns it

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2025-02-25 07:57:00 +01:00
Adrien MARTIN
355143b4ab drivers: wdt_gecko: wdt opt pause in sleep also in EM1 mode
default watchdog initialization disable counting in EM1, EM2 and EM3
modes. If user use the WDT_OPT_PAUSE_IN_SLEEP flag via the watchdog api,
all 3 EM modes must take this flag into account to avoid wdt count
being frozen if we don't want to.

Signed-off-by: Adrien MARTIN <adrienmar@kickmaker.net>
2025-02-25 07:56:43 +01:00
Mark Wang
b15dcc196d drivers: udc_mcux_ip3511: 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: Mark Wang <yichang.wang@nxp.com>
2025-02-25 07:55:42 +01:00
Axel Le Bourhis
0034e12599 drivers: bluetooth: hci_nxp: fix nomem handling
When allocation fails in `hci_rx_cb`, we should return immediately
instead of continuing the execution of the function.

Also, we need to free the allocated buffer from the heap when sending
to the message queue fails to avoid memory leak.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2025-02-25 07:54:56 +01:00
Sylvio Alves
5902f00bd5 driver: flash: esp32: fix unaligned read
Fix flash read operation to account for all unaligned
scenarios, i.e, address, buffer and length. This is needed
when using flash APIs provided in ROM.

This also removes the unaligned flash write call as it
expects aligned values only.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-02-24 20:19:47 +00:00
Ramana Gudipudi
5994a5efda drivers: bluetooth: siwx917: Fix issue with controller to host flow control
The SiWx917 BLE controller currently does not support
HCI Command 0x0C35 i.e. Host Number of Completed Packets Command
Disabling the ACL Flow Control avoids sending this command during
SMP Pairing process and therefore avoiding an ASSERT

Signed-off-by: Ramana Gudipudi <ragudipu@silabs.com>
2025-02-24 15:36:55 +00:00
Miguel Gazquez
9b2fdace1d drivers: uart: wch_usart: Fix typo in USART_WCH_IRQ_HANDLER
Previously, 'USART_WCH_IRQ_HANDLER' used 'DT_INST_IRQ(index, priority)',
which incorrectly referenced 'index' instead of 'idx'. This issue went
undetected because 'IRQ_CONNECT' drops the priority value on all boards
supported by this driver.

Fix by using 'DT_INST_IRQ(idx, priority)'.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-02-22 07:13:51 +01:00
Pieter De Gendt
59850f1340 drivers: regulator: Wrap driver instances in device API macro
Use the device API macro to place the driver API instance into an iterable
section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-02-21 18:03:17 +00:00
Pieter De Gendt
9217d923c2 drivers: charger: Wrap driver instances in device API macro
Use the device API macro to place the driver API instance into an iterable
section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-02-21 18:03:17 +00:00
Tahsin Mutlugun
391b9282e9 drivers: i2c: i2c_max32: Respect message flags in DMA mode
Send STOP or RESTART after a message only if they are enabled in message
flags. For reads, however, controller sends a NACK after last byte so a
restart is required even if I2C_MSG_RESTART flag is not set.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-02-21 18:02:41 +00:00
Luis Ubieda
cc7a151f52 sensor: lsm6ds: Do not enable Streaming for buses with no RTIO support
Ensure the corresponding bus enables RTIO (I2C, I3C or SPI) before
instantiating rtio-dependent elements. Otherwise, enabling it for
another bus (e.g: SPI_RTIO when the LSM6DS is also on I3C with no
I3C_RTIO) will cause a build-time failure.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-02-21 18:02:32 +00:00
Johann Fischer
eadd59e0ce drivers: usb_dc_rpi_pico: do not enable interrupt in driver init
Move irq_enable() to the place where the controller is initialized.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-21 15:14:32 +00:00
Miguel Gazquez
0cc61bcf66 drivers: udc: Fix log in "disable" function
udc_skeleton incorrectly logs "Enable device" in the function
"udc_skeleton_disable", and some UDC drivers inherited this mistake.

Fix this by correcting the log message in all affected drivers.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-02-21 15:14:17 +00:00
Martin Hoff
13e152a579 drivers: gpio: gecko: add check for interrupt configuration
Add a check for interrupt configuration: if the interrupt line for the
pin is already enabled but for the same port that the user asked, it
should not return EBUSY.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-21 15:14:07 +00:00
Benjamin Cabé
c3bda347b2 drivers: fix spelling of "swiched"
s/swiched/switched/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-21 11:41:46 +00:00
Benjamin Cabé
ff9fd96036 drivers: fix spelling of "transfer"
s/trasnfer/transfer/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-21 11:41:46 +00:00
Benjamin Cabé
9dd1dbbbc6 drivers: ieee802154: fix spelling of "written"
s/writen/written/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-21 11:41:46 +00:00
Zach Thomas
7e23a18980 drivers: sensor: scd4x: fix int overflow on val2 for temp and hum
The scd4x_channel_get function converts raw word values to
struct sensor_value's per the datasheet. The calculation for val2 of a
struct sensor_value `val->val2 = ((tmp_val % 0xFFFF) * 1000000) / 0xFFFF;`
can overflow the max of int32_t, resulting in an incorrect
sensor_value.
Fix it by changing the type of tmp_val to int64_t.

Signed-off-by: Zach Thomas <zach.thomas1.zt@gmail.com>
2025-02-21 04:39:42 +01:00
Luis Ubieda
6e897ccd69 sensor: adxl372: Fix build time issue due to shift variable namespace
Change `data->header.shift` to `data->shift`, as it is not contained
within the header struct.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-02-21 04:39:16 +01:00
Luis Ubieda
5847680e1e sensor: adxl367 and adxl372: fix build-failure with streaming mode
These two sensors do not build with asserts enabled as they're
referencing a non-existent variable `pkt_size`.

Replaced for what (AFAIK) is the intended variable.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-02-21 04:39:16 +01:00
Declan Snyder
93f13be110 spi_nxp_lpspi: Fix S32 regressions
There are two bugs that caused regression for S32:

First there is a silicon errata specifically for the mask version on
this board that causes FIFO flush to not work as expected. The
workaround is to do a module reset before each transfer.

Second there was a division error for word size > 1 byte. The division
should be rounded up, not down, otherwise there will be an infinite
interrupt loop because the TX fifo will not be written to but the TDR
interrupt enabled causes interrupt when TX fifo is empty.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-20 21:07:23 +01:00
Declan Snyder
de2d20f216 spi_nxp_lpspi: Remove unused struct fields
These two fields were not being used and were a relic of some
intermediate implementation, and forgot to be removed.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-20 21:07:23 +01:00
Declan Snyder
a718b84454 spi_nxp_lpspi: Fix Kconfig description
The Kconfig description is wrong, this driver can be used with or
without RTIO. Also, rename the kconfig to be less confusing, as _NORMAL
is meaningless, this is the CPU/interrupt based driver.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-20 21:07:23 +01:00
Declan Snyder
2a35835979 spi_nxp_lpspi: RX bigger than TX read all RX
Change the driver behavior so that if the provided RX buffer set is
bigger than the TX buffer, we will read all the RX buffer and fill the
TX with NOPs. The SPI driver API does not say to do this, and my
original interpretation of the API was that the TX length controls the
entire transfer length, but this behavior might fit better with some de
facto expectations of in tree consumers.

Also add some robustness to the calculation of how many extra bytes to fill
when tx should be nops.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-02-20 21:07:23 +01:00
Luis Ubieda
b5ca5b7b77 spi_rtio: fix transactions for default handler
This patch fixes transaction op items not performed within a single
SPI transfer. This is common for Write + Read commands, that depend on
the CS kept asserted until the end, otherwise the context will be lost.
A similar fix was applied to i2c_rtio_default on #79890.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-02-20 21:06:31 +01:00
David Leach
3fb8a94a79 dma: dma_mcux_lpc: fix scatter/gather src/dst increment
The logic for setting the src_inc and dst_inc would improperly set
these to zero when gatter/scatter was enabled but the respective
gatther_interval/scatter_interval was zero (which would imply
continuous operation).

Fixes: #85403

Signed-off-by: David Leach <david.leach@nxp.com>
2025-02-20 21:04:17 +01:00
Sai Santhosh Malae
6a0efa1647 drivers: dma: siwx917: dma_rom_buff variable rename
Rename dma_rom_buff to udma_handle

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
1d5b72458f drivers: dma: siwx917: Updated device instantiation
Placed instance numbers at end of names

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
020cae49cb drivers: dma: siwx917: siwx917_channel_config prototype change
Remove chan_info as input argument for siwx917_channel_config()

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
b9f5010a80 drivers: dma: siwx917: peripheral req & burst length function changes
- siwx917_is_peripheral_request -> siwx917_transfer_direction
- siwx917_burst_length -> siwx917_is_burst_length_valid
- siwx917_burst_length return type changed to bool
- Added enum for siwx917_transfer_direction return values

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
41e8df7afe drivers: dma: siwx917: Uniform function naming conventions
-Prefixed Zephyr driver functions with 'siwx917_dma' for consistency
-Added 'siwx917_' prefix to local functions
-Removed inline declaration for param validation functions

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00