Commit graph

23353 commits

Author SHA1 Message Date
Daniel DeGrasse
6ed3554d20 drivers: display: st7796s: use mipi_dbi_configure_te API
Use the mipi_dbi_configure_te API within the st7796s display driver.
If the MIPI DBI controller supports the tearing enable signal, then
configure the ST7796S to output the TE line signal.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-11 08:00:42 +01:00
Daniel DeGrasse
83aa4aa5c2 drivers: mipi_dbi_nxp_lcdic: add support for mipi_dbi_configure_te
Add support for the mipi_dbi_configure_te API within the NXP LCDIC
peripheral. Also, remove a redundant code patch in the write_command
function that was previously used to determine when the display driver
was writing to graphics RAM, as these writes should now be performed
using the mipi_dbi_write_display API.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-11 08:00:42 +01:00
Manuel Argüelles
f85f8ee88e dts: bindings: rename nxp,kinetis-lpuart compatible
Rename "nxp,kinetis-lpuart" compatible to "nxp,lpuart" to remove the
device family from its name.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-12-11 08:00:30 +01:00
Marcin Niestroj
f72ef5c237 drivers: usb: stm32: fix support of STM32U5 OTG_HS with embedded PHY
Introduce new binding "st,stm32u5-otghs-phy" for OTG_HS PHY. This allows to
configure clock source and handle STM32U5 specific OTG_HS PHY behavior in
driver implementation in a more readable way.

Move OTG_HS PHY clock selection (previously <&rcc STM32_SRC_HSI48
ICKLK_SEL(0)>) from OTG_HS node to OTG_HS PHY node.

Rename USBPHYC_SEL -> OTGHS_SEL which matches the definition in the stm32u5
CCIPR2 register (RM0456 Rev 5, Section 11.8.47).

Support enabling OTG_HS PHY clock, which is bit 15 (OTGHSPHYEN) in
RCC_AHB2ENR1. Change OTG_HS clock to be bit 14 (OTGEN).

Calculate in runtime OTG_HS PHY clock source frequency. Try to match that
to supported (16, 19.2, 20, 24, 26, 32 MHz) frequencies and select proper
option with HAL_SYSCFG_SetOTGPHYReferenceClockSelection() API (instead of
hardcoded 16 MHz selection).

Co-authored-by: Adrian Chadd <adrian.chadd@meta.com>
Signed-off-by: Adrian Chadd <adrian.chadd@meta.com>
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-12-11 08:00:03 +01:00
Marcin Niestroj
fafaa58240 drivers: clock: stm32: support STM32_CLOCK_DIV()
Support specifying divided clock buses by introduction of
STM32_CLOCK_DIV(div) macro. This macro can be used in devicetree to define
clock source of peripherals.

HSE is selected in devicetree using:

   <&rcc STM32_SRC_HSE ...>;

HSE/2 can now be selected with:

   <&rcc (STM32_SRC_HSE | STM32_CLOCK_DIV(2)) ...>;

This allows to use clock_control_get_rate() API in peripherals in order to
get desired clock rate.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-12-11 08:00:03 +01:00
Jilay Pandya
db43d2c4c1 drivers: led: is31fl3194.c fix uninitialized scalar variable
in the switch case in the preceeding for loop if default path is taken
all the time, then the ret variable will stay uninitialized, the original
contributor of this driver has provided a comment that this path shall
never be reached, however, it is better to return an error code instead
of continuing with an incorrect configuration, hence this commit replaces
continue with a proper return errno.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-11 07:59:41 +01:00
Yishai Jaffe
9c60bcb19a gpio: shell: use new shell_device_get_binding function
Use shell_device_get_binding() to minimize code.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-12-11 07:58:50 +01:00
Jilay Pandya
d5ae99a551 drivers: stepper: step_dir: rename direction_gpios to dir_gpios
for the brevity renaming direction_gpios to dir_gpios since STEP/DIR
interface is quite an established term in context of stepper controllers.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-11 07:58:34 +01:00
Jilay Pandya
5a2c6bf66c drivers: stepper: adi: tmc2209 allow instantiation of tmc2209 without msx
The current implementation of tmc2209 driver does not allow instantiation
of the driver without configuring msx pins.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-11 07:58:34 +01:00
Jordan Yates
a1ad0ad6c6 sdhc: spi: wait for VDD stable before clocking
The SD physical layer specification requires that the operating supply
be stable for at least 1 millisecond before providing the required 74
clocks. The maximum VDD ramp time is specified at 35ms, giving a total
minimum delay of 36ms.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-12-11 07:58:17 +01:00
Jordan Yates
a16bfb39ff sdhc: spi: power card before 74 clock signals
Power on the SD card before sending the required 74 clock signals.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-12-11 07:58:17 +01:00
Armin Kessler
1baf93b1d1 drivers: video: Add timeout tovideo_buffer_alloc
This PR fixes a blocking call to video_buffer_alloc in case of memory
shortage by addign a timeout parameter to the API.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-12-10 20:39:57 +01:00
Steve Boylan
37e39dee58 drivers: wifi: infineon: Add SPI support to AIROC driver
Added support for SPI in 4-wire and 3-wire configurations to
the Infineon AIROC WiFi driver (drivers/wifi/infineon).

Review changes:
Move DT_DRV_COMPAT to common header file
Correct board-specific preprocessor lines
Removed AIROC_MAP_COUNTRY_CODE
Move Pico W configuration details to devicetree
Use pinctrl to manage shared data/interrupt GPIO
Clean up bus selection in Kconfig.airoc
Make SDIO and SPI bus struct independent
Replace LOG_DBG with LOG_ERR
Remove functionally duplicate operation
Remove spurious Kconfig option
Minor cleanup in CMakeLists.txt

Signed-off-by: Steve Boylan <stephen.boylan@beechwoods.com>
2024-12-10 16:23:36 +01:00
Mario Paja
7abe775129 drivers: ethernet: add support for microchip lan9250
This PR adds support for LAN9250 spi ethernet controller.
This driver is tested on the Mikroe ETH Click 3
https://www.mikroe.com/eth-3-click

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2024-12-10 11:10:34 +01:00
Krzysztof Chruściński
ce6f5294fc drivers: misc: coresight: nrf_etr: Add support for turbo logs
Add support for optimized short log messages (aka turbo logs). They are
supported on cpuapp and co-processors owned by cpuapp (FLPR and PPR).
In general, it can be supported if cpuapp has access to logging strings
used for the log message. Currently mode is supported only in standalone
logging. When it is extended for dictionary logging then it will also
be supported on other cores (e.g. cpurad).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-10 11:09:55 +01:00
Gang Li
79fdf4a254 drivers: wifi: nxp: set the maximum number of stations
Add support for setting the maximum number of stations.
Add support for setting AP bandwidth.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-12-10 11:09:09 +01:00
Dawid Niedzwiecki
9b3fe8cb88 clock: stm32_ll_h7: add missing STM32_SRC_HSI_KER entry
Add a missing case for STM32_SRC_HSI_KER in the
stm32_clock_control_get_subsys_rate function.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-12-10 11:08:39 +01:00
Valerio Setti
daab04857f drivers: entropy: nrf5: add "depends on MULTITHREADING"
entropy_nrf5 modules uses k_sem_xxx() functions in several
places, but these functions are only functional when
CONFIG_MULTITHREADING is set, otherwise they just fallback to
the empty weak implementation provided in
zephyr/lib/libc/armstdc/src/threading_weak.c.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
62581570a7 drivers: entropy: mcux_rnga: add "depends on SYS_CLOCK_EXISTS"
mcux_rnga driver calls k_cycle_get_32() which is not available
if CONFIG_SYS_CLOCK_EXISTS is not defined. Therefore we add
this depedendency to CONFIG_ENTROPY_MCUX_RNGA.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
2d959d96fb drivers: entropy: enable ENTROPY_GENERATOR if "zephyr,entropy" is set in DT
Automatically enable ENTROPY_GENERATOR if the device-tree has
any "zephyr,entropy" chosen property specified. This helps
in having CONFIG_ENTROPY_HAS_DRIVER set if the platform support
an entropy driver and this then enables CONFIG_CSPRNG_ENABLED.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Johan Hedberg
bc086f53e2 drivers: bluetooth: silabs_efr32: Declare supported features in Kconfig
Now that we enable `HAS_BT_CTLR` we should also declare which optional
features are supported. For now, we only add the features that are
available through the current driver init routine and found on all
supported platforms.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-12-10 05:38:39 +01:00
Maochen Wang
c007ac4577 drivers: wifi: nxp: add Wi-Fi thread configurations
Support configuring Wi-Fi threads stack size and priority through
Kconfig.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-12-10 03:16:11 +00:00
Jianxiong Gu
29436c2b29 include: drivers: usb_c: unify status register data type to uint32_t
The tcpc_get_status_register function was using int32_t for the status
parameter, while the other related functions used uint32_t. This change
unifies the data type across all related functions to uint32_t for
consistency and clarity.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2024-12-09 22:06:09 +00:00
Krzysztof Chruściński
c8d50e4ef1 drivers: serial: nrfx_uarte: Add support for non ISR PM mode
When fast UARTE instance is used (e.g. UARTE120 in nrf54h20), PM actions
are not ISR safe because they include communication over IPC so they can
only be called from the thread context. Extend driver to support both
PM modes. When non ISR mode is used then uart_rx_enable() and uart_tx()
will return error if they are called from ISR and resume operation
would need to be called because device is suspended. On completion,
driver is calling pm_device_runtime_put_async which can be called from
the ISR context.

Additionally, suspending in the TXSTOPPED and RXTO events has been
moved after user callback. It allows to support the case where
uart_rx_enable() or uart_tx() are called from that callback context.
Since suspending is called after returning from the callback it will
not trigger suspend action because API called in the callback context
will increment the usage counter (when pm_device_runtime_get() is
called).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-09 22:05:03 +00:00
Stephan Linz
a68c1aa4ad drivers: mipi_dbi_spi: add 16-bit transfer to C4
Extends the MIPI DBI SPI driver class for operating mode C4, SPI 4-wire,
with 16 write clocks to send one or multiple byte for commands. Generic
data (e.g. GRAM) aligned to 16-bit are passed through and stuffed with
bytes if required.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2024-12-09 15:12:21 +01:00
Stephan Linz
c809c3730d drivers: mipi_dbi_spi: splitting SPI write function
The more complex the SPI transfer algorithms become, the more
confusing the current implementation of the SPI write function
becomes. Furthermore, if further as yet unknown MIPI DBI modes
are to be supported, the scope of this implementation would
increase dramatically. With the splitting now introduced, the
existing SPI transfer algorithms are moved to individual
auxiliary functions and the SPI write function only focus on
the decision of the respective MIPI DBI mode and the device
lock/unlock.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2024-12-09 15:12:21 +01:00
Stephan Linz
d0ba5a38c9 drivers: mipi_dbi_spi: splitting SPI read function
The more complex the SPI transfer algorithms become, the more
confusing the current implementation of the SPI command read
function becomes. Furthermore, if further as yet unknown MIPI
DBI modes are to be supported, the scope of this implementation
would increase dramatically. With the splitting now introduced,
the existing SPI transfer algorithms are moved to individual
auxiliary functions and the SPI read function only focus on
the decision of the respective MIPI DBI mode and the device
lock/unlock.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2024-12-09 15:12:21 +01:00
Francois Ramu
3696ee06e5 drivers: flash: stm32h7 with RDP protection
Implement the readout protection for the STM32H7 series.
Define the specific functions used by the flash_stm32h7.
Move the stm32h7 flash register manipulation in a write_optb()
to be called by the flash_stm32_set_rdp_level.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-09 15:12:04 +01:00
Francois Ramu
a8da57471f drivers: flash: stm32 flash ex op functions are common
Move the stm32 flash driver ex_op functions to common
flash_stm32_ex_op.c file.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-09 15:12:04 +01:00
Francois Ramu
3e166bc209 drivers: flash: stm32 driver move sem functions for multithread
Place the flash_stm32_sem_take and flash_stm32_sem_give
function to header file for common to use in any flash driver

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-09 15:12:04 +01:00
Daniel DeGrasse
a8182aa942 drivers: display: display_rm67162: check ret value of gpio_add_callback
Check the return value of gpio_add_callback() in the display init
function, to resolve an issue flagged by static analysis.

Fixes #81921

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-09 15:11:11 +01:00
Daniel DeGrasse
4d24120dcf drivers: display: display_rm67162: fix unsigned compare against 0
"wlen" variable set to return value of mipi_dsi_transfer should be a
ssize_t type, so that if a negative value is returned the error will be
caught and returned.

Fixes #81929

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-09 15:11:11 +01:00
Daniel DeGrasse
d7c9c4505c drivers: display: display_rm67162: fix dead code for pixel format
Fix dead code within the set_pixel_format() function for the RM67162.
This function should set the relevant data fields for the driver, then
send the MIPI DCS command to change pixel format.

Fixes #81945

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-09 15:11:11 +01:00
Alessandro Manganaro
5c290d8d55 drivers: bluetooth: hci: STM32WBA: Fix pub address assignment
BLE public address assignment shall be done only when
CONFIG_BT_HCI_RAW is not enabled.

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2024-12-09 15:10:37 +01:00
Robert Slawinski
ef6f804d8f drivers: dm8806: link speed change interrupt handling
On the interrupt handling, one thread per driver instance is involved
into monitoring the semaphor, sends inside the gpio callback triggered
by the gpio interrupt. Each time, when the link parameters are change,
the DM8806 is generating the gpio interrupt. After getting semaphor,
the application callback function which was linked during initialization
process is called to get the new link parameters with standard API
calls

Signed-off-by: Robert Slawinski <robert.slawinski1@gmail.com>
2024-12-09 09:50:29 +01:00
Robert Slawinski
19e74f1ba0 drivers: dm8806: add new driver for davicom dm8806 phy mac
New driver for Davicom DM8806 PHY. Driver is using standar mdio API
to manage the DM8806 switch controller. Register access needs the
PHY addres or switch address to be one of five possible values, since
DM8806 has built-in five PHY's. These values should be defined in the
application .dts file. One DM8806 ethernet port must corresponds with
one ethernet PHY node with two properties for ethernet port: one for
PHY address and one for switch address - <reg> for register access from
Internal PHY Register area and <reg-switch> for register access from
Switch Per-Port Registers area. Device tree example below:

example device-tree:
  dm8806_phy: ethernet-phy@0 {
    reg = <2>;
    reg-switch = <8>;
    compatible = "davicom,dm8806-phy";
    status = "okay";
    davicom,interface-type = "rmii";
    reset-gpio = <&gpiod 2 GPIO_ACTIVE_LOW>;
    interrupt-gpio = <&gpioc 1 GPIO_ACTIVE_HIGH>;
  };

Signed-off-by: Robert Slawinski <robert.slawinski1@gmail.com>
2024-12-09 09:50:29 +01:00
Danh Doan
c432f3dcad drivers: entropy: Add support for SCE7 to entropy driver
add support SCE7 to entropy driver for Renesas RA

Signed-off-by: Danh Doan <danh.doan.ue@bp.renesas.com>
2024-12-09 03:54:50 +01:00
TOKITA Hiroshi
1a4b7ab66c drivers: input: ft5336: Correct referencing to unexists symbol
The `n` is a non-existent symbol.
Changing it to the correct argument name to fix.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-09 01:39:51 +01:00
Fabian Blatz
6e799979d8 drivers: stepper: Add adi,tmc2209 driver
Adds the tmc2209 driver using the step dir interface.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-12-07 16:01:41 +00:00
Fabian Blatz
ba2aee24c9 drivers: stepper: Add step direction stepper common binding
Adds a step direction binding that can be used with any stepper that
implements said control interface to cut down on boilerplate code.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-12-07 16:01:41 +00:00
Jilay Pandya
47fc9a1a59 drivers: sensor: tdk: fix icm42688 division by zero
There were code paths that could have lead to divide by zero given an
invalid scale setting for accel or gyro. In practice this should be an
invalid setup even before getting to these conversion functions. The
conversion functions now better show all valid values are accounted for
by using CODE_UNREACHABLE in the default case.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-07 11:02:28 +01:00
Guillaume Gautier
b8b6afd198 drivers: adc: stm32: use dedicated status function for ldo state
Now that the U5 HAL contains the dedicated LDO status function, use it
instead of reading the register directly.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-07 11:02:18 +01:00
Guillaume Gautier
6401c471bd drivers: dma: stm32: update function prototype after hal update
New HAL update changed the prototype of the check DMA flag functions.
H7 and U0 use a const parameter for these functions.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-07 11:02:18 +01:00
Raymond Lei
0db1c07bf0 soc: nxp: imxrt11xx: select CONFIG_HAS_MCUX_ADC_ETC
On NXP RT1170 SOC, ADC ETC exists but it can not be enabled because
of dependency on HAS_MCUX_ADC_ETC.
Also, ADC ETC should only work with ADC together, there is no use
case to run it standalone.
Fixes:#81466

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-12-07 02:03:45 +01:00
Phi Bang Nguyen
ab6141c140 drivers: video: Use endpoint DT helpers
Drop the driver-defined macros to use the endpoint DT helpers instead.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-12-06 22:23:31 +01:00
Dane Wagner
c4e840af56 drivers: spi: Call correct SPI device definition macros
If CONFIG_SPI_STATS is enabled, the device state for all SPI controller
drivers must contain the SPI stats. This space is allocated by calling
Z_SPI_INIT_FN as part of the device definition; this is done automatically
when using SPI_DEVICE_DT_DEFINE instead of DEVICE_DT_DEFINE. If space for
statistics is not properly allocated but CONFIG_SPI_STATS is enabled, an
unexpected write to memory outside of the stats region may occur on a SPI
transfer. This commit uses SPI_DEVICE_DT_DEFINE or
SPI_DEVICE_DT_INST_DEFINE for all in-tree SPI controller drivers.

Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
2024-12-06 22:23:20 +01:00
Manuel Argüelles
0aa73c8685 dts: bindings: rename nxp,kinetis-dspi compatible
Rename "nxp,kinetis-dspi" compatible to "nxp,dspi" to remove the
device family from its name.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-12-06 22:22:51 +01:00
Daniel DeGrasse
c12030acb9 drivers: flash: flash_mcux_flexspi_nor: check all 3 bytes of JEDEC ID
The FlexSPI NOR driver should verify all 3 bytes of the JEDEC ID match
the expected value before attempting to use a custom LUT table with a
flash chip. This reduces the odds that an incompatible LUT will be used
with a flash chip, as some flash chips may share the same first byte of
their device ID but not be compatible with the custom LUT table.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-06 22:22:06 +01:00
Jilay Pandya
030444822e drivers: stepper: api: rename stepper_set_target_pos to stepper_move_to
rename stepper_set_target_position to stepper_move_to in following files:
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- tests/drivers/stepper/shell/src/main.c
- tests/drivers/stepper/stepper_api/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-06 22:21:44 +01:00
Jilay Pandya
05e94ed234 drivers: stepper: api: rename stepper_move to stepper_move_by
rename stepper_move to stepper_move_by in following files:
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- tests/drivers/stepper/shell/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-06 22:21:44 +01:00