Commit graph

25,525 commits

Author SHA1 Message Date
Alexandre Bailon
f44072c299 drivers: ieee802154: cc13xx_cc26xx: Fixup a bus error
Sometime, the radio causes a bus error.
This happens because we cast a struct and access to a member
that doesn't exists in the original struct.
This updates the driver to use the right struct to make the cast safe.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
2024-09-18 15:32:09 +02:00
Alexandre Bailon
2cef27865f drivers: flash: cc13xx_cc26xx: Add support of write to flash from flash
Currently, if we try to write data from a memory mapped flash address
to the flash then we get a -EINVAL error.
This could break the settings subsystem when we use NVS backend.

In order to make it work, add a buffer and use it when we want to
write data that is located in flash address space.

This has been tested using sample/subsys/settings/

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
2024-09-18 15:32:09 +02:00
Tomasz Moń
6582529d1f drivers: usb: udc_dwc2: Restrict TxFIFO to SPRAM size
Do not allocate TxFIFO in a way that could corrupt Endpoint Information
Controller data (stored at DFIFO Depth address) or access locations
outside the SPRAM.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-18 15:30:45 +02:00
Yong Cong Sin
7ebd3decd8 drivers: counter: shell: device name autocompletion
Add timer device name autocompletion to the commands.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-18 15:30:35 +02:00
Yong Cong Sin
a3d9ede341 drivers: counter: shell: change callback functions to static
These callback functions are not used outside of the file, make
them `static`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-18 15:30:35 +02:00
Guennadi Liakhovetski
531bbbdf65 Revert "ace: mm: tlb: Check tlb translation enabled before flushing cache"
This reverts commit 311ddf90e2. That
commit breaks firmware boot on both MTL and LNL.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 15:30:03 +02:00
Pisit Sawangvonganan
a9800e2ea7 style: drivers: adjust return usage in void functions
For code clarity, this commit adjusts the use of `return` statements
in functions with a void return type as follows:
- Transform `return foo();` into separate statements:
  `foo();`
  `return;`
- Remove unnecessary `return` statements when
  they don't affect control flow.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-18 09:56:16 +02:00
Luis Ubieda
53f547b737 serial: bluetooth: Maximize notification payload size based on ATT MTU
By keeping track of run-time ATT MTU of all connected peers, it's
possible to increase the notification payload size; thus increasing
data-throughput sent over Bluetooth.

Note that this assumes the Bluetooth connection is properly configured
(with the corresponding connection parameters) to optimize performance.
This is application-specific and shall be examined on each scenario for
optimal performance.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-09-17 20:12:55 -04:00
Quy Tran
3ccd52b657 drivers: spi: update casting for MSTP register
Update casting for MSTP register in SPI driver

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2024-09-17 20:10:46 -04:00
Felipe Neves
c24e8a3820 drivers: video: gc2145: fixes the prefix
of the compatible driver, use galaxycore
instead of gc.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2024-09-17 20:10:31 -04:00
Ryan McClelland
b0442e24f1 drivers: i3c: shell: record getcaps in to desc from shell
Record the getcaps values in to the i3c desc from the shell command.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
d2b0f70ddc drivers: i3c: add helper for if target is controller capable
Add the function, i3c_device_is_controller_capable, to determine if
a target is controller capable.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
93dc6113bc drivers: i3c: fix static addr for deftgts AC
The Active Controller data struct for static addr is to always be
0x7E. This is so the active controller can be identified according
to section 5.1.9.3.7 of the I3C v1.1.1 Specification.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
a338f7c710 drivers: i3c: shell: add hdr ddr shell commands
Add read and write hdr ddr shell commands.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
d6bff46d99 drivers: i3c: shell: add ibi shell commands
This adds ibi commands for hot-join, controller request, and target
interrupt request.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
86f7ccf10a drivers: i3c: shell: add i3c speed command
Add a shell command to set the i3c scl speed.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
1036310e8b drivers: i3c: set vendor ccc command target arg to const
The target argument was not const. Set it to be const.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Keith Short
9d999149e3 drivers: gpio: stm32: Fix compiler warning
The local function ll_gpio_get_pin_pull() is not always referenced.  Add
the __maybe_unused attribute to avoid compiler warnings (which may be
promoted to errors by downstream users).

Signed-off-by: Keith Short <keithshort@google.com>
2024-09-17 14:58:57 -04:00
Andrea Merello
cc61e96860 drivers: sensors: fix compile error due to conflicting types.
Since b249535 (sensors: Add channel specifier) the signature of
sensor_reconfigure_read_iodev() changed, but sensor_handlers.c
apparently hasn't been updated.

Fix compile time error by updating sensor_reconfigure_read_iodev()
signature in sensor_handlers.c

Signed-off-by: Andrea Merello <andrea.merello@iit.it>
2024-09-17 14:57:32 -04:00
Fabio Baltieri
f7c0a643df kscan: mark the kscan driver class as deprecated
All kscan drivers have been moved over to input, Mark the kscan driver
class as deprecated so it can be removed in the 4.2 release.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-09-17 14:52:50 -04:00
Armin Kessler
2ba893e0cb drivers: video: esp32s3
Add the missing calls to the sensors`video_stream_start()`
and `video_stream_stop()` functions.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-09-17 17:45:27 +01:00
Marcio Ribeiro
de53fb471a drivers: i2s: esp32: remove unused code
Removed unused code in I2S driver.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-09-17 09:10:51 -05:00
Corey Wharton
d80174fadf drivers: dac: add checks for internal channel config
Return -ENOTSUP if these flags are specified but not supported.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Corey Wharton
2b9ed72f9e drivers: dac_stm32: make pinctrl config in the device tree optional
Now that we support internally connected channels we should make the
pinctrl configuration optional.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Corey Wharton
834cc98f39 drivers: dac_stm32: add support for internally connected channels
Adds support for configuring the STM32 DAC channel mode for internal
connections. This is only enabled for SOCs that support it.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Pisit Sawangvonganan
7a59ebf6af drivers: i3c: shell: use shell_fprintf_normal instead of shell_fprintf
Due to the introduction of `shell_fprintf_normal` in PR #77192, we can
minimize caller overhead by eliminating direct `color` parameter passing.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan
d539257a87 drivers: i3c: shell: align struct shell * argument name to sh
Aligned the `struct shell *` argument name from `shell_ctx` to `sh`
for consistency with other drivers' usage of `sh`, and to match
the `shell_cmd_handler` argument name.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan
fdaaf3624c drivers: i3c: shell: fix unhandled <id> argument parsing
The `<id>` argument was included in `cmd_i3c_ccc_getvendor`,
`cmd_i3c_ccc_setvendor`, and `cmd_i3c_ccc_setvendor_bc` but
was not processed.

Utilized `shell_strtoul` for proper parsing of the `<id>` argument
in these functions.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan
66bce34af2 drivers: i3c: shell: fix compilation error in cmd_i3c_ccc_getmxds
Resolved a compilation error where `maxwr`, `maxrd`, and
`max_read_turnaround` were incorrectly referenced.

The code was updated to correctly access these fields from
the `data_speed` structure.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Georgij Cernysiov
4ec67271ab drivers: flash: stm32 ospi correct lines on writes
Correct used lines based on write opcode
regardless of the data mode.

The write opcode is set during init for all
modes and can be overwritten in DT.

Add lines correction for PP_1_1_2.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-09-17 09:45:42 +02:00
Joakim Andersson
e67f629094 drivers: clock_control: Deprecate Kconfig for MCO configuration
Deprecate support for configuring the MCO source and prescaler from
Kconfig configurations.
This is now done by devicetree and an MCO driver instead, which also
configures the pin to be used by the MCO peripheral.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-09-16 20:19:57 +02:00
Joakim Andersson
929c4507fc drivers: Add driver for STM32 MCO peripheral
Add device driver for STM32 MCO peripheral which takes configures
the MCO clock source and prescaler, and outputs it on one of the GPIO
pins.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-09-16 20:19:57 +02:00
Joakim Andersson
807ccf5b03 drivers: clock_control: Add clock sources to common enabled_clock check
Add clock sources PLL2CLK, PLL3CLK and EXT_HSE.
Needed to check that these clocks are enabled in MCO code.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-09-16 20:19:57 +02:00
Joakim Andersson
3c3487ae07 drivers: clock_control: Expose enabled_clock for clock driver library
Expose the helper function enabled_clock so that it can be used in
other clock library sources.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-09-16 20:19:57 +02:00
Luis Ubieda
00abc5a661 spi: rtio: Move spi_rtio_copy to spi_rtio
To group all common APIs for SPI RTIO.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-09-16 20:19:51 +02:00
Luis Ubieda
bd8a23f719 spi: rtio: Extract common APIs into separate file
Extracted common SPI RTIO operations from the spi_mcux_lpspi driver
into spi_rtio, which should be common across RTIO drivers.

Tested with spi_loopback with and without CONFIG_SPI_RTIO. Ran on
mimxrt1010_evk.

Also, verified the other SPI RTIO driver (spi_sam) is not broken by
these changes (tested building for target: robokit1 with the same
conditions as above).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-09-16 20:19:51 +02:00
Luis Ubieda
b135cc5e46 spi: spi_mcux_lpspi: Removed spin lock from iodev_start
Does not seem to be required. This allows hiding away the spin lock APIs.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-09-16 20:19:51 +02:00
Luis Ubieda
7510a17c18 spi: mcux_lpspi: Refactor driver to extract common RTIO functionality
As a step to make them common code: spi_rtio.c.
Verified this refactorization builds and passes spi_loopback, both with
CONFIG_SPI_RTIO enabled, as well as disabled. Tested on mimxrt1010_evk.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-09-16 20:19:51 +02:00
Lucas Tamborrino
4385785f02 drivers: i2c: esp32: Fix DT node instance.
DT_INST macros were not getting the info from the correct
node.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-09-16 20:19:43 +02:00
Sven Ginka
686cbc90f6 driver: timer: Add support for sy1xx
Add sys timer driver for Sensry's RISCV32 based SY1xx.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2024-09-16 20:19:31 +02:00
Sven Ginka
7443a2c703 driver: serial: Add support for sy1xx
Add uart driver for Sensry's RISCV32 based SY1xx.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2024-09-16 20:19:31 +02:00
IBEN EL HADJ MESSAOUD Marwa
ec08e1c0e8 drivers: ethernet: Modify RX thread creation and update KConfig
This change will allow users to configure the Ethernet RX thread
according to their specific real-time requirements.
Adding preemptive threading helps to reduce jitter and
the impact of Ethernet traffic on real-time performance.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-09-16 20:19:16 +02:00
Nathan Olff
7a094e376f drivers: clocks: remove check for sysclock in h7 clocks
remove check for system clock frequency in clock_stm32_ll_h7 because of
addition of fracn (difficult to handle)

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2024-09-16 20:18:54 +02:00
Nathan Olff
f979252cea drivers: use fracn in clock stm32h7 driver
use fracn value if defined for each PLL 1, 2 and 3 based on stm32u5 code

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2024-09-16 20:18:54 +02:00
Sylvio Alves
0aec059630 drivers: sdhc: esp32: remove unused code
Removed unused entry in SDHC driver and initialize
variables accordingly.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-16 20:18:33 +02:00
Felipe Neves
a372220ade video: esp32_dvp: change default log level
to the recent CONFIG_VIDEO_LOG_LEVEL option.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2024-09-16 20:17:26 +02:00
Mathieu Choplain
3328d7cb01 drivers: adc: stm32: don't fail init if pinctrl is not provided
Commit 47187a9ec9 made the `pinctrl` property
of STM32 ADCs optional, to allow usage of internal channels without wasting
GPIO pins. However, the driver was not adapted to support this new usecase.

(The real bug comes from commit 93956b2073,
that transitioned from a custom `stm32_dt_pinctrl_configure` function to
the standard `pinctrl_apply_state`, without accounting for the fact that
the former returns 0 when pinctrl is empty, but the latter returns -ENOENT)

Modify the driver to work even if no `pinctrl` is present on the ADC node.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-09-16 13:50:42 +02:00
Maureen Helm
13ff70a6f9 drivers: sensor: tdk: Refactor cmake and kconfig to vendor subdirectory
Refactors the cmake and kconfig bits of the tdk sensor drivers into the
vendor subdirectory to make them consistent with other vendor-sorted
sensor drivers. The tdk driver implementations were previously moved
into the vendor subdirectory in commit
41f1c3a2b7.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-09-16 10:06:03 +02:00
Yong Cong Sin
475ff826d6 drivers: intc: plic: fix IRQ on every hart regardless of mapping
Allow IRQs to work on every hart regardless of the mapping
of the contexts.

Add a test to validate the hart-context mapping.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-16 10:02:08 +02:00
Anuj Pathak
1471c2f814 drivers: led: lp5562: Add PM Device support
- Add PM_DEVICE support for power management

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-09-13 13:43:33 +02:00