Commit graph

16543 commits

Author SHA1 Message Date
Francois Ramu f1af7f13eb drivers: timer: stm32 lptimer revert static-prescaler
Revert "drivers: timer: lptim timer clock on stm32u5 has a prescaler"
This reverts commit c14670abea.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-11-27 12:18:41 +00:00
Tim Woolliscroft 65068fb4df drivers: i2c: stm32: Fix routing of secondary target address
Fixes the routing of the events associated with a secondary
i2c target address being routed to the primary config. The
i2c_target_config/slave_cfg was being selected from the
driver address match but then over written by the primary.
This change fully implements the if/else of 10bit addressing
and includes a assert if the slave_cfg is NULL, and explains
why dual 10bit addresses on STM32 won't work.

Signed-off-by: Tim Woolliscroft <tim@opteran.com>
2023-11-27 12:16:58 +00:00
Minho Jin a1614e8c95 driver: counter: rpi_pico_timer: fix counter cancel
alarm setting function checks channel callback and it returns -EBUSY
if callback is registered. but alarm cancel function doesn't clear
callback function. this prevents from alarm setting after alarm cancel

Signed-off-by: Minho Jin <kilejin@gmail.com>
2023-11-27 12:15:56 +00:00
Grant Ramsay 82644a31c2 drivers: ethernet: Fix eth_ivshmem shared memory mapping
This driver assumed the ivshmem-v2 output sections would be mapped
contiguously, which is no longer true.

Modify eth_ivshmem to treat each output section independently

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-11-27 12:15:43 +00:00
Grant Ramsay 64cc0764ee drivers: virtualization: Map ivshmem-v2 sections individually
Recent changes to the arm64 MMU code mean that you can no longer map
R/O memory as R/W. Mapping R/W memory now causes a cache invalidation
instruction (DC IVAC) that requires write permissions or else a fault
is generated.

Modify ivshmem-v2 to map each R/O and R/W section individually

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-11-27 12:15:43 +00:00
Jamie McCrae 1b364c1422 drivers: console: uart_mcumgr: Skip reading FIFO during setup
Drops calling the UART FIFO read function during the setup
function (when not in async mode) which could cause issues on
some devices since this function is not called in an ISR.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-27 09:12:36 +00:00
Marco Widmer 20979f80a6 drivers: uart: esp32: use config from device tree
The parity, stop bits and data bits config was hard-coded instead of
taken from the device tree.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2023-11-25 09:04:46 -05:00
Jordan Yates e1cd9f335d bluetooth: hci: spi: handle interrupt return code
Handle the GPIO module failing to configure the interrupt line.

Fixes #65583

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-25 08:53:49 -05:00
Jordan Yates 8b95376625 bluetooth: hci: increase SPI driver stack size
Increase the SPI RX driver stack size by 128 bytes. Overflows have
previously been observed on real hardware at the default stack size of
512.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-25 08:53:49 -05:00
Yong Cong Sin cb10e94799 drivers: intc: plic: minor code refactor
The `riscv_plic_irq_enable` & `riscv_plic_irq_disable` are very
similar, refactor them out into `plic_irq_enable_set_state`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-25 08:51:52 -05:00
Mykola Kvach 5461917952 drivers: clock: rcar: Add r8a779f0 support
Add support of r8a779f0 cpg driver.
r8a779f0 soc has its own clock tree.
Gen4 SoCs common registers addresses have been added in header.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2023-11-25 08:50:47 -05:00
Aymeric Aillet 1738543c5d drivers: pinctrl: Add R-Car Gen4 support
Renesas R-Car Gen4 is different from Gen3 regarding pinmux.

While Gen3 had only one base address to manage all pins,
Gen4 has one set of pinmux registers per GPIO banks.

We could expose one pinmux register per GPIO controllers,
but that would break potential compatibility with Linux
Device tree.

Instead create a reg_base array to parse all reg base from
device tree and identify proper base address based on the pin
definition.

This imply to add a pfc_base parameter to most of the pfc_rcar
function.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2023-11-25 08:50:47 -05:00
Aymeric Aillet eb879413be drivers: gpio: rcar: Add R-Car Gen4 support
Renesas Gen4 SoCs GPIO IPs are using one more
register comparing to Gen3 SoCs.

The new "INEN" register is used to enable general input.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2023-11-25 08:50:47 -05:00
Shahar Hadas cc6bf66345 auxdisplay: Enhance SerLCD auxdisplay driver
Added export of command and special command delays as configurable options.

Signed-off-by: Shahar Hadas <shaharhd@gmail.com>
2023-11-24 22:04:22 +00:00
Dean Sellers 897b300b2e drivers: spi: esp32xx: Fix CS reset over split transaction
In the case where a transaction is spilt due to the rx buff len
being longer than the tx or the transaction buffer exceeding the
size of the requested buffer with non gpio CS, the chip select
would be de-asserted/asserted in the middle of the transaction.

Fixes: #57577

Signed-off-by: Dean Sellers <dsellers@evos.com.au>
2023-11-24 14:45:51 +01:00
Wojciech Slenska b39816a111 drivers: i2c: stm32: fix compilation for PM_DEVICE_RUNTIME
Added clk variable which is needed when CONFIG_PM_DEVICE_RUNTIME
is enabled.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2023-11-24 09:25:43 +01:00
Arnaud MAZIN 1378c90a93 driver: display: sdl: Introduce SDL_DISPLAY_ZOOM_PCT
This option modifies SDL window size and help with readability of very
small screens

Signed-off-by: Arnaud MAZIN <arnaud.mazin@gmail.com>
2023-11-24 09:25:22 +01:00
Jędrzej Ciupis 0bad09c7fa drivers: ieee802154: nrf5: support raw mode
When CONFIG_IEEE802154_RAW_MODE is set there is no network interface
that could provide pointer to the device the interface is running on top
of. The current implementation of nRF5 ieee802154 driver implicitly
assumes that such an interface is always present, which leads to crashes
when raw mode is enabled.

This commit adds support for IEEE802154_RAW_MODE in nRF5 ieee802154
driver by latching pointer to the ieee802154 device on initialization if
needed so that it doesn't have to be retrieved using the network
interface in run-time.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-11-24 09:25:11 +01:00
Armando Visconti 88d91fb82f drivers/sensor: lsm6dsv16x: fix DT configuration read for int1/int2
Since lsm6dsv16x may be multi-instantiated, triggers must be enabled
and configured on DT basis and not only thru CONFIG_LSM6DSV16X_TRIGGER
macro; if either int1-gpios of int2-gpios (or both) are configured
in DT, the flag trig_enable is set to 'true' for that instance.
The previous implentation was lacking the check of those two Device
Tree properties, so trig_enabled was always true for all instances.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-11-24 09:23:47 +01:00
Yong Cong Sin e9fa6f8b4a drivers: intc: plic: add shell cmd to get irq stats for debugging
Introduced `CONFIG_PLIC_SHELL` to enable the build of shell
debugging command to get the hit count of each interrupt
controller's IRQ line. This is especially useful when working
with dynamically installed ISRs, which will be the case for
`plic_sw`.

Example usage:

```
uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits
==================
    10         177

uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits
==================
    10         236

uart:~$ plic stats clear interrupt-controller@c000000
Cleared stats of interrupt-controller@c000000.

uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits
==================
    10          90

```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Maxim Adelman <imax@meta.com>
2023-11-24 09:23:33 +01:00
Yong Cong Sin 8342d87478 drivers: intc: plic: brackets for if-conds & use explicit comparison
if-conditionals should have brackets according to Zephyr's
coding standard, and explicitly compares `edge_irq` against 0.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-24 09:23:33 +01:00
Jamie McCrae 5afaa38e67 drivers: led_strip: ws2812: Remove scratch selection for non-GPIO
The WS2812 LED strip driver does not use a scratch byte, therefore
free up a byte per pixel which was unused except in the GPIO-based
driver whereby it is used

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2023-11-24 09:22:24 +01:00
Anisetti Avinash Krishna e76ace4647 drivers: serial: ns16550: Condition added for dma_callback
Enable a condition as define dma_callback function only if
any one instance of ns16550 has dmas parameter in dts.
This resolves conflict of dma_callback function defined but
not used warning in case of UART_ASYNC_API enabled but dmas
parameter is not provided to any ns16550 UARTs dts instances.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-24 08:30:04 +01:00
Anisetti Avinash Krishna 69d62add98 drivers: serial: ns16550: Fixed few bugs causing CI failure
Removed if (IS_ENABLED()) and used #if as they are causing CI failures
and removed LPSS related functions which are not under LPSS config.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-23 17:21:20 +01:00
Andy Sinclair c3a54ae1c3 drivers: regulator: Fixed reference counting during enable
Reference counting was broken when adding the enable delay.
Now reverted to previous pattern.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-11-23 09:51:39 +00:00
Marcio Ribeiro 468890d70f drivers: clock_control: clock_control_esp32 assert remotion
No longer necessary assert removal

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2023-11-23 10:02:05 +01:00
Hein Wessels a257bcb735 drivers: adc: stm32: add dma support for other mcus
This commit adds support for more STM32 CPUs that has
a different DMA interface. This was tested only for
the nucleo_l476rg.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-11-23 10:00:50 +01:00
Hein Wessels f27e45473a drivers: adc: stm32: driver now agnostic of actual dma name
Previously the STM32 DMA driver was dependent on a very specific
name for the DMA in the DTS. This hidden requirement has caused
a bit of confusion. This commit changes the driver to instead
always use the first DMA listed in the ADC node's dma property.

Should fix: #65387

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-11-23 10:00:50 +01:00
Fabio Baltieri d9fd752392 sensor: mchp_tach_xec: drop PM_DEVICE guards
These are not needed and are now causing build errors since the
pm_device calls are always there and need the header to become a no-op.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 21:54:45 +00:00
Fabio Baltieri 939b90be4c drivers: drop few redundant guard around pm_policy_state_lock_*
The pm_policy_state_lock_put and pm_policy_state_lock_put functions
already become a no-op if CONFIG_PM is not enabled. Drop the guards
around it in few different drivers.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 18:34:36 +00:00
Anisetti Avinash Krishna f66930fd3e drivers: uart: uart_ns16550: Enable Async operations using DMA
Enabled Async API feature for ns16550 driver using DMA support.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-22 17:31:08 +01:00
Ian Morris 18c4574786 drivers: clock_control: clock_control_ra.c: main oscillator select fix
Due to a typo it is not possible to select the main oscillator (MOSC) as a
clock source for an RA Microcontroller. This patch resolves the issue.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2023-11-22 14:57:23 +00:00
Najumon B.A 608cc4d1f2 drivers: ns16550: remove parent init level dependency
remove parent init level dependency such as PRE_KERNEL or
POST_KERNEL. Uart driver init level change always to PRE_KERNEL

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2023-11-22 14:56:18 +00:00
Jerzy Kasenberg 46bbe052d3 drivers: regulator: add LDO/DCDC support for Smartbond.
This add regulator driver for Smartbond DA1469X SOC.
Driver can control VDD, V14, V18, V18P, V30 rails,
full voltage range supported by SOC is covered.
For VDD, V14, V18, V18P DCDC can be configured.

Special VDD_CLAMP (always on) and VDD_SLEPP are added
to allow configuration of VDD in sleep modes.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-11-22 14:55:16 +00:00
Fabio Baltieri ea887af0aa input: gpio_kbd_matrix: drop redundant gpio_kbd_matrix_set_detect_mode
This is called already as soon as the polling thread starts, so the call
in the gpio init function is harmless but redundant, drop it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 11:44:48 +00:00
Fabio Baltieri 6cd72493ff input: gpio_kbd_matrix: add direct access support
When the matrix is connected to consecutive pins on the same port, it's
possible to read the whole row or set the whole column in a single
operation. For the column, this is only possible if the matrix is
configured for driving unselected column, as there's no API to configure
multiple pins at the same time at the moment.

This is more efficient than checking the pins individually, and it's
particularly useful if the row or columns are driven from a GPIO port
expander.

Add some code to detect the condition and enable it automatically as
long as the hw configuration supports it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 10:34:40 +00:00
Fabio Baltieri 8ec1b5487e input: gpio_kbd_matrix: add column drive mode
Add an option to drive inactive columns to inactive state rather than
high impedance. This is useful if the matrix has isolation diodes for
every key, as it allows the matrix to stabilize faster and the API for
changing the pin value is more efficient than the one to change the pin
configuration.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 10:34:40 +00:00
Dawid Niedzwiecki a877bb5001 timer: cortex_m_systick: add idle timer dependency
Allow enabling the Cortex-m idle timer only if power management is set.
It doesn't make sense to use an idle timer without PM.

It allows adding the idle timer chosen node to dts without enabling the
idle timer by default. Now, the PM config has to be set as well.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-11-22 09:28:53 +00:00
Andrei Emeltchenko 98f33a76d6 drivers: tsl2561: Fix type
Use int as correct type, fixes also warning comparing uint8_t < 0.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-22 09:54:39 +01:00
Jamie McCrae 90dfbf99d8 drivers: ieee802154: nrf5: Fix missed variable rename
Fixes and issue with a variable that has been renamed but whose
reference in the source file has not

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 09:54:23 +01:00
Fabio Baltieri f9ed74e0d5 input: gpio_kbd_matrix: add 16 bit rows support
Add a Kconfig option to extend the row type to 16 bits, allowing the
library to handle a 16 row matrix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 09:52:39 +01:00
Fabio Baltieri adcb2f580c input: gpio_kbd_matrix: define a type for the row data
Add a typedef for the row type rather than using uint8_t directly, this
allow supporting bigger matrix as an option by using a different type.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 09:52:39 +01:00
David Leach 23408ac538 drivers: eth_mcus: Conditionally wrap IPV4/6 code
Regression failure introduced problem where driver code was not properly
wrapping code that only existed when compiled for IPv4/v6 applications.

Fixes #65549

Signed-off-by: David Leach <david.leach@nxp.com>
2023-11-21 21:36:22 -06:00
Erwan Gouriou a38c8d25e7 drivers: serial: stm32u5: Serial wakeup is based on autonomous capability
On some devices such as STM32U5, there is no UART WKUP dedicated registers
as the hardware block has an integrated autonomous wakeup capability.
Hence it's capable to wake up the device from stop modes (down to Stop 1).

This behavior relies on RCC UESM bit which is enabled by default at reset
and not modified today in drivers.
Since driver will not compile otherwise, remain in this simple
configuration. This might be changed later on, if a need is seen to disable
UESM bit.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-11-21 16:41:40 +00:00
Pieter De Gendt 3ee526b4c3 drivers: audio: Codec shell fix compiler warnings
This commit fixes the following compiler warnings:
* implicit declaration of function 'strtoul'; did you mean 'strtok'?
* passing argument 2 of 'parse_named_int' discards 'const' qualifier

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-11-21 15:50:17 +01:00
Erwan Gouriou d7513fb526 driver: serial: stm32u5: DMAT Errata behavior valid only on some SoCs
Workaround for DMAT errata was applied on all SoCs declaring STM32U5
DMA compatible.
This errata has been fixed in later SoCs revisions and should not be
applied anymore as this can cause compatibility issues with power mgmt
(can not enter STOP1 in some cases).

Declare a specific Kconfig symbol to restrict the workaround only to the
set of SoCs impacted by the issue and requiring workaround.

Note that I preferred using Kconfig over device tree since it doesn't feel
right to declare a compatible on a silicon bug base.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-11-21 15:49:57 +01:00
Andy Ross 3620e6b969 drivers/console: xtensa_sim_console: implement arch_printk_char_out()
This is an older driver and didn't support the weak
arch_printk_char_out() hook, which is a link-time symbol that allows
logging to work from the first instruction.  Some drivers can't do
that because they need an initialization step, but this one works
great.

Signed-off-by: Andy Ross <andyross@google.com>
2023-11-21 15:49:48 +01:00
Erwan Gouriou e5ab70b724 drivers: uart: stm32: Complete wakeup feature
Serial wakeup feature was only working whe DBG in Stop mode setting
was enabled.
Add required changes to make it functional also when this configuration
isn't set.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-11-21 14:22:22 +01:00
Andrzej Głąbek 7a9ff701d4 drivers: pinctrl_nrf: Fix pin drive configuration
With the introduction of nrfx 3.0.0, values of `nrf_gpio_pin_drive_t`
constants may be defined differently, depending on the SoC family.
Since the nrf-pinctrl.h file is included also from dts files, it is
not possible to use there different definitions of `NRF_GPIO_PIN_*`
values based on Kconfig symbols that indicate given SoC family (as
Kconfig is processed after devicetree) so that those values could
still match `nrf_gpio_pin_drive_t` constants.
To solve this problem, the pinctrl_nrf driver now uses a lookup table
for mapping `NRF_GPIO_PIN_*` indexes to drive configuration values
required by the GPIO HAL.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-11-21 13:12:26 +01:00
Andrzej Głąbek ea1be7f242 drivers: nrf_qspi_nor: Fix and refactor driver initialization
So far the driver first changed the configuration of the flash chip
and after that checked the signature of that chip. This could lead
to improper change of the chip configuration if the actually found
one was different than that specified in devicetree.
This commit reverses the order of these two initialization steps and
also restructures a bit the initialization code.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-11-21 13:09:54 +01:00