Commit graph

24538 commits

Author SHA1 Message Date
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
Sai Santhosh Malae
984b0ea255 drivers: dma: siwx917: Declare config parameters as const
Marked DMA configuration parameters(passed from application) as `const`

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
3071190f20 drivers: dma: siwx917: Apply cosmetic changes
1. Updated multi-line comments
2. Grouping logical blocks by adding vertical spaces

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
b1ec724e14 drivers: dma: siwx917: Use accessors for HW reg access
Replaced direct hardware register access with appropriate accessors

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
a5501575f7 drivers: dma: siwx917: Fix bug in registering application callbacks
Resolved an issue where application callbacks were not being properly
registered in the DMA driver.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Adib Taraben
8d368ff4bc eth_nxp_enet_qos_mac: test and return early
move the check inside the loop to return early

Signed-off-by: Adib Taraben <theadib@gmail.com>
2025-02-20 14:55:22 +00:00
Martin Hoff
bb760440b8 drivers: serial: silabs: Add new Kconfig symbol for async
Add a new Kconfig symbol (UART_SILABS_USART_ASYNC) to enable the async
API for the Silabs USART driver.
It is needed because the symbol (UART_ASYNC_API) is shared between uart
driver. In the case that you have multiple UART drivers enabled,
condition to enable async API for different uart driver may differ.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-20 14:54:58 +00:00
Arunmani Alagarsamy
c75fadbdeb drivers: wifi: siwx917: Set security configuration to default
- Updated Wi-Fi security configuration to use default, allowing
  the device to select the best available encryption.
- Removed unsupported security features.
- Replaced `WIFI_SECURITY_TYPE_SAE` with `WIFI_SECURITY_TYPE_SAE_AUTO`
  to enable automatic selection between SAE-HNP and SAE-H2E,
  as the device supports both modes by default.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-02-20 14:54:27 +00:00
Pieter De Gendt
817c0396b9 drivers: ethernet: phy: dm8806: Fix driver bindings
There were some driver bindings issues for the davicom dm8806 driver:
- Missing type for reg-switch binding
- Missing required: true for int/reset gpios
- Fix macro for reg-switch

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-02-20 11:47:21 +01:00
Benjamin Cabé
67633f8df5 drivers: sdhc: fix spelling of "programing"
s/programing/programming/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-19 18:51:13 +01:00
Benjamin Cabé
312ad783b4 drivers: lora: fix spelling of "operation"
s/opperation/operation/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-19 18:51:13 +01:00
Benjamin Cabé
6c735705cd drivers: crypto: fix spelling of "below"
s/bellow/below/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-19 18:51:13 +01:00
Benjamin Cabé
4417fdb128 drivers: sensor: fix "Celsius" spelling
s/Celcius/Celsius/  -- preserved original case

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-19 18:51:13 +01:00
Fabio Baltieri
a3bd7efb38 gpio: shell: fix a crash where there's less line names than gpios
Don't try to dereference line_names if the index is beyond
line_names_len, this can happen if there's less line names than the
total amount of supported gpios specified.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-02-19 18:48:30 +01:00
Fabio Baltieri
323b0d8cd0 gpio: shell: add a missing static qualifier
line_cmp is only used in this file, make it static.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-02-19 18:48:30 +01:00
Fabio Baltieri
29776b1758 gpio: shell: drop an unnecessary forward declaration
Move SHELL_DYNAMIC_CMD_CREATE after the function, then the forward
declaration is unnecessary.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-02-19 18:48:30 +01:00