Commit Graph

19723 Commits

Author SHA1 Message Date
Krzysztof Chruściński e11d050b23 drivers: pwm: nrfx: Improve runtime PM
Rework PM handling to use pm_device_driver_init(). Shim is not using
put and get internally as there is no api that disables or stops
pwm so it is hard to determine when to put the device. There are cases
when PWM peripheral is stopped but PWM is still active because
duty cycle is 100% or 0% and pin is driven by GPIO and not PWM.

If user want to use runtime PM with PWM it is possible and getting
the device will initialize internal data and putting will suspend
by forcing PWM stop if used and setting pins to sleep state. However,
from power consumption perspective it is enough to set 0% or 100%
duty cycle on all channels.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-11 13:18:34 -04:00
Krzysztof Chruściński c3a33cfd3e drivers: pwm: nrfx: Disable PWM peripheral when not used
Shim was not correctly disabling PWM when it was not used. Task
STOP was triggered but PWM->ENABLE remained set which caused
increased current. Added interrupt and enabled event handler in
the nrfx driver to allow disabling PWM on STOPPED event.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-11 13:18:34 -04:00
Krzysztof Chruściński 0ab86c48dd drivers: pwm: nrfx: Improve device generation macros
Use NRFX_FOREACH_PRESENT macro to iterate over all PWM instances
and create device only for those enabled in the devicetree.
This approach removes need of changing driver code when new
instance id is added.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-11 13:18:34 -04:00
Guillaume Gautier ded9e11d59 drivers: dma: stm32 dmamux: fix for c0 hal update
Fix the DMAMUX driver for the STM32C0 HAL update. Typedef used in function
is now const.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-11 13:18:01 -04:00
Guillaume Gautier 48ba84bb95 drivers: clock: stm32 common: update ahb prescaler
STM32C0 have a different prescaler for SYSCLK and for HCLK.
Updates the clock driver to use the appropriate prescaler for each series.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-11 13:18:01 -04:00
Reto Schneider 7fa5a222a0 drivers: flash: Sort CMake and Kconfig files alphabetically
By sorting the lines alphabetically, merge conflicts can be reduced.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-11 13:16:15 -04:00
Joakim Andersson d794d58d64 drivers: nrf_qspi_nor: Check poll period before sleep
Check that the poll period is non-zero before sleeping.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-10-11 13:16:05 -04:00
Joakim Andersson 14c896b647 drivers: nrf_qspi_nor: Fix build without multithreading
Fix build of nrf_qspi_nor flash driver without multithreading enabled.
This is required for builds like mcuboot.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-10-11 13:16:05 -04:00
Wajdi ELMuhtadi 9af50a7b19 drivers: sensor: wsen_tids: remove wsen_tids driver
Remove wsen_tids since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 8f684cfe9b drivers: sensor: wsen_pdus: remove wsen_pdus driver
Remove wsen_pdus since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 8c0b09ddc3 drivers: sensor: wsen_pads: remove wsen_pads driver
Remove wsen_pads since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 449bf8019c drivers: sensor: wsen_hids: remove wsen_hids driver
Remove wsen_hids since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 5f584052d8 drivers: sensor: wsen_itds: remove wsen_itds driver
Remove wsen_itds driver since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Duy Phuong Hoang. Nguyen 59dbbb347d drivers: pwm: Initial support for PWM driver on RA8
Add PWM driver code support for RA8. This support is using
GPT HW

Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-10-11 09:28:29 +02:00
Lucas Dietrich 11abb5e4fc drivers: crypto: Fix pointer type warnings in STM32 AES driver
This patch resolves compiler warnings related to mismatched pointer types
between the STM32L4 and generic STM32 AES HAL by introducing CAST_VEC
macro.

Fix github CI warning

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich ad431dcc23 drivers: crypto: Add support for STM32L4 AES accelerator
This patch completes the addition of support for the STM32L4 AES
accelerator by introducing conditional handling for different STM32 AES
HAL variants. Key changes include:

- Created device tree bindings `st,stm32l4-aes` for STM32L4 AES
- Replaced `copy_reverse_words` with `copy_words_adjust_endianness`
to handle endianness conversion for different variants.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich 8f0de8455d drivers: crypto: Refactor encryption and decryption functions for STM32 AES
This patch introduces a unified function pointer approach to handle
encryption and decryption operations for the STM32 AES accelerator.

- Replace separate `do_encrypt` and `do_decrypt` functions with a generic
`do_aes` function, using function pointers to AES HAL functions.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Alexander Kozhinov fbeda5959d drivers: ethernet: eth_stm32_hal_priv.h
Remove unused missleading definition.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-10-11 09:28:05 +02:00
Alexander Kozhinov 0036b8bf21 drivers: ethernet: eth_stm32_hal
Drop preprocessor redefinitions

Some preprocessor defines were redefined to follow
stm32 hal naming conventions.
People seems to be confused by redefines and use
them with alternating names.
This PR does not change code behaviour,
but shall increase it's readability.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-10-11 09:28:05 +02:00
Laurentiu Mihalcea 202794273d drivers: intc: irqstr: add PM support
Add support for PM. The strategy is as follows:

	1) For level 1 interrupts: don't care, these don't
	require the PM domain of irqsteer to be turned on
	since they are, well, direct.

	2) For level 2 interrupts: use the reference count
	of the dispatchers.

Upon doing a get() on a dispatcher with its reference count
set to 0, before enabling the IRQ (meaning accessing the
reg. space) increment the reference count of the irqstr device
(which will result in the PM domain being enabled if 0).

Upon doin a put() on a dispatcher with its reference count
set to 1, after disabling the IRQ (meaning accessing the
reg. space) decrement the reference count of the irqstr device
(which will result in the PM domain being disabled if 0).

In summary, the PM domain of the device will be enabled if
at least one dispatcher is in use. On the other hand, the
PM domain of the device will be disabled if there's no
dispatchers in use (assuming there's no other dependencies).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea 4fba1d4642 drivers: power_domain: add driver for NXP's SCU-managed PDs
Add driver for NXP's SCU-managed power domains.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea e8d28bfdfd drivers: dai: sai: disable IRQs when not needed
IRQs are currently only enabled during the driver
initialization function (i.e: sai_init()). As such,
even though they're not needed (i.e: after a TRIGGER_STOP
operation) they remain enabled. Fix this by enabling IRQs
after during the TRIGGER_START operation and disabling them
during the TRIGGER_STOP operation.

This change is required by irq chips (i.e: irqsteer) which
perform PM operations during irq_enable()/irq_disable(). If
interrupts are left enabled all the time that means the irq
chip's PM resources might also remain enabled.

To make this change possible, the irq will have to be stored
inside the SAI's configuration structure.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea 48b98a9284 drivers: dma: dma_nxp_edma: disable IRQs when not needed
IRQs are currently only enabled during channel setup
and never disabled. As such, even though they're not
needed (i.e: after a channel has been suspended or stopped)
they remain enabled. Fix this by enabling IRQs during the
channel start() operation and disabling them during the
channel stop() operation.

This change is required by irq chips (i.e: irqsteer) which
perform PM operations during irq_enable()/irq_disable(). If
interrupts are left enabled all the time that means the irq
chip's PM resources might also remain enabled when not needed.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea c7be48aae4 drivers: intc: irqstr: manage dispatchers dynamically
Currently, all dispatcher interrupts are enabled during
the driver init() function, which will cause a bus fault
unless the PM domain associated with irqsteer is powered on.

Since PM will be done during irq_enable()/irq_disable(),
add support for dynamically enabling/disabling dispatchers.
This way, the reg. space of the dispatchers will be accessed
when the PM domain is powered on.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea d274cabf83 drivers: intc: irqstr: add reference count for IRQs
Currently, shared interrupts pose a big problem because
irq_disable() doesn't keep track of the number of clients
using that interrupt line. As such, add a reference count
mechanism which will stop the interrupt from being disabled
if there's still clients using it.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Phi Bang Nguyen 6acad9bd91 include: drivers: video: Remove unused video-controls header
Remove the unnecessary video-controls header included in video.h.
Drivers, applications should explicitly include it when needed.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-11 09:27:38 +02:00
Bjarki Arge Andreasen 2fbe105a47 drivers: comparator: add fake comparator
Add fake comparator driver and bindings for use with testing.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen b7648f89c4 drivers: comparator: add shell
Add shell for comparator device drivers.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen d37f844104 drivers: comparator: add mcux acmp device driver
Add mcux SDK based kinetis acmp device driver implementing the
comparator device driver API.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 4e55597527 drivers: sensor: mcux_acmp: update dts binding and adapt driver
Update the devicetree binding for the nxp,kinetis-acmp comparator and
move the binding to dts/bindings/comparator.

The update to the binding includes:
- Remove unused io-channel-cells property
- Remove unused sensor-device include
- Adding missing properties dac config, discrete mode config, and
  input configs.
- Rename properties to exclude redundant vendor prefix since props in
  this binding are not inhereted, and as such, don't need to be
  namespaced.
- Deprecate the old names of the renamed properties

The sensor based device driver has been updated to support both the
deprecated and new property names. This allows it to use both
nxp,enable-sample and filter-enable-sample for example.

Additionally, remove the unused io-channel-cells properties from
in-tree nodes of compatible = "nxp,kinetis-acmp"

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen e0363f252d sensor: mcux_acmp: namespace driver and kconfigs
The mcux_acmp will get support by the comparator subsystem. To avoid
namespace clashes, namespace the driver, kconfigs and use the
MCUX_ACMP config solely to select the MCUX SDK driver.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 04e70ab96c drivers: comparator: add nRF LPCOMP device driver
Add nRF LPCOMP device driver.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 4adc92475d drivers: comparator: Add nRF COMP device driver
Add nRF COMP device driver and remove deprecated bindings from
dts/bindings/sensor.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 211bdd935c drivers: comparator: Add initial files
Add top level CMakeLists.txt entry and Kconfig options along with
userspace handlers for comparator API.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bernardo Perez Priego 1cc93810d0 ec_host_cmd: Fix generating multiple Port80 notifications
Port80 notifications are continously generated as long as NOT_EMPTY
bit inside of Data Attributes register is set. This register was only
read once prior entering loop and its value was not checked on each
iteration.

This patch will include reading Data Attributes register on each
iteration, this way we can exit loop when no more data is available.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2024-10-10 20:24:06 -04:00
Raffael Rostagno 9a5cd08deb uart: esp32: Fixing garbage characters on mcuboot
Fixes garbage characters on mcuboot by adjusting UART baudrate
during boot phase according to clock source.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-10-10 20:22:54 -04:00
Ryan McClelland f2d549d55b drivers: i3c: cdns: fixup attachment and addr assignment for daa
The ENTDAA does not have a way to assign DA that are with a PID. It will
assign DAs that were in it's RRs in the order that they win arbitration.
Assign only available addresses in to it's RRs before ENTDAA.

Cleanup the attach api to no longer require a addr argument and remove
the helper function `i3c_determine_default_addr`. This now looks at if
it has a static address or if it already has a dynamic address (such as
from DEFTGTS) and will register the address if either exist with
precidence of dynamic addr over static addr.

This also fixes up the look up for if a device already has a dynamic
addr to find which pos of the RRs is it is in.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-10 20:22:01 -04:00
Michał Stasiak 2e6c83dd4c drivers: sensor: qdec: fix QDEC overflow handling
QDEC sensor driver fails to inform user of the overflow in the
ACC register, which makes the most recently fetched data invalid.
An error code return has been added to nrfx_qdec_sample_fetch(),
that indicates that an overflow has occured, based on oveflow flag.
Also, raw_acc field was added in the qdec_nrfx_data structure, to
adjust QDEC to sensor API rules - two subsequent sensor_channel_get()
calls should will yield the same values.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2024-10-10 15:01:20 -04:00
Fabrice DJIATSA 371d4adb06 drivers: mipi_dbi: update macro to get address
DT_REG_ADDR now generates an unsigned string terminated with U
which doesn't match the way the macros is used in a CONCAT
to build a FMC_BANK1_(1/2/3) define that is defined in hal.
`DT_REG_ADDR_RAW` should now be used to get the RAW FMC bank index

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-10-10 14:57:58 -04:00
Chaitanya Tata 80db01f3bf drivers: nrfwifi: Fix random MAC address setting
Random MAC address setting can never be configured as the two defaults
cover all cases. Fix the defaults, now the order is

* Fixed
* OTP (default, in case of no config)
* Random

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-10 14:57:27 -04:00
Trung Hieu Le fc90c9f824 drivers: video: ov5640: Add support for changing frame rate
Add support for changing frame rate

Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-10 10:08:09 +02:00
Farah Fliss 863b43be46 drivers: video: ov5640: Add some controls
Add some controls:
- hue
- saturation
- brightness
- contrast
- gain
- hflip
- vflip
- power line frequency filter
- pixel rate (read-only) which is needed for changing frame rate

Signed-off-by: Farah Fliss <farah.fliss@nxp.com>
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-10 10:08:09 +02:00
Phi Bang Nguyen c1980c2806 drivers: video: ov5640: Add support for test patterns
Add support for 4 test pattern modes:
- Color bar
- Color bar rolling
- Square
- Square rolling

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-10 10:08:09 +02:00
Phi Bang Nguyen 865032103b drivers: video: ov5640: Some minor fixes and optimizations
Add some minor fixes and optimizations:

- Fix coding style
- Rename some variables
- Use the array variable size directly instead of defining a macro

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
2024-10-10 10:08:09 +02:00
Phi Bang Nguyen ecd4c43026 drivers: video-controls: Rename colorbar to test pattern
Color bar is one type of test patterns. Rename it to
VIDEO_CID_CAMERA_TEST_PATTERN to be more generic.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-10 10:08:09 +02:00
Declan Snyder a6eb068e3c drivers: spi_mcux_lpspi: clang-format
Clang format the lpspi driver.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-10-10 10:07:55 +02:00
TOKITA Hiroshi 275162fd52 drivers: pwm: rpi_pico: Configuring the divide ratio adaptively
If the `divider-int-0` or variations of these for each channel properties
are not specified, or if these is 0,
the driver dynamically configures the division ratio by specified cycles.

The driver will operate at the specified division ratio if a non-zero
value is specified for `divider-int-0`.
This is unchanged from previous behavior.

Please specify ``divider-int-0`` explicitly to make the same behavior as
before.

In addition, the default device tree properties related to the division
ratio have been removed.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-10 10:07:47 +02:00
Naveen Gangadharan 175407c9cc drivers: i3c: cadence: fix HDR-DDR write failures due to M1 errors
Fix M1 errors seen with HDR-DDR writes, M1 errors we seen between CRC
and HDR exit sequence. The fix was to set Bit-8 of HDR-DDR CRC TXFIFO
word.

Signed-off-by: Naveen Gangadharan <naveeng1001@meta.com>
2024-10-10 10:07:00 +02:00
Jilay Pandya 9cf1269e0e shell: stepper: add further stepper signals to shell
This commit adds further signals to stepper shell
- STEPPER_SIGNAL_SENSORLESS_STALL_DETECTED
- STEPPER_SIGNAL_LEFT_END_STOP_DETECTED
- STEPPER_SIGNAL_RIGHT_END_STOP_DETECTED

Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
2024-10-09 18:24:08 +01:00
Jilay Pandya 52c6a289f1 drivers: stepper: adi: trinamic tmc5041
This commit introduces initial structure for trinamic drivers
TMC5041 is implemented with following features:
- StallGuard
- RAMPSTAT_POLL
- RAMP_GEN

Signed-off-by: Dipak Shetty <dipak.shetty@zeiss.com>
Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
2024-10-09 18:24:08 +01:00