Commit graph

24538 commits

Author SHA1 Message Date
Tomasz Moń
5fc0405a6f drivers: usb: udc_dwc2: Synchronize thread with UDC API
UDC API handlers and DWC2 driver thread share not only software
constructs, but also the underlying hardware. Ensure that any UDC API
call is not preempted by DWC2 driver thread (and vice versa) by
acquiring the lock in thread handler.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-25 12:03:12 +01:00
Tomasz Moń
c2f2d8ce5d drivers: usb: udc_dwc2: Replace queue with events
When the queue is full, all messages posted inside interrupt handlers
are simply dropped. This problem can be remedied by having the message
queue large enough, but determining the maximum number of messages that
can ever be posted in the system is really complex task.

Hopefully in DWC2 driver there is finite number of events that have to
be processed inside thread handler. Therefore it is unnecessary to
determine the maximum queue size for the events if the events are posted
to k_event object instead of send to k_msgq object.

Use combination of three k_event structures to handle all possible event
sources. This not only guarantees by design that no event will be lost,
but also slightly reduces the memory usage.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-25 12:03:12 +01:00
Tomasz Moń
2c78a4d243 drivers: usb: udc_dwc2: Remove forward defitions
Reorder functions in order to remove forward function defitions.
No functional changes.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-25 12:03:12 +01:00
Declan Snyder
b29190c314 drivers: nxp_enet: Fix tx error handling
The code path for error handling and timestamping in tx path
was meant to be identical in function to old eth_mcux driver,
but there is actually a discrepancy causing no error handling
for timestamped frames, fix it.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-09-25 04:05:07 -04:00
Sylvio Alves
5fc3f56125 drivers: counter: esp32: disable timer before int clear
Make sure to stop timer counter before interrupt is cleared,
otherwise it might re-trigger it due to default interrupt level mode.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-25 04:04:26 -04:00
Ryan McClelland
bc3390111e drivers: i3c: shell: add helper function to parse args
There is a lot of repeated code for parsing arguments. Add a function
to do the same in every place.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-25 04:04:13 -04:00
Ryan McClelland
e602590931 drivers: i3c: add iterate through i3c/i2c devices macros
Add i3c_bus_for_each_i3cdev and i3c_bus_for_each_i2cdev to more easily
iterate through each i3c or i2c device on the bus.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-25 04:04:13 -04:00
Alexander Kozhinov
0f576b047f copyright: change email
Change my email copyright address since unavailability of old one

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-09-25 04:04:03 -04:00
Abderrahmane Jarmouni
e71b50244e drivers: dma: stm32_bdma: fix comments
Some comments were not updated following the change in how uncached
memory regions are defined in devicetree.

Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
2024-09-25 04:03:18 -04:00
Ryan McClelland
32f0a15486 drivers: i3c: shell: add ccc rstact shell command
Add a shell command for rstact format 2 and 3.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-25 04:03:04 -04:00
Ryan McClelland
e20b556fb4 drivers: i3c: add rstact format 2 and 3 helpers
Add rstact direct write and direct read formats helper functions.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-25 04:03:04 -04:00
Jeppe Odgaard
bb88d5f1f1 drivers: pwm: pwm_stm32: remove capture overflow log err
The `LOG_ERR` will spam the log if the window is low e.g. 1 ms.
Also the PWM capture callback will be called with an error, which allows
handling and logging the error if desired.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-09-25 04:01:59 -04:00
Carson Green
f698fd525e drivers: dma: stm32: only clear busy flag when transfer is complete
The STM32 DMA driver can provide interrupts for transfers not yet complete.

However, the current implementation will clear the busy flag for all
interrupts when CONFIG_DMAMUX_STM32 is not enabled. The previous fix for
when CONFIG_DMAMUX_STM32 is enabled should also apply when not enabled.
Also if CONFIG_DMAMUX_STM32 is enabled busy flag will not be cleared when
error interrupts occur.

With this change, the busy flag is only cleared when completion interrupts
in non-cyclic mode or error interrupts occur. These are the cases where
transfer will not continue.

Signed-off-by: Carson Green <cgreen@tuta.com>
2024-09-24 14:24:28 -05:00
Phi Bang Nguyen
16fc8f84fc drivers: video_sw_generator: Add support to change frame rate
Add code to to set / get / enumerate frame rates (intervals).

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-09-24 14:23:56 -05:00
Mahesh Mahadevan
f1b57f6d8a drivers: i3c: Move clocking code out of NXP I3C driver
The clocking code present inside the NXP I3C is SoC specific.
This has been moved to the SoC folder which makes this driver
more flexible to clock architecture variations between SoC's
and SDK driver clock API variations.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-09-24 09:21:28 -04:00
Guillaume Gautier
7e160453e2 drivers: adc: stm32: fix stm32u5 extended calibration
Add Data Memory Barrier during the extended calibration of STM32U5, as it
is done in STM32Cube HAL, to avoid sporadic errors during calibration that
may result in measures that are offset from real values.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-09-24 10:12:26 +02:00
Grzegorz Bernat
a654bfbdfa soc: intel: renamed soc from ace30_ptl to ace30
Renamed soc from ace30_ptl to ace30.
We were previously using the wrong soc name.
The correct name is ace30.

There is only one ptl platform, but there can be several ace30 platforms.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-09-24 10:10:37 +02:00
Lauren Murphy
e0bd9aef66 drivers: sensor: add mmc56x3 sensor driver
Adds Memsic MMC56X3 magnetometer and temperature
sensor driver.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-09-24 10:09:25 +02:00
Lauren Murphy
3a595610e6 drivers: sensors: move mc3419 into parent memsic folder
Moves MC3419 into a parent Memsic folder, to be joined
later by MMC56X3.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-09-24 10:09:25 +02:00
Lucas Tamborrino
43cc36f4bc drivers: video: Add SMH option for video buffer
This commit enables the user to choose whether to
allocate the video buffer from the video heap pool
or use a memory region with specific extra capabilities,
such as being cacheable/non-cacheable or using external
memory.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-09-23 18:12:20 -04:00
Sadik Ozer
18c991acc4 drivers: pwm: Add MAX32xxx PWM driver
Common pwm driver for MAX32xxx MCUs

Co-authored-by: Mert Ekren <mert.ekren@analog.com>
Co-authored-by: Mert Vatansever <mert.vatansever@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-23 18:12:00 -04:00
TOKITA Hiroshi
8dce43bfc1 drivers: sensor: wsen: wsen_pads: Fix variable type mismatch
Fix to eliminate warnings caused by type mismatch.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-09-23 18:09:25 -04:00
TOKITA Hiroshi
90fb012db7 drivers: sensor: st: iis328dq: Avoiding declaring unused variables
Separating declarations of variables not referenced with #ifdef
when CONFIG_IIS328DQ_THRESHOLD is disabled.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-09-23 18:09:25 -04:00
Raffael Rostagno
d392e9b345 drivers: mbox: esp32: IRQ priority and flags from dts
Get IRQ priority and flags from device tree, allowing for
custom configuration.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-09-23 18:08:36 -04:00
Bill Waters
eb19d32588 drivers: Remove CONFIG_PINCTRL in defconfig files
The CONFIG_PINCTRL setting is removed from the board
_defconfig files.  And "select PINCTRL" is added to
the appropriate driver files.

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2024-09-23 18:08:14 -04:00
Martin Jäger
46922b51ce drivers: dac: dac_shell: consider buffered and internal options
The buffered and internal options were not assigned in the channel_cfg,
so they would end up at a random state.

The cfg struct is now properly zero-initialized and both options can
be set using optional parameters -b and -i.

Fixes #75884

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-09-23 13:21:11 -05:00
Jeroen Broersen
cf837dd371 drivers: gpio: stm32: keep track of clock enabling per pin
The driver enables the clock of a gpio-port if any of the
pins use the port. This is done by calling pm_device_runtime_get
when a pin is used and pm_device_runtime_put when the pin is not
used anymore.
These calls needs to be balanced. But if a single pin was configured
as GPIO_DISCONNECTED multiple times, every time pm_device_runtime_put
was called.
This caused the clock of the port to be stopped and therefore also
other pins on the same port stopped working.

This commit fixes this by keeping track of which pin on a port
has requested the clock and only call pm_device_runtime_get or
pm_device_runtime_put when the clock-request for the specific pin
changes.

Fixes #77698

Signed-off-by: Jeroen Broersen <jbroersen@interact.nl>
2024-09-23 13:20:23 -05:00
Krzysztof Chruściński
701beecb5c drivers: serial: nrfx_uarte: Split async control block structure
Split async control block structure into tx and rx structures.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-23 14:09:54 +01:00
Fabio Baltieri
61f4ba27ad drivers: i2c: add an option to skip auto-sending stop on last message
The I2C transfer API has been recently changed to always automatically
set a STOP on the last message, which was well documented but
implemented only by few drivers.

Unfortunately, while documented, this is a change in the current
behavior and it turns out that some applications depended on it for some
complex operations.

Add a flag to temporarily restore the old behavior, buying time to fix
the application code depending on this.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-09-23 14:07:49 +01:00
Michał Barnaś
b9ef11d4b4 usbc: add event-driven handling of CC lines changes in ps8815 driver
Add bool value that stores the CC change information received in
the interrupt of TCPC alert line. In sink role when in disconnected
state, polling the CC lines causes the chip to be awaken from sleep
mode increasing the power usage. When partner is connected, or any
other CC lines change happens, the chip informs about it with alert.
It can be cached and used instead of asking the chip directly.

Signed-off-by: Michał Barnaś <barnas@google.com>
2024-09-23 10:03:19 +02:00
Michał Barnaś
82a6e9fc66 usbc: add TCPC driver for Parade PS8815 chip
Add support for the PS8815 and used with other PS8xxx family chips.

Signed-off-by: Michał Barnaś <barnas@google.com>
2024-09-23 10:03:19 +02:00
Michał Barnaś
90c65cffdb usbc: add support for vbus measurement using TCPCI compliant device
Add support for VBUS measuring part of the TCPCI compliant device.
This device should be used as a child-node for the more specific
TCPC driver and referenced by the vbus property in the usb-c
connector node.

Signed-off-by: Michał Barnaś <barnas@google.com>
2024-09-23 10:03:19 +02:00
Michał Barnaś
198e040b4e usbc: add generic TCPCI related functions
Add generic functions that will be common to all TCPCI compliant
drivers like registers reading, writing and updating.

Signed-off-by: Michał Barnaś <barnas@google.com>
2024-09-23 10:03:19 +02:00
Fabrice DJIATSA
d2ddb6541d drivers: pwm: update stm32 pwm driver
add stm32u0x soc configuration to be able to
run test on new boards.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-23 10:02:16 +02:00
Michal Smola
1c944ba9ef drivers: adc: adc_mcux_adc16: Remove reference check
Only ADC_REF_INTERNAL reference option is allowed in
adc_mcux_adc16 driver, but the reference is not used
for driver configuration. Internal, external or VDD
can be used in reality depending on SoC type and
its configuration.
Remove the reference option check to allow any reference
option from Devicetree.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2024-09-23 10:02:10 +02:00
Naveen Gangadharan
27d5528174 drivers: i3c: cadence: fix tx_fifo width for target mode on REV_ID 1.7
Cadence I3C target FIFO width has been increased to 4 bytes in i3c
hardware REV_ID 1.7. Writing 1 byte to 4 byte FIFOs can cause
unintentional padding for bytes written from TX threshold interrupt
handler. Fixed the target callback to handle tx width of i3c target
writes to FIFO, by using run time rev_id check.

Signed-off-by: Naveen Gangadharan <naveeng1001@meta.com>
2024-09-23 10:02:01 +02:00
Chew Zeh Yang
62c0fc3e14 drivers: gpio_ambiq: Fixed uninitialized return variable
Fixed uninitialized return value variable issue, which would cause
functions to wrongly return non-zero value despite a successful
execution.

Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
2024-09-23 10:01:40 +02:00
Quy Tran
c17a8d3e84 drivers: i2c: change to use IRQ_CONNECT in Renesas RA i2c driver
Change to use IRQ_CONNECT instead of IRQ_DIRECT_CONNECT

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2024-09-23 10:01:26 +02:00
TOKITA Hiroshi
923f47dd80 drivers: auxdisplay: Remove unused variables
Remove unused variables for suppress warnings

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-09-21 12:23:51 +01:00
TOKITA Hiroshi
945f9291c4 drivers: led_strip: tlc5971: Enable when the dt-node exists
The TLC5971_STRIP config enables if the "ti,tlc5971" node exists.
Also, removing the setting that explicitly enables in the
`tests/drivers/build_all/led_strip` test.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-09-21 12:23:45 +01:00
Fabian Blatz
c525dc0813 drivers: stepper: Add fake stepper driver
Add `zephyr,fake-stepper` compatible which can be used inside of unit
tests.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-09-21 12:23:19 +01:00
Fabian Blatz
c694858d06 drivers: stepper: add stepper shell
Add shell commands to enable/disable, move, set velocity, configure
micro-step resolution, and display stepper motor status. Includes an
`info` command to output all relevant data with graceful handling of
unsupported features.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-09-21 12:23:19 +01:00
Chekhov Ma
c93a5de3ae drivers: mcux_igpio: improve pin-gaps handling
Improve handling of "pin-gaps" using "GPIO_DT_RESERVED_RANGES_NGPIOS"
series macro.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-20 15:18:49 -05:00
Chekhov Ma
a296705d37 drivers: mcux_rgpio: improve pin-gaps handling
Improve handling of "pin-gaps" using "GPIO_DT_RESERVED_RANGES_NGPIOS"
series macro.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-20 15:18:49 -05:00
Felipe Neves
591b7d380b drivers: video: gc2145: add resolution support
Add VGA and QVGA resolution support to enable
usage of gc2145 sensor by smaller ram capable devices.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2024-09-20 15:18:13 -05:00
Tom Chang
9795dc2758 drivers: espi: npcx: add support to customize vw index
This CL adds support to revise vw index accroding to the
vw-index-extend-set.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-09-20 15:14:57 -05:00
Tom Chang
0e4ac766fb drivers: espi: npcx: add support for DnX VW
This CL adds support to handle DnX virtual wire signal.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-09-20 15:14:57 -05:00
Declan Snyder
448485a967 drivers: soc_mcux_flash: Add flash_k4 support
Add support for flash_k4 api from the mcux SDK.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-09-20 15:14:11 -05:00
Declan Snyder
2db9ea94de drivers: kinetis-pinctrl: Account for SCG K4
Add support for SCG K4 clock control in kinetis pinctrl.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-09-20 15:14:11 -05:00
Declan Snyder
a8b1ac26d8 drivers: clock_control: Add MCUX SCG K4 driver
Add driver for newer SCG clock control peripheral.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-09-20 15:14:11 -05:00