Commit graph

23353 commits

Author SHA1 Message Date
Karol Lasończyk
ed8d70c2a5 drivers: adc: saadc: Extend gains support for nRF54L15
Add support for gains: 1/2, 1/3, 2/5, 1/4.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2024-06-27 10:57:54 -04:00
Fin Maaß
115d3d8aa7 drivers: spi: litex: add missing include
add missing include of `soc.h`.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-06-27 10:55:09 -04:00
Hao Luo
d1eea369b1 drivers: ambiq: Add dependencies to avoid showing to non-ambiq platforms
Fixed the Kconfig.ambiq under i2c and spi so that they don't litter.

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-06-27 08:59:40 -04:00
Johan Carlsson
79a2e2445d drivers: spi: mcux_flexcomm: fix invalid dma config for last tx packets.
fixes an incorrect dma configuration. When lpc dma driver was extended
with gather/scatter support the spi dma driver stopped working.

Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
2024-06-27 08:50:39 -04:00
Pisit Sawangvonganan
dc5527721a drivers: clock_control: remove '&' when assigning clock_control_xxx_init
Remove address-of operator ('&') when assigning `clock_control_xxx_init`
function pointer in `DEVICE_DT_INST_DEFINE` macro.

This change aims to maintain consistency among the drivers in
`drivers/clock_control`, ensuring that all function pointer assignments
follow the same pattern.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-06-27 08:50:20 -04:00
Dominik Ermel
89fdc35c51 drivers/flash/spi_nor: Fix missing check for return value
Add check for returned value from the call to spi_nor_cmd_write
in spi_nor_write.

Fixes #74775

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-27 10:52:48 +02:00
Damian Nikodem
a7e9be60cf driver: ssp: reorganize ssp ip acquired flow
The previous port acquire/release functions have been removed,
and a new IP acquire/release mechanism has been introduced.

Additionally, the RX FIFO clearing function for PTL has been corrected.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-06-27 08:25:59 +02:00
Oleksii Moisieiev
7c64a8b1a7 drivers: tee: optee: handlde GET_THREAD_COUNT call
Optee driver should handle GET_THREAD_COUNT call. This limitation is
set in Optee-OS during build and limits number of symultanious calls
to optee. Add sym to handle this limitation.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
2024-06-26 14:14:25 -04:00
Oleksii Moisieiev
eb0b341ba6 drivers: tee: optee: Introducing OP-TEE driver implementation
This includes the TEE driver api implementation for OP-TEE.
It provides an interface to the OP-TEE TrustZone from the Normal space
to start sessions and request functions of the TA.

- targets ARM and ARM64;
- use SMC to connect to OP-TEE;
- accepts requests on privileged and unprivileged device.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
2024-06-26 14:14:25 -04:00
Oleksii Moisieiev
0fe2bfbd6a drivers: tee: optee: Moving optee smc interface from optee client
Moved helper headers, needed to work with OP-TEE, which defines basic
defines, used during communication with Trust-Zone

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
2024-06-26 14:14:25 -04:00
Oleksii Moisieiev
cb3e0e7a91 drivers: tee: Add Tee driver generic API
Implementation of the generic API Trusted Execution Environment driver.
This implements all basic syscalls, needed by tee driver, basic
defines and helpers to work with shared memory.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
2024-06-26 14:14:25 -04:00
Tom Burdick
058253b4b6 icm42688: Follow st's devicetree bindings
Fix the devicetree bindings to actually be used as the default
configuration, following the example set by various ST sensor devices.

This requires sadly dropping enums and using #defines for various
options as well as repeating many numbers, but presumably is the way to
do it given the precedent set by ST with sensors like the lsm6dso.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-06-26 14:13:21 -04:00
The Thanh. Nguyen
f93f801c65 driver: serial: Add serial driver support for Renesas RA8 devices
Add implementation of sci_b_uart for Renesas RA device

Signed-off-by: The Thanh. Nguyen <the.nguyen.yf@renesas.com>
2024-06-26 13:36:14 -04:00
Duy Nguyen
ee4613a3a6 boards: arm: Add initial support for EKRA8M1
Add support for the EK RA8M1 board
This board is using Renesas RA8M1 MCU.

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2024-06-26 13:36:14 -04:00
Duy Nguyen
f978c69eb4 driver: gpio: Add initial gpio drirver support for RA8M1
This is the initial commit to support for gpio driver
for RA8M1 MCU, the coding is base on renesas fsp hal

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2024-06-26 13:36:14 -04:00
Duy Nguyen
75f1f7e982 drivers: pinctrl: Add pinctrl driver for RA8 series
This is the initial commit to support minimum pinctrl
driver for Renesas MCU RA8M1.

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2024-06-26 13:36:14 -04:00
Declan Snyder
3f59cf9439 drivers: nxp_enet: Fix CID 363724
This addresses the coverity issue ID 363724.
This issue seems to have been a false positive, but the root complaint
from coverity was that within the callstack of ENET_Up, some functions
use the buffer config pointer as an array, whereas in the zephyr driver
it is declared as a singleton. Address it by redeclaring this as an
array of size 1 instead of a singleton.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-26 13:06:14 -04:00
Declan Snyder
b05d719107 drivers: nxp_enet: Fix CID 392512
This commit fixes coverity issue 392512.
The issue was that the return value of clock_control_on was not being
checked. Fix by checking the return value.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-26 13:06:14 -04:00
Ioannis Karachalios
0c5bfeefac drivers: usb: device: Fix disable sequece
This commit should deal with
fixing the way USB_MCTLR_REG
is zeroed in order to disable
the USB controller along with
its tranceiver.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-26 09:20:51 -04:00
Simon Frank
2ca7e41b26 drivers/sensor: lis2mdl: use common SPI duplex option
Driver used a custom SPI duplex option. Replaced with the common one
found in spi-device.yaml.

Signed-off-by: Simon Frank <simon.frank@lohmega.com>
2024-06-26 09:01:13 -04:00
Sadik Ozer
ada6ab25ee drivers: serial: Update MAX32xxx tx and rx ready functions
Update rx and tx ready function as per of its description.
For tx_ready if tx interrupt enabled AND tx fifo is not full
For rx_ready if rx interrupt enalbed AND rx fifo not empty

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-06-26 09:00:26 -04:00
Chris Friedt
9ada52f060 fdtable: replace z_ prefix with zvfs_ for fdtable.h functions
For each of the fdtable.h functions listed below, convert the
z_ prefixed semi-private functions to use the zvfs_ prefix.

ZVFS stands for Zephyr Virtual File System and
is intended to be a common library used by the C library,
POSIX API, Networking, Filesystem, and other areas.

There are already a few functions in fdtable.h that use the
zvfs_ prefix, so this change is mostly about unifying them in
a way that uses a suitable prefix ("namespace") so that it can
be considered a public API.

- z_alloc_fd
- z_fdtable_call_ioctl
- z_finalize_fd
- z_finalize_typed_fd
- z_free_fd
- z_get_fd_obj
- z_get_fd_obj_and_vtable
- z_get_obj_lock_and_cond
- z_reserve_fd

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-26 12:33:02 +02:00
Luis Ubieda
089eaf93ec sensor: lm75: Enforce dependency of int-gpios with Trigger feature
As pointed out on #57586: `LM75_TRIGGER_GLOBAL_THREAD` can't be enabled
without the int-gpios being present in the DTS node. This commit
requires at least one LM75 instance featuring it, otherwise it won't
work.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-25 14:16:28 -04:00
Bartosz Sokolski
72197097ae drivers: i2s_nrfx: Fix division by 0 in divider calculation
Skip cases which would result in division by 0 in clock calculation

Signed-off-by: Bartosz Sokolski <bartosz.sokolski@nordicsemi.no>
2024-06-25 12:19:20 -04:00
Bjarki Arge Andreasen
a58abd0450 drivers: modem: cellular: correct user DLCI channels
The supported modems don't have the same number or assignment
of DLCI channels. For example, the NRF91_SLM only has DLCI
channel 3 assigned to GNSS tunneling, where the ublox sara r5
has DLCI 3 assigned to an additional AT channel, and DLCI 4
assigned to GNSS tunneling.

This commit updates the creation and assignment of DLCI
channels and pipelinks to match the capabilties of each modem.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-25 12:18:40 -04:00
Piotr Pryga
cbd85195e1 drivers: clock_control: Remove XTAL accuracy change for nRF54L
There was an error in calculation of LFXO INTCAP code that prevented
obtaining desired XTAL accuracy below 50PPM. The error was fixed
the accuracy should be within expected range.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-06-25 10:26:11 -04:00
Alberto Escolar Piedras
9d9cf4d17d drivers/gpio/gpio_rzt2m: Handle trig == GPIO_INT_TRIG_WAKE
Fix a build warning due to the enumerate for the trigger
polarity possibly being (from the point of the compiler)
also GPIO_INT_TRIG_WAKE.
We fix it by simply returning a not valid argument error
which is what most other drivers do if they do something
smart enough.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-25 10:25:04 -04:00
Lingao Meng
302422ad9d everywhere: replace double words
import os
import re

common_words = set([
    'about', 'after', 'all', 'also', 'an', 'and',
     'any', 'are', 'as', 'at',
    'be', 'because', 'but', 'by', 'can', 'come',
    'could', 'day', 'do', 'even',
    'first', 'for', 'get', 'give', 'go', 'has',
    'have', 'he', 'her',
    'him', 'his', 'how', 'I', 'in', 'into', 'it',
    'its', 'just',
    'know', 'like', 'look', 'make', 'man', 'many',
    'me', 'more', 'my', 'new',
    'no', 'not', 'now', 'of', 'one', 'only', 'or',
    'other', 'our', 'out',
    'over', 'people', 'say', 'see', 'she', 'so',
    'some', 'take', 'tell', 'than',
    'their', 'them', 'then', 'there', 'these',
    'they', 'think',
    'this', 'time', 'two', 'up', 'use', 'very',
    'want', 'was', 'way',
    'we', 'well', 'what', 'when', 'which', 'who',
    'will', 'with', 'would',
    'year', 'you', 'your'
])

valid_extensions = set([
    'c', 'h', 'yaml', 'cmake', 'conf', 'txt', 'overlay',
    'rst', 'dtsi',
    'Kconfig', 'dts', 'defconfig', 'yml', 'ld', 'sh', 'py',
    'soc', 'cfg'
])

def filter_repeated_words(text):
    # Split the text into lines
    lines = text.split('\n')

    # Combine lines into a single string with unique separator
    combined_text = '/*sep*/'.join(lines)

    # Replace repeated words within a line
    def replace_within_line(match):
        return match.group(1)

    # Regex for matching repeated words within a line
    within_line_pattern =
	re.compile(r'\b(' +
		'|'.join(map(re.escape, common_words)) +
		r')\b\s+\b\1\b')
    combined_text = within_line_pattern.
		sub(replace_within_line, combined_text)

    # Replace repeated words across line boundaries
    def replace_across_lines(match):
        return match.group(1) + match.group(2)

    # Regex for matching repeated words across line boundaries
    across_lines_pattern = re.
		compile(r'\b(' + '|'.join(
			map(re.escape, common_words)) +
			r')\b(\s*[*\/\n\s]*)\b\1\b')
    combined_text = across_lines_pattern.
		sub(replace_across_lines, combined_text)

    # Split the text back into lines
    filtered_text = combined_text.split('/*sep*/')

    return '\n'.join(filtered_text)

def process_file(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        text = file.read()

    new_text = filter_repeated_words(text)

    with open(file_path, 'w', encoding='utf-8') as file:
        file.write(new_text)

def process_directory(directory_path):
    for root, dirs, files in os.walk(directory_path):
        dirs[:] = [d for d in dirs if not d.startswith('.')]
        for file in files:
            # Filter out hidden files
            if file.startswith('.'):
                continue
            file_extension = file.split('.')[-1]
            if
	file_extension in valid_extensions:  # 只处理指定后缀的文件
                file_path = os.path.join(root, file)
                print(f"Processed file: {file_path}")
                process_file(file_path)

directory_to_process = "/home/mi/works/github/zephyrproject/zephyr"
process_directory(directory_to_process)

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-06-25 06:05:35 -04:00
Maksim Salau
da9b308563 drivers: adc: saadc: Disable burst mode on unused channels
Burst mode enabled on an unused channel causes a freeze during a
conversion consisting of several channels (not including the one with
burst mode enabled).

Discovered on nRF52832 (nRF52-DK) using the following approach:
  channels 0-3 are used for application purposes as a sequence
  channel 4 is used for battery measurements with oversampling

After few successful conversions the sequence (channels 0-3) freezes the
thread while waiting for semaphore to end the conversion.

Signed-off-by: Maksim Salau <maksim.salau@gmail.com>
2024-06-25 09:04:41 +02:00
Daniel Leung
5c4c31cfe0 i3c: ccc: fix missing break in switch in _do__getcaps()
In i3c_ccc_do_getcaps(), there is a missing break statement
in the switch case for GETCAPS_FORMAT_2_CRCAPS. Add it.

Fixes #74764

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-24 22:25:57 -04:00
Sylvio Alves
6b4beb9494 drivers: eth_esp32: fix function call as from hal
When external PHY has crystal, ESP32 can be configured
to use custom GPIO as clock source for it. However, due to
latest clock subsystem and hal updates, current driver
fails to build and blocks its usage.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-06-24 14:49:16 -04:00
Sylvio Alves
cc29fc1182 driver: eth_esp32: fix shared clock check
Both MDIO and Ethernet drivers share the same clock subsystem.
After clock control update in #73807, clock_control_on()
now returns -EALREADY for already initialized clock subsystem.
As a result, ethernet driver won't initialize as needed.

Fixes #74440

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-06-24 14:49:16 -04:00
Bjarki Arge Andreasen
9d761a1769 drivers: rtc: rtc_ll_stm32: coverity 368806 fix
Replace DIV_ROUND_CLOSEST() with a normal division to simplify
operation and avoid redundant handling of signed integer rounding
as the temp value is an unsigned value. The temp value is in nano
precision, so rounding is largely inconsequencial anyway compared
to the comparatively low precision sync prescaler.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-24 14:48:15 -04:00
Francois Ramu
b40c037233 drivers: flash: stm32 xspi driver supports the MemoryMapped mode
Adding the support of the memoryMapped mode
to the flash_stm32_xspi driver through the CONFIG_STM32_MEMMAP
That will allow XiP from the external octo_flash
Erase and Write operation must Abort operations.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-24 12:45:34 -04:00
Georgij Cernysiov
bb3737bde6 drivers: ethernet: adin2111: minor code style correction
Use tabs instead of spaces.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-06-24 12:44:04 -04:00
Georgij Cernysiov
104a019913 drivers: ethernet: adin2111: move OA buffers out from device data
Move OA-related TX and RX buffers out from the device data.
Don't define the buffers without the `spi-oa` property. That
saves ~32KB when using generic spi protocol.

Rearrange device data fields to reduce byte holes found with
Pahole.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-06-24 12:44:04 -04:00
Nazar Palamar
2eaae36220 driver/bluetooth/hci/hci_ifx_psoc6_bless: fix long bt startup time
Added force unblock psoc6 bless rx thread to process controller
events (at the end of psoc6_bless_send function)

Internal case: SWINTEGRAT-1767

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-06-24 12:43:48 -04:00
Ioannis Karachalios
d5332532e5 drivers: mipi_dbi: smartbond: Unused symbol
Suppress warning thrown when
the reset line is not used.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-24 12:43:12 -04:00
Ioannis Karachalios
edd779dbed boards: renesas: dts: Various fixes
This commit should deal with fixing
various issues on the board's dts
overlay files:

1. PSRAM node was not enabled when
   display buffers were stored in
   psram and thus, raising linker
    error (overflow memory section).

2. Remove MIPI DBI read operations
   for the MIPI DBI driver. This is
   because not all drivers support
   read and most of the cases it does
   not have any practical usage.
   In addition, this might trigger
   conflicts with SPI sensors.
   If needed, users should explicitly
   enable read operations by defining
   an SPI device taking into consideration
   conflicts with SPI devices connected
   to the SPI bus.

3. Remove enabling the DMA driver.
   It should be enabled by default.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-24 12:43:12 -04:00
Ioannis Karachalios
9d1b62b8ac drivers: usb: device: smartbond: Use DMA driver
This commit should deal with updating
the way USBD was handling the DMA
engine. Based on the #73803 request
DMA should be handled via the DMA
driver API class and not directly.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-24 12:43:12 -04:00
Ioannis Karachalios
1bcff4130c drivers: dma: smartbond: Fix pending length
This commit should deal with fixing
the pending length value returned
upon requesting the status of a channel.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-24 12:43:12 -04:00
Martin Tverdal
b9aae1388c drivers/flash/nrf_rram: increase flash timeout multipler rram
Erasing rram is very similar to partial erase on flash.
So we should use the same multiplier as there, 1.5.
0.1 multipler is way to low and was causing timeouts.

Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
2024-06-24 08:28:13 -04:00
Lingao Meng
b11c43cb09 drivers: bluetooth: Remove unused rsp params
The `rsp` params actually not used, so removed.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-06-24 14:26:22 +02:00
Eric Holmberg
18ebfe59d0 drivers: serial: esp32_usb: fix interrupt-enable race condition
After enabling interrupts, serial_esp32_usb_irq_tx_enable() calls the
interrupt handler to handle any old events that occurred while interrupts
were disabled.  However, this happens in the callers context, so if an
interrupt arrives during the call, it will call the interrupt handler again
resulting in corruption if the interrupt handler is not reentrant.

Fixes #74569

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2024-06-24 09:47:05 +02:00
Nazar Palamar
41c9ec3e42 driver/bluetooth/h4_ifx_cyw43xxx: Allow CBUCK regulator to discharge
Problem:
re-plug USB (e.g cy8cproto_062_4343w kit) can cause that
CY43xx device become unresponsive (cy8cproto_062_4343w).
As result we catch ASSERTION FAIL (timeout) on HCI_Reset command.

Fix: added delay (BT_POWER_CBUCK_DISCHARGE_TIME_MS) to be sure
that BT CBUCK regulator to discharge.

Tested on:
cy8cproto_062_4343w, cy8ckit_062s2_ai and cy8ckit_062s2_43012 kits.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-06-24 09:46:01 +02:00
Nazar Palamar
b6d0958ab7 drivers: serial: CAT1 UART driver: fix HW flow control
fix HW flow control:
- remove cyhal_uart_enable_flow_control
- added Cy_SCB_UART_EnableCts if cfg->flow_ctrl = true
  (required to enable hw flow control)
- configuration of CTS/RTS done by pincntr driver

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-06-24 09:46:01 +02:00
Jordan Yates
07870934e3 everywhere: replace double words
Treewide search and replace on a range of double word combinations:
    * `the the`
    * `to to`
    * `if if`
    * `that that`
    * `on on`
    * `is is`
    * `from from`

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-22 05:40:22 -04:00
Tomasz Bursztyka
b0e327bd9c drivers/spi: Fix context release in case of error
SPI context has to be released even in case of error.

Fixes: #72782

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@proton.me>
2024-06-22 05:39:55 -04:00
Sylvio Alves
844cb3e479 drivers: intc: esp32: fix kconfig visibility
Kconfig options in those drivers are visible and selectable
to any board/soc when it should not. This makes sure both
depends on proper family.

Fixes #74347

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-06-21 11:37:33 -04:00
Ioannis Damigos
b9dab49b13 drivers/smartbond: Remove atomic flags from drivers
Remove atomic flags from drivers that use balanced calls
for PM locking.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-21 08:45:10 -04:00