Commit graph

17135 commits

Author SHA1 Message Date
Alberto Escolar Piedras 7369bb56e3 drivers rtc: Do not treat the host libC differently
This code was using strptime from the C library in some cases,
but this function is an extension which many embedded libCs do
not provide, and which is not provided by default unless
_XOPEN_SOURCE or a similar macro is defined before the system headers
are included.

We could define _XOPEN_SOURCE for the libraries that provide it,
but instead of treating the host C library differently than
embedded libraries, let's just build the provided version always,
as that should provide better coverage of this code.

Note: It seems picolibc's strptime is broken,
until this very recent patch:
https://github.com/picolibc/picolibc/pull/657
so we should not select it when building for this library
for a while either.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras eb38e8db31 drivers uart_native_ptty: Set standard source macro appropriately
This file uses several functions which are extensions to the the
std C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras 1b94864a87 drivers epprom_simulator: Set standard source macro appropriately
This file uses several functions which are extensions to the the
std C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras 318f824d76 drivers flash_simulator: Set standard source macro appropriately
This file uses several functions which are extensions to the the
std C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Keith Packard 07943eae86 drivers/wifi/esp32: Remove _POSIX_C_SOURCE define as unneeded
This driver doesn't use any APIs outside of the Zephyr C library list, so
it doesn't need this _POSIX_C_SOURCE define.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-01-26 07:48:55 -05:00
Jan Bylicki 6400e3f437 drivers: pinctrl: Add ZynqMP / Mercury XU pinctrl support
Add a pinctrl driver for the ZynqMP SoC and the
Mercury XU board powered by it.

Signed-off-by: Jan Bylicki <jbylicki@antmicro.com>
2024-01-26 12:47:11 +01:00
cyliang tw 37696829a9 drivers: watchdog: andes atcwdt200 remove soc.h
soc\riscv\andes_v5\ae350\soc.h was empty and deleted,so revise
 wdt_andes_atcwdt200.c to resolve
 'fatal error: soc.h: No such file or directory'.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-01-26 12:36:16 +01:00
Marcin Niestroj 499edcdbc9 drivers: display: uc81xx: fix 16-bit 'tres'
Use 'struct uc81xx_tres16' for 16-bit 'tres' setup, instead of 'struct
uc81xx_tres8'. This fixes a regression when support for 'uc8175' was added
and 'struct uc81xx_tres' was replaced with 'struct uc81xx_tres16'.

Fixes: 7c46b0b898 ("drivers: display: uc81xx: add support for uc8175")

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-01-26 11:03:48 +01:00
Maciej Baczmanski 0f1747e4e7 net: openthread: upmerge to 7761b81
additionaly, implement `otPlatRadioResetCsl` functionality

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 10:48:02 +01:00
Maciej Baczmanski d76bcd346c drivers: ieee802154: fix ACK header IE implementation
- In `set_vendor_ie_header_lm`, case when
`link_metrics_data_len == 0` has been ignored.
This commit fixes that by setting `header_ie->length = 0`
before returning.
- current implementation of enh ACK header IE returns
`-ENOTSUP` when `ack_ie.header_ie == NULL` or
`ack_ie.header_ie->length == 0`. This commit fixes that by
refactoring checks in `nrf5_configure`.

Co-authored-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 10:48:02 +01:00
Bartosz Bilas a4f004e654 drivers: adc: ad5592: add missing static keyword
Add the missing static keyword for driver data structure.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2024-01-26 09:32:49 +00:00
Declan Snyder dcedb649ca drivers: nxp_enet: Fix build error with PTP on
Fix build errors in nxp enet driver during case where PTP on,
and add coverage to CI.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-01-25 19:32:02 -05:00
Benjamin Lemouzy 5ff55630a3 drivers: audio: tas6422dac: fix codec_mute_output function
Mute GPIO mutes both channel 1 and channel 2.
So, only control it when all channels have to be muted.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2024-01-25 17:54:14 +01:00
Benedikt Schmidt 23ed31383e drivers: gpio: use gpio_is_ready_dt in TLE9104
Use gpio_is_ready_dt in the driver for the TLE9104 before
actually using the GPIO.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-25 17:52:06 +01:00
Benedikt Schmidt f26da17723 drivers: gpio: make reset of TLE9104 optional
In some hardware designs it might happen that the reset signal
for the TLE9104 is not used only for this purpose, but instead for
instance to reset other devices at the same time. For such a hardware
design it is then necessary to make the reset GPIO optional. The reset
will have to be triggered earlier on.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-25 17:52:06 +01:00
Benedikt Schmidt 5a618057de drivers: gpio: add missing check if GPIO is ready for BD8LB600FS
Add a missing call to gpio_is_ready_dt in the driver of
the BD8LB600FS.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-25 11:50:35 -05:00
Benedikt Schmidt 7b55b99cac drivers: gpio: implement daisy chaining for BD8LB600FS
This implements the daisy chain feature of the low side switch
BD8LB600FS. The daisy chaining is in hardware achieved via
connecting the MISO and MOSI lines of multiple instances of the IC
in a row. It is implemented in the driver through a variable number
of GPIOs on one instance. Therefore, one device tree instance of the
IC will handle multiple daisy chained physical instances.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-25 11:50:35 -05:00
Daniel DeGrasse c8dfdda027 drivers: i2s: i2s_mcux_flexcomm: support additional channels and formats
Add support for more than 2 I2S channels to the I2S Flexcomm driver.
Additionally, remove comment stating I2S PCM and Left justified formats
are not supported, as these formats are now validated to function
correctly.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-25 16:01:14 +00:00
Patryk Duda 73396f9f86 flash: Add program/erase parallelism support for STM32F4x
The implementation uses the same approach as STM32F1x.

Program/erase speed can be set by setting 'write-block-size' flash
property to 1, 2, 4 or 8.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-01-25 14:45:32 +01:00
Alberto Escolar Piedras c6ed39e3ad drivers entropy fake_native: Add option to seed generator randomly
Add a command line option which will seed the random generator
from /dev/urandom.
This can be usefull for some particular tests in which we are
interested in having different random numbers in each run,
but we cannot provide a different random seed from command line.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-25 12:28:51 +01:00
Bjarki Arge Andreasen 27b0d4e3fe modem: chat: remove receive and transmit timeouts
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.

Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Guillaume Gautier 5aff88ab93 drivers: entropy: stm32: reinit rng when exiting suspend to ram
With PM, when resuming from low power mode, reenable the RNG register
clocks and check the health register. If it is not set to the desired
value, it means we exit Suspend to RAM mode, and that the RNG needs to be
reinitialized.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier b8fdcbb59e drivers: entropy: stm32: prevent suspend to ram when operation in progress
Prevent the system to enter Suspend to RAM state while RNG operation is
in progress.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 276fc569d6 drivers: adc: stm32: prevent suspend to ram while measure in progress
Prevents the system to go in Suspend to RAM low power mode while ADC
measurement is in progress.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 0792a85f77 drivers: serial: stm32: add reinit after standby
When resuming from low power mode, if UART is disabled, this means that
we come from a mode that reset the registers, so we redo a full init of
the driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier be26c71fd4 drivers: serial: stm32: prevent suspend to ram when operation in progress
Prevent the system to enter Suspend to RAM state while UART operation is
in progress.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 02ef0c5fb9 drivers: gpio: stm32: do not resume device when flag is DISCONNECTED
Fix a bug where after a standby, it was impossible to reenable a GPIO
clock.

A counter is incremented each time pm_device_runtime_get is called, and
decremented each time pm_device_runtime_put is called. The
clock is only enabled if this counter equals 1.
When configuring a GPIO (as input or output), the timer is incremented, and
when disconnecting it, it is both incremented and decremented. Thus the
next time we try to configuring it, the clock is not enabled (since the
counter will now be equal to 2).

This causes a problem when using low power standby mode: after wakeup all
clocks are disabled and the GPIO clock can not be reenabled.

This commit fixes this bug by not incrementing the counter when disconnect
is asked (or in other words incrementing it only when configuring either
an input or an output).

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 58c296b30f drivers: timer: stm32 lptim: add support for backup standby timer
Add support for a backup standby timer in STM32 LPTIM driver for cases
when the LPTIM is not available (ie standby low power mode).
A counter (typically RTC) is used for such a case.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier e541666d90 drivers: timer: stm32: lptim: remove init to 0 of static
Remove initialization of static variable to 0 to prevent resetting the
value when reinitializing the driver after resume from standby.
This has no impact since static variables are initialized to 0 by default.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Jordan Yates 4019d17746 flash: spi_nor: different wait_until_ready delays
Provide different loop delays to `wait_until_ready` based upon the
operation that we are waiting for.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-24 22:15:33 -06:00
Jordan Yates a7ba06bedb flash: spi_nor: don't hard loop in wait_until_ready
Don't monopolise the CPU in `spi_nor_wait_until_ready`. For slow flash
chips, operations can take minutes (Full chip erase on MX25R is listed
as 120s typical, 240s max).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-24 22:15:33 -06:00
Flavio Ceolin 4e39f79eeb drivers: power_domain/intel_adsp: Init priority option
Add a Kconfig option to customize initialization priority of
Intel ADSP power domain.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-24 18:20:17 -05:00
Flavio Ceolin e80ea1e129 drivers: power_domain/gpio: Init priority option
Add a Kconfig option to customize initialization priority of
gpio power domain.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-24 18:20:17 -05:00
Flavio Ceolin 9506720bd8 drivers: power_domain/gpio_monitor: Init priority option
Add a Kconfig option to customize initialization priority of
gpio monitor power domain.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-24 18:20:17 -05:00
Pisit Sawangvonganan e7875de3f9 drivers: sdhc: set 'sdhc_driver_api' as 'static const'
This change marks each instance of the 'api' as 'static const'.
The rationale is that 'api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-24 21:25:06 +00:00
Tim Lin 8317f9ea4f ITE: drivers/gpio: Add keyboard-controller property
When set, this GPIO controller has pins associated with the
keyboard controller. In this case the reg_gpcr property is
overloaded and used to write the keyboard GCTRL register

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-01-24 21:48:12 +01:00
Talha Can Havadar 4ce0555d90 drivers: bmp581: Add BMP581 driver
This commit adds source and header files required for bmp581 I2C driver.
I have used bmp581_user.h to add more usage related definitions
but bmp581.h to add hardware related definitions.

Signed-off-by: Talha Can Havadar <havadartalha@gmail.com>
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-01-24 09:32:34 -05:00
Marco Widmer 32b4388ba8 drivers: dma: stm32: do not clear busy flag in cyclic mode
The STM32 DMA driver supports cyclic mode by setting source_reload_en
and dest_reload_en. This causes the dma_callback to be called twice per
buffer run-through, at half-time and when wrapping back to the start of
the buffer.

However, the current implementation only calls dma_callback twice. When
wrapping the first time, it sets stream->busy to false and ignores
subsequent interrupts.

With this change, the busy flag is only cleared in non-cyclic mode.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2024-01-24 14:56:24 +01:00
Guillaume Gautier 14839e80d5 drivers: adc: stm32: add support for two sampling time common channels
For series that have two sampling time common channels, only one was used.
This commit add the support for the second one. The first two different
acquisition time values are used for the sequence and all further values
must match either of them, otherwise generating an error.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-24 12:44:59 +00:00
Cong Nguyen Huu 7e5c260708 drivers: nxp_s32_canxl: remove support CAN FD mode for non-RX_FIFO
This is driver limitation after removing CAN_FILTER_FDF flag #65108.
CANXL driver need to know CAN_FILTER_FDF for configuring Rx filter
so that it receives CAN classic or CAN FD frames when using non RX_FIFO.
So update driver that just supports CAN classic for non RX_FIFO.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2024-01-24 12:28:00 +00:00
Andriy Gelman 12bc02031e drivers: can_mcp251xfd: Fix setting data phase parameters
Commit eeec09eb9a unintentionally modified
can_calc_timing_data() to be called with the nominal phase parameters
instead of the data phase parameters.

Before the change, the parameters were properly initialized in the macro
MCP251XFD_SET_TIMING_MACRO(inst, _data).
After the commit, can_calc_timing_data() gets called with the parameters
pointing to dev_cfg->common.sample_point instead of
dev_cfg->commom.sample_point_data.

This PR creates a separate function mcp251xfd_set_timing_data()
which calls can_calc_timing_data with the correct data parameters.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-01-24 10:45:00 +01:00
Alberto Escolar Piedras 6447b1c4fd drivers/serial/uart_nrfx_uarte2: Fix for simulation
Just like for the old driver, for simulation, we cannot
get the UART regiter address for the pinctrl config structure
from DT, as that cannot match the one allocated at build time.
So let's override it at runtime with the correct address
which is stored in the UART config structure.

Also, do improve the condition for the busy wait during the poll_out,
for simulation, so we only busy wait if we will loop/the
Tx was busy.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-24 10:43:50 +01:00
Caspar Friedrich 8a2a44f9e9 drivers: adc: tla2021: Raise default initialization priority
The TLA2021 driver depends on it's i2c controller and therefore needs
to be initialized later. ADC_INIT_PRIORITY by default equals
KERNEL_INIT_PRIORITY_DEVICE which should be used by independent devices.
Using this by default causing projects to fail where this driver is
enabled implicitly through board configuration and the priority is not
explicitly set.

Signed-off-by: Caspar Friedrich <c.s.w.friedrich@gmail.com>
2024-01-24 08:22:33 +01:00
Andriy Gelman b302308e5f drivers: eth_sam_gmac: Use CONFIG_PTP_CLOCK_INIT_PRIORITY to init ptp
Use dedicated Kconfig symbol to set init priority.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-01-23 17:51:01 -05:00
Armando Visconti 72b3c3ea3a drivers: i2c: rv32m1: Fix build error
This fixes following build error when rv32m1_vega_zero_riscy
board gets compiled:

    implicit declaration of function 'INST_DT_CLOCK_IP_NAME'

Fixes #68012

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-01-23 18:14:16 +00:00
Laurentiu Mihalcea 6abc5921e1 drivers: dma: Introduce driver for NXP's eDMA IP
This commit introduces a driver for NXP's eDMA IP.

The main reasons for introducing a new driver are the following:

	1) The HAL EDMA wrappers don't support well different
	eDMA versions (e.g: i.MX93 and i.MX8QM). As such, a new
	revision had to be introduced, thus requiring a new Zephyr
	driver.

	2) The eDMA versions found on i.MX93, i.MX8QM, and i.MX8QXP
	don't use the DMAMUX IP (instead, channel MUX-ing is performed
	through an eDMA register in the case of i.MX93).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-01-23 10:54:21 -05:00
Bjarki Arge Andreasen b6c1bf8225 drivers: flash: sam: Use interrupt to sync
Use interrupt to wait for flash controller to finish
its command and become ready.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2024-01-23 15:22:26 +00:00
Bjarki Arge Andreasen efa4727296 drivers: flash: sam: Add logging
Add log messages to help diagnose and understand flash
driver behavior.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2024-01-23 15:22:26 +00:00
Bjarki Arge Andreasen ed854f008a flash: sam: Rewrite driver to dyncamically adapt to pages
This commit updates the driver to use the flash layout pages,
rewriting it to utilize the flash_page_layout.c driver to
avoid duplicate code.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2024-01-23 15:22:26 +00:00
Michael R Rosen 193ad777f4 driver: adc: stm32: combine shared and separate irqs
Several STM32 variants include both shared IRQs for some ADCs and
separate IRQs for others (for example, STM32G473 has 5 ADCs, ADC1 and
ADC2 share one IRQ while ADC3, ADC4 and ADC5 each have unique
IRQs). The STM32 ADC driver however previously only supported either
separate IRQ lines for each operational ADC in the devicetree or a
single shared IRQ for all operational ADCs in the devicetree which
prevented all ADCs from being usable at the same time when the variant
contained a mix of both shared and separate ADC IRQ lines (only either
all the shared or all the separate and one of the shared might be used
at most for one application).

To allow for all ADCs in an STM32 variant to be usable in a single
application, generate an ISR and initialization function for each
unique IRQn as defined in the devicetree and give the task of
initialization to the first ADC which connects to that particular
IRQ. Each ISR function will generate code to call the ISR for each ADC
associated with that IRQn as was previously done for
CONFIG_ADC_STM32_SHARED_IRQS, allowing an ISR to be shared for the
ADCs sharing an IRQ while simultaneously providing separate ISRs for
each IRQ. Thus, the only information required to have ADCs either
share an ISR or not is provided by the devicetree.

Signed-off-by: Michael R Rosen <mrrosen@alumni.cmu.edu>
2024-01-23 15:21:55 +00:00