Commit graph

23353 commits

Author SHA1 Message Date
Krzysztof Chruściński
266847665a drivers: serial: nrfx_uarte: Use nrfx_gppi helper
Use nrfx_gppi as abstraction over (D)PPI.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-26 11:10:10 +01:00
Ryan McClelland
00b6443a55 drivers: i3c: add additional option to setdasa
struct i3c_ccc_address is intended to match the output where the address
is left shifted by 1 for SETDASA and SETNEWDA. Require the operations
calling it to shift the data.

add an additional parameter for the setdasa function which will allow for
the da to be configured rather than being hard coded.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-26 03:34:16 -04:00
Tomasz Moń
e2f2e448c7 drivers: udc_dwc2: Implement USBHS hibernation quirks
Use the quirk to keep only the necessary clocks running when the core is
hibernated. The quirk is necessary to bring the USB suspend current
below the USB 2.0 suspend current limit.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-26 03:33:52 -04:00
Tomasz Moń
f8df6b49e1 drivers: udc_dwc2: Add hibernation vendor quirks
Make it possible to have vendor quirks after hibernation entry sequence
and before hibernation exit sequence.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-26 03:33:52 -04:00
Aksel Skauge Mellbye
e77d082b4e drivers: bluetooth: silabs: Initialize PHY
Initialize PHY as part of controller init sequence.

Disable 2M and coded PHYs for now, as they cause issues on devices
that don't support them. This should be made configurable in the future.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-09-26 03:33:38 -04:00
Declan Snyder
30a8f87d6a drivers: spi_mcux_lpspi: Fix synchronous DMA CS
Fix the chip select when using the synchronous API with DMA path.

Note need to use TxDataRequest flag instead of ModuleBusy flag now
because module busy flag will not deassert until PCS deasserts.

This does not fix CS for the non-DMA path, because that would require a
large driver rework.

Do not skip configuration when calling transceive with the same spi_cfg
because we need to write a new command word.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-09-26 03:33:05 -04:00
Declan Snyder
0186bfb2d0 drivers: spi_mcux_lpspi: Enable debug mode
When CONFIG_DEBUG is turned on, enable debug mode for the LPSPI.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-09-26 03:33:05 -04:00
Sreeram Tatapudi
5c0275df27 drivers: gpio: ifx: Update GPIO driver to use PDL instead of HAL
Update the GPIO driver to use PDL API instead of HAL API to fix the
issue with configuring interrupts on both edges

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-09-26 03:32:13 -04:00
Krzysztof Chruściński
cae53af136 drivers: serial: nrfx_uarte2: Remove CONFIG_UART_n_GPIO_MANAGEMENT
Remove Kconfig option that no longer has any use after pinctrl
driver is introduced.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-26 03:31:39 -04:00
Krzysztof Chruściński
76db5b24e0 drivers: serial: nrfx_uarte: Remove CONFIG_UART_n_GPIO_MANAGEMENT
This is a leftover from pre-pinctrl era and no longer makes sense.
Driver always manages gpio through pinctrl.

Support removed from uart and uarte shims.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-26 03:31:39 -04:00
Ren Chen
e632cc99c5 usb: it82xx2: lock irq for handling suspended flag
The suspended flag is checked during SOF and RESUME interrupts, and it
is modified within a delayable work item. To prevent race conditions,
this update ensures that interrupts are disabled (locking IRQs) before
modifying the suspended flag. Additionally, the RESUME interrupt is
enabled only when the USB is suspended.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-09-26 03:30:51 -04:00
Tomasz Moń
ac7d55b939 drivers: usb: udc_dwc2: Support Remote Wakeup
According to USB 2.0 Specification the remote wakeup device must hold
the resume signaling for at least 1 ms but for no more than 15 ms. The
DWC2 otg controller requires the software to drive the remote wakeup
signalling for appropriate duration (when LPM is disabled, which is
currently always the case in udc_dwc2). Arbitrarily choose to drive the
resume signalling for 2 ms to have sufficient margin in both directions.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-25 12:03:12 +01:00
Tomasz Moń
68b8818e02 drivers: udc_dwc2: Add missing GHWCFG bit defines
Add missing GHWCFG2 and GHWCFG3 defines based on nRF54H20 registers
documentation.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-25 12:03:12 +01:00
Tomasz Moń
b89b7ed542 drivers: usb: udc_dwc2: Exit hibernation on disable
The PMU is not reset by core reset and therefore it is necessary to exit
hibernation on DWC2 disable to prevent endless PMU interrupt loop when
the driver is enabled again.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-25 12:03:12 +01:00
Tomasz Moń
f7650262bf drivers: usb: udc_dwc2: Enter hibernation in thread
Enter hibernation in thread context with the lock held to make sure to
not queue any transfers when the core is hibernated.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-25 12:03:12 +01:00
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