Commit graph

23353 commits

Author SHA1 Message Date
Dominik Lau
40e64f1564 drivers: input: use generic touch report in ft5336
Adds the use of generic touch reporting method for ft5336 driver.

Signed-off-by: Dominik Lau <dlau@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-08-28 14:02:43 -04:00
Dominik Lau
74e84a9dfd drivers: input: common properties parsing for touchscreen drivers
Adds a way of reporting touchscreen events
taking common properties into account.

Signed-off-by: Dominik Lau <dlau@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-08-28 14:02:43 -04:00
Fin Maaß
2293e6668a drivers: sensors: add jedec jc 42.4 compliant temperature sensor
This transforms the existing driver for the Microchip MCP9808
to be used as a generic driver to be used with  all
JEDEC JC 42.4 compliant temperature sensor chips.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-08-28 14:02:16 -04:00
Andrey VOLKOV
665da7354b drivers: adc: ra: rename "channels-num" to the more common "channel-count"
The "channels-num" should not be used here, other system's parts are using
"channel-count" instead for the same purpose.

Also property's description has been сorrected.

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
2024-08-28 14:01:46 -04:00
Kapil Bhatt
6aea527c65 drivers: wifi: Add overrun count in statistics
Add overrun count in statistics. It will represent
the number of packets dropped either at received and
sent due to lack of buffer memory.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-08-28 13:59:59 -04:00
Lucas Tamborrino
ff36d10333 drivers: dma: esp32: Handle Rx water mark interrupt
Remove water mark configuration and handle its interrupt
instead, since it is only present in ESP32S3.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-08-28 13:59:42 -04:00
TOKITA Hiroshi
981fb7b900 driver: clock_control: renesas_ra: Use pclkblock's clock src defaultly
When omitting the clk_src definition in a child node of a pclkblock,
it uses the source of the parent node.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-08-28 06:51:25 -04:00
TOKITA Hiroshi
37b24ab8b9 driver: clock_control: renesas_ra: Defining MSTP regs in devicetree
Allows MSTP register addresses to be changed in the device tree
to support different configuration SoCs.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-08-28 06:51:25 -04:00
Jeppe Odgaard
6446ce8982 drivers: rtc: rtc_ll_stm32: add hse clock support
Add support for HSE as the RTC clock source.

The initial implementation has the following limitations:
 - Only whole MHz HSE frequency is supported, e.g. 24.5 MHz will generate a
 compile error.
 - Frequencies equal or above 64 MHz are not supported and will generate a
   compile error.

The implementation has been tested on nucleo_h563zi with:
 - 8 MHz (via hse-bypass)
 - 25 MHz (via external crystal)

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-08-28 06:51:00 -04:00
Anke Xiao
04ae22eb22 drivers: spi: update spi_mcux_flexio.c
After testing the flexio spi_loopback on the ke1xz platform,
it is found that the master transfer and receive are not
synchronized. So add loop code to wait for the master transfer
to complete for frdm_ke17z and frdm_ke17z512 platforms.

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
2024-08-28 06:50:50 -04:00
Tim Lin
2cce7ff4a8 Revert "drivers/interrupt: it8xxx2: Register interrupt number 0 to handle"
This reverts commit 93f2b08b460a47e17ac756b61576a05cff88d650.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-08-28 06:49:36 -04:00
Ian Morris
a329a0c09f drivers: sensor: tmp116: Add ability to set operating mode of TMP116/7
Adds support for setting the operating mode of the TMP116/7 sensor to
either shutdown, continuous conversion or one-shot mode.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-08-27 15:14:59 -04:00
Ayush Singh
348388b678 drivers: cc13xx_cc26xx: pwm: Add polarity flag support
- Allow setting polarity from DT.
- At least on bcf, going from 0 to 255 causes brightness to decrease
  (although 0 is still off and 255 is still on).
- Seems to work as expcted by using TnPWML register.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-08-27 10:51:04 -04:00
Laurentiu Mihalcea
e224a41ec8 drivers: dai: sai: don't crash on underrun/overrun
TX/RX FIFO underrun shouldn't crash the RTOS when it occurs.
Also, since this can also happen under "normal" conditions
(i.e: DMA doesn't copy data fast enough from/to SAI's FIFOs)
the software should be able to recover from it.

As such:
	1) Remove `z_irq_spurious()` call.
	2) Clear error flag
	3) De-escalate error message to warning message

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-08-27 10:50:53 -04:00
Mathieu Choplain
e4a7c0f9ce drivers: intc: stm32: rebrand EXTI API to be hardware-agnostic
This commit rebrands the STM32 EXTI API to a more hardware-agnostic
"GPIO interrupt controller" API, in anticipation of the introduction of
new series lacking the EXTI peripheral. The GPIO and EXTI drivers are
updated to match the rebranded API.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
5cd274ce48 drivers: intc: stm32: make stm32_exti_line_t opaque
This commit makes the contents of the stm32_exti_line_t data type opaque to
the EXTI GPIO interrupt controller API users. The GPIO driver is updated
to comply with this API change.

N.B.: while some assertions are removed as part of this commit, they were
broken since forever anyways, so nothing of value is lost.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
0551825ca3 drivers: gpio: stm32: move EXTI line port configuration to proper driver
Move the functions that interact with EXTI configuration registers to
select or get the GPIO port that triggers events on a given EXTI line
to the EXTI driver.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
d34f5f27bf drivers: gpio: stm32: move EXTI clock initialization to proper driver
Move the EXTI clock initialization from GPIO to EXTI driver.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
d0f528e933 drivers: gpio: stm32: modify EXTI configuration functions
Modify all functions in the GPIO driver that interact with the EXTI
so that names, signatures and comments match what they do better.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
ea09463b7f drivers: gpio: stm32: use types with correct semantics
Use the `gpio_pin_t` type for all variables that hold a pin number (0..15).

Change all `int` to `uint32_t` instead, as signedness is unwanted.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
e2c4b3eb34 drivers: intc: stm32: reorder functions in EXTI driver
This commit reorders the functions in the EXTI driver.
Internal functions and exported functions are now grouped with each other.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
5e5974a0f9 drivers: intc: stm32: comsetic changes in EXTI driver
Update comments, rename STM32_EXTI_INIT_MACRO, correct whitespace.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
988ccae7a5 drivers: intc: stm32: use unsigned types for API
This commit changes the EXTI driver API to use unsigned types
for all parameters previously typed as `int`, as the signedness
is unneeded and unwanted.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
784d05bfa4 drivers: intc: stm32: fix assertions in EXTI driver
All assertions performed in the EXTI drivers were wrong, as they passed
values to __ASSERT_NO_MSG instead of predicates. Update all assertions
to be actually useful.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
b1b85fcf48 drivers: intc: stm32: remove STM32_EXTI_LINE_NONE macro
The EXTI driver API defined in exti_stm32.h is reserved for exclusive usage
by the STM32 GPIO driver, which doesn't use this macro. Since there is no
usecase for it anyways, it can be removed for future-proofing.

The STM32 UART driver is an unintended user of this definition, however.
Replace it with a private #define which is more appropriate anyways.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Richard Wheatley
1aebfcdb99 drivers: serial: UART PL011 Ambiq PM Fix
apollo3 driver added PM to UART for only apollo3
but defined PM function for both causing an error
in twister

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-08-27 10:49:38 -04:00
Jordan Yates
7b4e7ff9ed flash: spi_nor: handle SPI bus power
Automatically request and release the SPI bus before talking to the
flash chip.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-27 07:15:28 -04:00
Jordan Yates
986fd88416 flash: spi_nor: automatically run device runtime PM
Automatically handle device runtime PM for all flash API calls.
Asynchronously release the device after a small delay to minimise power
state transitions under multiple sequential API calls (e.g. NVS).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-27 07:15:28 -04:00
Jordan Yates
6487a2a663 flash: spi_nor: remove SPI_NOR_IDLE_IN_DPD
Remove `SPI_NOR_IDLE_IN_DPD` to simplify the possible transition states
in the `spi_nor` driver. This option was originally added 5 years ago
when device runtime PM was in a much less mature state.

I do not believe having a separate power management implementation for
this one in-tree driver is in the interests of the project.

The behaviour of `SPI_NOR_IDLE_IN_DPD` leads to extremly suboptimal
behaviour in use cases where multiple small reads are performed
sequentially, see #69588.

Removal of this option does not break the behaviour of any existing
applications, only increases current consumption in idle by ~10uA until
device runtime PM is enabled.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-27 07:15:28 -04:00
Armando Visconti
9ea4cb96cd drivers/sensor/st: Fix wrong data byte swap for be
A 16-bit value built using byte shifts and ORs from a given
couple of lsb and msb bytes will result to be the same on both
little-endian and big-endian architectures, e.g.

    uint8_t lsb, msb;
    int16_t val;

    /* val is the same number on both le and be archs, but has
       different layout in memory */
    val = (msb << 8) | lsb;

All the xyz_raw_get() APIs of stmemsc sensor module build the sensor
data using the above method and DO NOT hence require (it actually leads
to wrong values on big-endian machines) to use any le/be swap routines,
such as sys_le16_to_cpu().

Fix #75758

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-08-27 07:07:52 -04:00
Emilio Benavente
cdfa11ee94 drivers: counter: mcux_lptmr: Updated lptmr to support multi instance.
Updated the counter_mcux_lptmr driver to support multiple
instances of the lptmr peripheral. Also added a new
binding property to identify if the user is using
counter-mode or pulse mode. since we were previously using the
prescaler value to check this which could be wrong
if used as a division value for getting the freq.
Added a property that allows the user to decide
what the counter value in lptmr should be divided by.
Cleaned up INIT macro for lptmr.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-08-27 12:46:11 +02:00
Thorsten Spätling
5ce7845f71 mipi_dbi: stm32: use proper type for timeout argument
The reset function uses uint32_t as its 2nd parameter, which leads to the
following compiler warning.

zephyr/drivers/mipi_dbi/mipi_dbi_stm32_fmc.c:176:18: warning:
  initialization of 'int (*)(const struct device *, k_timeout_t)' from
  incompatible pointer type 'int (*)(const struct device *, uint32_t)'
  {aka 'int (*)(const struct device *, unsigned int)'}
  [-Wincompatible-pointer-types]
  176 |         .reset = mipi_dbi_stm32_fmc_reset,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~

When you look at similar drivers,

/drivers/mipi_dbi/mipi_dbi_smartbond.c#L126
/drivers/mipi_dbi/mipi_dbi_nxp_lcdic.c#L561

you notice they use k_timeout_t.

So the whole fix is to correct the type.

Signed-off-by: Thorsten Spätling <thorsten.spaetling@vierling.de>
2024-08-27 12:45:48 +02:00
Tomasz Moń
debc744665 drivers: udc_dwc2: Allow not-multiple-of-4 mps in DMA mode
Remove the early max packet size check on endpoint activation, because
there are valid use cases where the max packet size is not multiple of 4
and the stack won't perform multi-transaction transfers. Example use
case is UAC2 explicit feedback endpoint that has Max Packet Size equal
3 when device is operating at Full-Speed.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-08-27 12:45:42 +02:00
Tomasz Moń
0b242dea42 drivers: udc_dwc2: Do not enable inactive endpoint
Fail TxFIFO write if the endpoint is not activated, because there is
essentially no fifo assigned. Writing to not activated endpoint is
possible, but it does tend to corrupt fifo number 0 which is used for
control transfers. USB stack should not really be attempting to write to
endpoints that have not been activated (ep_enable called).

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-08-27 12:45:42 +02:00
Tomasz Moń
c3daf6f220 drivers: udc_dwc2: Support isochronous endpoints
Store SOF frame number and use the information to set the Even/Odd
microframe bit when enabling isochronous endpoints. Reject received
isochronous data if number of packets received does not align with
received PID.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-08-27 12:45:42 +02:00
Tomasz Moń
de28a828c5 drivers: udc_dwc2: Unify OUT transfers in Completer and DMA mode
RxFLvl interrupt should only handle the actual data movement from RxFIFO
to the buffer. OUT transfers are completed in XferCompl handler both in
DMA and Completer mode. This reduces code size by avoiding having
separate code paths based on operating mode.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-08-27 12:45:42 +02:00
Tomasz Moń
31ee5d9787 drivers: udc_dwc2: Pass fifo number to tx fifo flush
Function dwc2_set_dedicated_fifo() calls dwc2_flush_tx_fifo() before the
diepctl register is written. The register will be only written after the
dwc2_set_dedicated_fifo() finishes. Solve the problem by passing fifo
number directly instead of endpoint address to dwc2_flush_tx_fifo().

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-08-27 12:45:42 +02:00
Tomasz Moń
9f98ee854c drivers: udc_dwc2: Add isochronous register bit defines
Add all register bit defines necessary for isochronous transfers. Clean
up the endpoint transfer size register defines clearly separating IN and
OUT registers because they do use different bit fields. Add alternate
bit names for bits that do have different meaning based on configured
endpoint transfer type.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-08-27 12:45:42 +02:00
Daniel DeGrasse
ff7ac415d7 drivers: mipi_dbi: nxp_lcdic: calculate reset delay correctly
Reset delay was not being calculated correctly in lcdic driver, the
ticks field needs to be accessed directly within the timeout structure
to calculate the correct delay time

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-08-27 12:44:38 +02:00
Jilay Pandya
4f36fa8010 stepper: driver: introduce gpio driver
This commit introduces a basic gpio stepper driver

Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-08-27 12:43:39 +02:00
Jilay Pandya
1af0ec1d96 stepper motor controller: introduce api
This commit introduces api for stepper motor controllers

Signed-off-by: Dipak Shetty <dipak.shetty@zeiss.com>
Signed-off-by: Florian Guhl <florian.guhl@zeiss.com>
Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-08-27 12:43:39 +02:00
Jordan Yates
d97cc46bdd gnss: rename u-blox M10 driver to M8
The driver in tree is for u-blox M8 devices, not M10. The M10 series
devices (from Protocol Version 23.01) use a different, non backwards
compatible interface for configuring the modem behaviour.

Of the two boards tested in the original PR, the "VMU RT1170" is
explicitly listed as having a u-blox NEO-M8N modem, while I have
been unable to find any information online about the "FMURT6" board.

Leaving the naming as-is will cause problems when M10 drivers are
contributed.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-26 17:27:12 -04:00
David T. Pocock
b2475804f8 serial: bluetooth: Print warning once when ring buffer is full
This avoids cluttering the logging subsystem.

Signed-off-by: David T. Pocock <davidtpocock@gmail.com>
2024-08-26 17:24:47 -04:00
Pisit Sawangvonganan
2f4ca35105 drivers: gpio: renesas_ra_ioport: simplify pin configuration logic
- Removed zero initialization of `pincfg` structure as all members
  are guaranteed to be set.
- Introduced `pfs_cfg` as an intermediate variable to store data in
  the CPU register instead of stack.
- Simplified pin setting logic by relying on `pfs_cfg` being
  zero-initialized, eliminating the need for explicit bit clearing.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-26 17:23:31 -04:00
Fabio Baltieri
947ff45e7a input: kbd: add power management support to all keyboard scan drivers
Add power management support to various drivers:
- gpio-kbd-matrix
- ite,it8xxx2-kbd
- nuvoton,npcx-kbd
- microchip,xec-kbd

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-08-26 14:45:21 -04:00
Fabio Baltieri
eff584bf2d input: kbd_matrix: add power management support
Add power management support to the keyboard matrix library. This
provides a generic pm_action function that changes the keyboard matrix
scan in two places when suspended:
- reset the state to 0 for all columns
- do not enable key press detection

This ensures that any key that was pressed when the device is suspended
is released, and no other scan happens until the device is resumed.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-08-26 14:45:21 -04:00
Raffael Rostagno
91f8487845 wifi: esp32c2: Add support
Added wifi support to ESP32C2 and ESP8684

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-26 14:44:37 -04:00
Michael Zimmermann
aa3f46cbbf drivers: serial: Add initial SiM3U1xx support
This supports polling and interrupt APIs, but not the async API.

Signed-off-by: Michael Zimmermann <michael.zimmermann@grandcentrix.net>
2024-08-26 18:51:36 +02:00
Michael Zimmermann
2ab246d17e drivers: gpio: Add initial SiM3U1xx support
This is just the driver for banks 0 to 3. Bank 4 will come via a
separate commit since it needs a different driver.

Signed-off-by: Michael Zimmermann <michael.zimmermann@grandcentrix.net>
2024-08-26 18:51:36 +02:00
Michael Zimmermann
d49cc8a56f drivers: clock_control: Add initial SiM3U1xx support
This serves two main purposes:
- change the CPU clock via devicetree nodes
- provide the APB frequency to device drivers via the clock driver
  interface

Theoretically this could also support choosing between the available
clock sources, but right now we only support LPOSC0 going into PLL0,
going into AHB.

Turning the PLL back off is also not supported since the only current
use case is to set the PLL frequency, turn it on, and switch the AHB
over to it.

Signed-off-by: Michael Zimmermann <michael.zimmermann@grandcentrix.net>
2024-08-26 18:51:36 +02:00