Commit graph

24538 commits

Author SHA1 Message Date
Gerard Marull-Paretas
d5041aecec drivers: clock_control: nrf54h-common: add utility to obtain LFOSC acc
Add a utility function to obtain LFOSC accuracy in PPM from BICR.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
5415c42dd4 drivers: clock_control: nrf54h-hfxo: use values from BICR
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Qingling Wu
dbc6a50698 drivers: wifi: nxp: add set RTS threshold command support
Add set RTS threshold command support for sta and sap in nxp driver.

Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
2024-12-18 10:17:24 +01:00
Benjamin Bigler
f1087d2042 drivers: adc: tla202x: add support for tla2022 and tla2024
This extends the tla2021 driver to support tla2022 and tla2024

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2024-12-18 08:33:49 +01:00
Benjamin Bigler
7609ceadc4 drivers: adc: tla2021: rename everything from tla2021 to tla202x
Rename everything from tla2021 to tla202x (except dtcompatible)
in preparation to add support for tla2022 and tla2024

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2024-12-18 08:33:49 +01:00
Benjamin Bigler
25c210e8eb drivers: adc: tla2021: sleep until sampling is done
Sleep until sampling is done instead of polling. This avoids
blocking of other threads.

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2024-12-18 08:33:49 +01:00
Nathan Olff
42e7095d1e drivers: adc: adc_emul: implement raw func set function in adc_emul
allow setting a function as generator of raw adc values in adc_emul

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2024-12-18 08:33:26 +01:00
Nathan Olff
d793b86a82 drivers: adc: adc_emul: write function to set const raw value
implement storage and retrieval of raw value in adc_emul

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2024-12-18 08:33:26 +01:00
Xavier Ruppen
06b7dc81a5 drivers: ethernet: enc28j60: disable/enable interrupts to avoid races
Currently, there is a small race window where we can miss an interrupt.
Right after we're done reading the RX buffer but just before decrementing
the RX counter to zero, the ENC28J60 may receive a packet. The chip will
raise an interrupt, but the line is still asserted. That means that the
callback will not be invoked since it is edge-triggered.

To avoid that, disable interrupts on the chip itself before processing
the RX buffer.

In fact, the ENC28J60 datasheet specifically says:

	"After an interrupt occurs, the host controller should
	clear the global enable bit for the interrupt pin before
	servicing the interrupt. Clearing the enable bit will
	cause the interrupt pin to return to the non-asserted
	state (high). Doing so will prevent the host controller
	from missing a falling edge should another interrupt
	occur while the immediate interrupt is being serviced.
	After the interrupt has been serviced, the global enable
	bit may be restored. If an interrupt event occurred while
	the previous interrupt was being processed, the act of
	resetting the global enable bit will cause a new falling
	edge on the interrupt pin to occur."

This is also what is being done in the Linux driver [1].

[1] https://elixir.bootlin.com/linux/v6.11.2/source/drivers/net/ethernet/microchip/enc28j60.c#L1126

Signed-off-by: Xavier Ruppen <xruppen@gmail.com>
2024-12-18 08:32:49 +01:00
Xavier Ruppen
7d95cc4ce3 drivers: ethernet: eth_enc28j60: do not check PKTIF on interrupt
The enc28j60 errata sheet says:

	"The Receive Packet Pending Interrupt Flag
	(EIR.PKTIF) does not reliably/accurately report
	the status of pending packets."

	"In the Interrupt Service Routine, if it is unknown if
	a packet is pending and the source of the interrupt
	is unknown, switch to Bank 1 and check the value
	in EPKTCNT.
	If polling to see if a packet is pending, check the
	value in EPKTCNT."

A workaround has already been implemented inside of eth_enc28j60_rx().
But checking PKTIF before calling eth_enc28j60_rx() completely defeats
the purpose of the workaround. Do not check it.

Moreover, clearing ENC28J60_BIT_EIR_PKTIF is useless since it is
automatically cleared once all packets are read. So remove that check
and clarify comment.

Also please refer to the Linux driver [1].

[1] https://elixir.bootlin.com/linux/v6.11.2/source/drivers/net/ethernet/microchip/enc28j60.c#L1090

Signed-off-by: Xavier Ruppen <xruppen@gmail.com>
2024-12-18 08:32:49 +01:00
Robin-Charles Guihéneuf
3a2ac9aa64 drivers: i2c: Fix SMBus build with stm32f4 family chip
The build condition was only dealing with the new line of SoC.

Signed-off-by: Robin-Charles Guihéneuf <robin-charles@hotmail.fr>
2024-12-18 08:32:32 +01:00
Mikhail Siomin
36bbd67653 drivers: gpio_pca95xx: add pins initialization to default state
After a non-power reset (wdt) pins may remain in non-default state.
To ensure that a system initialization is the same after any reset,
it is necessary to initialize pins to the default state.

Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
2024-12-18 08:32:15 +01:00
Jiafei Pan
55f0b87143 drivers: gpio: mcux_igpio: add MMIO mapping support
Map MMIO memory by using DEVICE_MMIO_NAMED_x() APIs.

And some platforms has no soc.h, so use __has_include to check it
firstly.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-12-18 08:31:52 +01:00
Jordan Yates
06c29b1b61 i2c: nrfx_twim: mark as PM_DEVICE_ISR_SAFE
Mark the I2C instances as `PM_DEVICE_ISR_SAFE`, as the transition
operations are short, it saves RAM resources, and the spin-locking fixes
the non-atomic behaviour of the PM usage counter.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-12-18 08:31:30 +01:00
Wei-Tai Lee
913fddb80e drivers: cache: andes: Decouple cache line size calculation
Eliminate the dependency on specific configuration options
for calculating the cache line size.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2024-12-18 03:04:57 +01:00
Wei-Tai Lee
c351a0e044 drivers: cache: andes: Fix incorrect DT_PROP usage
Remove redundant quotation marks when parsing
cache line size from DTS properties.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2024-12-18 03:04:57 +01:00
Wei-Tai Lee
b3d3c0f702 driver: cache: andes: Support enable/disable on CPUs lacking CCTL CSRs
For CPUs without CCTL CSRs, return ENOTSUP in cache operations.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2024-12-18 03:04:57 +01:00
Wei-Tai Lee
5cf6137b38 drivers: cache: andes: Dynamically calculate L2 cache parameters
Enhance the driver to calculate the L2 cache line size and number
of ways at runtime. The L2 cache line size is assumed to match
the L1 cache line size, while the number of ways is determined
based on the total L2 cache size.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2024-12-18 03:04:57 +01:00
Stoyan Bogdanov
92aeb787c7 drivers: gpio: max22190: Add MAX22190 octal input with diagnostics
Add max22190 gpio driver with input functionality, since device
support only input without output.

Implemented diagnostic functionality for all 8 channels
which include various check to over/under voltage and wire break.
Filtering configuration is done from devicetree on per channel
bases and is configured on chip start.

In case some fault condition occure FAULT pin drive LOW which
prop to FAULT registers to be read. Data is stored in data structure
for furter analizes and ERR message is printed in console.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2024-12-18 03:04:46 +01:00
Aurelie Fontaine
8a0469dc4f drivers: sensor: icm42670: supports icm42670-P/-S
Prepare to use official TDK Invensense Inc. driver for icm42670-P/-S
sensor in tdk_hal module. Simplify I2C and SPI transport files.
Driver code moves in hal_tdk module.
Adds APEX features, such as Pedometer, Tilt detection, Wake on Motion
and Significant Motion Detector.

Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
2024-12-18 03:04:31 +01:00
Lucien Zhao
c0b21f4a30 drivers: sensor: nxp: add code judge whether read back correctly
find a sensor driver bug don't judge the data whether read back
correctly, deal with buffer data directly.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-12-18 01:01:37 +01:00
Lucien Zhao
a831f7df6d drivers: clock_control: add i3c clock for clock_control_mcux_ccm_rev2.c
add i3c case to get i3c instance clock

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-12-18 01:01:37 +01:00
Immo Birnbaum
63b65299df drivers: ethernet: xlnx_gem: enable querying of HW checksum support
Add a get_config function for this driver as specified in the
Ethernet subsystem API. The implementation supports querying
the hardware checksum generation capabilities of the specified
GEM device instance. This prevents the transmission of packages
without a valid checksum for protocols such as ICMP, as the
hardware only supports IPv4/IPv6 TCP and UDP checksum generation.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2024-12-18 01:01:22 +01:00
Piotr Pryga
233095c3f4 drivers: clock_control: nrf: hfxo: Remove redundad code
There were redundant code in full_irq_lock(), full_irq_unlock()
functions that supposed to be used when ZLI IRQs are disabled.
These functions are compiled in only when CONFIG_ZERO_LATENCY_IRQS
is set, hence the non-ZLI execution path was never included
in final binaries.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-12-18 01:00:56 +01:00
Mario Paja
9dde4b97c0 drivers: ethernet: lan9250: implement set_config
Implements set_config api to set mac address

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2024-12-18 01:00:00 +01:00
Teresa Zepeda Ventura
830fe6ec19 drivers: pwm: add a SAM0 TC based PWM driver
This runs the Timer/counter in 'normal' PWM mode (for 8-bits)
and in 'match' PWM mode (for 16-bits).

Signed-off-by: Teresa Zepeda Ventura <teresa.zvent@gmail.com>
2024-12-17 23:14:32 +01:00
Raffael Rostagno
b313344e22 drivers: mcpwm: esp32: Clock update for new devices
Update clock configuration to support newer devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-12-17 23:14:19 +01:00
Raffael Rostagno
15cb7d3d74 drivers: mcpwm: esp32: Driver update for new HAL
Remove deprecated functions to comply with new HAL versions.
Handle capture interrupts more appropriately by clearing status
bit for only one channel.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-12-17 23:14:19 +01:00
Derek Snell
b3d8766126 drivers: dma: dma_mcux_edma: fix previous TCD index
fixes issue calculating index of previous TCD in circular list.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-12-17 20:54:58 +01:00
Rafał Kuźnia
6f6402418a drivers: serial: nrfx_uarte: Fix bool endtx-stoptx prop check
The dt_nodelabel_bool_prop must be used to check for a boolean property,
not the dt_nodelabel_has_prop. Using the latter caused the
UART_X_ENHANCED_POLL_OUT condition to be not fulfilled, despite the
fact that the property was not set on nRF52840 and nRF91.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-12-17 17:52:26 +01:00
Raffael Rostagno
0d5c76a2b3 drivers: counter: esp32: Spinlocks cleanup
Remove unnecessary spinlock directives.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-12-17 15:23:38 +01:00
Raffael Rostagno
203c71d1f7 drivers: counter: esp32: Driver update
Cleanup and timer frequency management improvement to support
new devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-12-17 15:23:38 +01:00
Bjarki Arge Andreasen
7487eabd33 drivers: serial: nrfx_uarte: rm NRF_GPD_FAST_ACTIVE1 build assert
The assert BUILD_ASSERT(NRF_GPD_FAST_ACTIVE1 == 0); is not correct
given that NRF_GPD_FAST_ACTIVE1 is defined as 1U, and is not used
in the file anyway. Remove the build assert.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-17 15:22:37 +01:00
Bjarki Arge Andreasen
ef8bf34e61 drivers: clock_control: nrf2: add support for global hfsll clock
Add device driver support for global hsfll clock.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-17 15:22:37 +01:00
Bjarki Arge Andreasen
777adf4231 dts: bindings: update nrf-hsfll to nrf-hsfll-local
The nrf-hsfll was previously the only supported HSFLL clock, hence it
was not namespaced fully. Since we added nrf-hsfll-global, we should
add the namespace to nrf-hsfll as well.

Updates drivers and devicetree uses of HSFLL as well.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-17 15:22:37 +01:00
Petri Pitkanen
07094783e7 silabs: drivers: bluetooth: Conditional compiling of optional components
Conditionally compile in controller features based on what features
have been enabled in Kconfig

This commit allow saving in flash size. Over 10k in peripheral_hr
and central_hr. In observer and broadcaster about 20k

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2024-12-17 11:38:31 +00:00
Johann Fischer
704b36f78f usb: device_next: remove redundant memset() after net_buf_alloc.*()
With changes introduced in commit 6a3602a306
("net: buf: Clear `user_data` on allocation")
our memset() calls are redundant.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-12-17 11:38:22 +00:00
Francois Ramu
424c187e2a drivers: flash: stm32wba flash driver moves sem functions
When the CONFIG_BT_STM32WBA the stm32wba_fm flash driver is compiled
and must takes flash_stm32_sem_take/give functions from the
flash_stm32.h header file, like other stm32 series.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-17 11:37:14 +00:00
Fabio Baltieri
5b92e7af0e drivers: flash: stm32: add STM32 option bytes extended ops
Add two new flash extended operations for reading and writing STM32
option bytes from the application code.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-12-17 11:35:13 +00:00
Maochen Wang
07328d962b drivers: wifi: nxp: Enable WIFI_NM for WIFI_NXP
Default enable WIFI_NM for both supplicant and embedded supplicant
case, to distinguish STA and SAP interface when use L2 layer.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-12-17 09:48:29 +01:00
Hao Luo
63904f3a19 drivers: rtc: add rtc support for apollo3&3p
Add RTC support for Apollo3 and Apollo3 Plus Soc

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-12-17 05:48:58 +01:00
Jilay Pandya
e01107ebb2 drivers: haptics: drv2605 fix unchecked return value
return -EIO if i2c_read does not work as expected.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-17 03:39:06 +01:00
Pieter De Gendt
a0eb112774 drivers: Move device driver APIs into iterable sections
These device driver APIs were merged after the DEVICE_API macro was
introduced.
Cleanup these leftover drivers.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-17 02:02:54 +01:00
Girisha Dengi
36e71c839f drivers: clock_control: Agilex5 clock control driver updates
The clock controller/manager registers are updated with
the correct divider values by bootloader via hand-off
data, so now we can use the clock controller to get the
clock value of each peripheral during the run time.

Signed-off-by: Girisha Dengi <girisha.dengi@intel.com>
2024-12-16 17:12:34 -05:00
Ryan McClelland
f888e781ba drivers: i3c: stm32: add api call for default handler
add api calls for the default handlers for i3c rtio

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-12-16 20:54:42 +01:00
Ryan McClelland
622732e854 drivers: i3c: npcx: add api call for default handler
add api calls for the default handlers for i3c rtio

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-12-16 20:54:42 +01:00
Ryan McClelland
b7492cb671 drivers: i3c: mcux: add api call for default handler
add api calls for the default handlers for i2c and i3c rtio

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-12-16 20:54:42 +01:00
Ryan McClelland
ee0abb15b0 drivers: i3c: cdns: add api call for default handler
add api calls for the default handlers for i2c and i3c rtio

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-12-16 20:54:42 +01:00
Ryan McClelland
0e5916f8e4 drivers: i3c: add i3c-rtio
This adds rtio along with a default handler for i3c

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-12-16 20:54:42 +01:00
Michal Morsisko
c4923b6be0 drivers: spi_bitbang: Make SPI_LINES_OCTAL explicitly unsupported flag
Prevent the driver from perfroming transfer when SPI_LINES_OCTAL flag
is specified, as this driver supports only SPI_LINES_DUAL for now.

Signed-off-by: Michal Morsisko <morsisko@gmail.com>
2024-12-16 20:52:44 +01:00