Commit graph

23353 commits

Author SHA1 Message Date
Laurentiu Mihalcea
fd8ac9e6cd drivers: interrupt_controller: Add driver for NXP's IRQ_STEER IP
This commit introduces a new interrupt controller driver used
for NXP's IRQ_STEER IP.

Apart from introducing the driver itself, this commit contains
the following changes:
	1) Switch i.MX8MP to using the XTENSA core interrupt
	controller instead of the dummy irqsteer one.
		* this is required because the binding for the
		irqsteer driver is no longer a dummy one
		(since it's being used by the irqsteer driver).
		As such, to avoid having problems, switch to
		using another dummy binding.
	2) Modify the irqsteer dummy binding such that it
	serves the IRQ_STEER driver's needs.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-12-04 09:52:38 -06:00
Ryan McClelland
07557e3c62 drivers: i3c: mcux: write back total number of bytes transferred
Write back the total number of bytes actually transferred.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-12-04 16:48:20 +01:00
Ryan McClelland
1e663dbedc drivers: i3c: cdns: write back total number of bytes transferred
The command response buffer will return the total number of bytes
transfered. This will write back to the pointer which is to contain
the number of bytes sent or received.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-12-04 16:48:20 +01:00
Benjamin Björnsson
8c0b3ca2fd sensor: adltc2990: add missing return value checks
This commit adds two missing return value checks for
i2c reads.

Fixes #65328

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-12-04 14:34:42 +01:00
Benjamin Björnsson
773257dda4 sensor: adltc2990: separate function return values
This commit reworks the adltc2990_fetch_property_value function
to pass its result through a variable pointer instead of direct return.
This is done in part to separate the errno value being return in the
default case of the switch from the result of the function, but also
to make it easier the fix a Coverity issue regarding the unhandled
return values of i2c reads.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-12-04 14:34:42 +01:00
Benjamin Björnsson
ef871058aa sensor: tsl2540: add missing return value check
This commit adds missing return value checks in driver initialization.

Fixes #65345

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-12-04 14:34:42 +01:00
Benjamin Björnsson
445b43d407 sensor: tsl2540: add missing return value check
This commit adds a missing return value check. Since the I2C write
failed we release the semaphore and returning immediatly instead of
using goto exit.

Fixes #65352

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-12-04 14:34:42 +01:00
Benjamin Björnsson
dc257830a5 sensor: adltc29990: add missing return value check
This commit adds a missing return value check for a register read.
The affected function was updated to use the regular errno return value
and to pass the result through a pointer instead.

Fixes #65346

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-12-04 14:34:42 +01:00
Benjamin Björnsson
0cec0dc749 sensor: max17055: add missing return value check
This commit adds a missing return value check during register read.
Added an imidiate return to remove the seemingly unwanted side
effect of also waiting for the bus read to work.

Fixes #65374

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-12-04 14:34:42 +01:00
Benjamin Björnsson
9781d13f19 sensor: max17055: add missing return value check
This commit adds a missing return value check during register read.
Added an imidiate return to remove the seemingly unwanted side
effect of also waiting for the bus read to work.

Fixes #65383

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-12-04 14:34:42 +01:00
Declan Snyder
213471f2ad drivers: nxp_enet: simplify driver header
Simplify the driver header implementation, so that there are not
structs and unions different per each situtaion, and make just one
function for the enet module drivers to call on each other. Also,
capitalize existing enums.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-12-04 14:29:15 +01:00
Mahesh Mahadevan
e0fd9f6cde drivers: dma_mcux_lpc: Call callback only when provided
Add a check to ensure the dma_callback is provided before
calling the callback function.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-12-04 14:19:27 +01:00
Michele Sardo
0f44d62740 drivers: bluetooth: hci: handle event with high priority flag
Make sure that events flagged as high priority are handled when
CONFIG_BT_RECV_BLOCKING is not defined.

Fix for #65892.

Signed-off-by: Michele Sardo <msmttchr@gmail.com>
2023-12-04 14:18:20 +01:00
Christopher Friedt
86fc43c939 drivers: dma: add emulated dma driver
Add an emulated DMA driver. Emulation drivers are great to have
for each driver API for multiple reasons:

- providing an ideal / model driver for reference
- potential for configurable backend support
- seamless integration with device tree
- multi-instance, etc, for all supported boards
- fast regression testing of app and library code

Since many other drivers and lbraries depend on DMA, this might
help us to increase test coverage.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-12-03 19:22:31 -05:00
Jonas Remmert
7a2fcc419e drivers/sensor: add support to LPS28DFW pressure sensor
The LPS28DFW is an ultracompact, piezoresistive, absolute pressure sensor.
Compared to the LPS22DF, the LPS28DFW is waterproof and has a Dual FS
capability and does not have SPI. This commit extends the LPS22DF driver to
be compatible with the LPS28DFW device.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
2023-12-01 12:19:05 -06:00
Peter Ujfalusi
6b548ee5ae drivers: dai: intel: ssp: Manage the DMA request enable/disable dynamically
Do not keep both DMA request enabled whenever the SSP is in use. Manage
the SSCR1_TSRE and SSCR1_RSRE bits in sync with the enabled directions.

When only playback is used there is no need to have the RX DMA request
enabled for example.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-12-01 16:25:55 +01:00
Peter Ujfalusi
aa18bb2b6e drivers: dai: intel: ssp: Revise receive FIFO draining
The receive FIFO needs to be drained in a different way depending when it
is done.
- before start
If the RX FIFO is in overflow state then we must read all the entries out
to empty it (it was after all full).

- before stop
The DMA might be already running to read out data. Check the FIFO level
change in one sample time which gives us the needed information to decide
to wait for another loop for the DMA burst to finish, wait for the DMA to
start it's burst (DMA request was asserted) or drain the FIFO directly.

No need to drain the RX fifo at probe time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-12-01 16:25:55 +01:00
Peter Ujfalusi
eb49756d86 drivers: dai: intel: ssp: Correct FIFO depth value
The actual FIFO depth is 32 and not 16 on CAV2.5 and AVS platforms.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-12-01 16:25:55 +01:00
Peter Ujfalusi
034a3e3f91 drivers: dai: intel: ssp: Ignore TX/RX or DMA request enable bits from blob
When loading the SSP configuration from a blob ignore the bits which would
enable the TX/RX or DMA requests at configuration phase.

The TX/RX enable and DMA request is handled by the driver itself. If the
blob wrongly enables any of the bits can have runtime (startup time)
seemingly random issues.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-12-01 16:25:55 +01:00
Aaron Ye
1268251faf drivers: gpio: ambiq: Fix the incorrect IRQ disablement.
For the Ambiq Apollo4x soc, every 32 pins share the same IRQ
number. irq_disable() should not be called for the pin interrupt
disablement, otherwise the interrupt of pins in the same GPIO
group will be disabled as well.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2023-12-01 16:25:47 +01:00
Aaron Ye
70ce5e4c6b dts: arm: ambiq: Update the GPIO instances
Use the "ambiq,gpio" binding to combine the "ambiq,gpio-bank"
child nodes for Apollo4 Plus soc.
Also update the GPIO driver accordingly.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2023-12-01 16:25:47 +01:00
Mateusz Sierszulski
fb016b6843 drivers: gpio: add Ambiq GPIO driver
This commit adds GPIO driver for Apollo4 SoCs.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-12-01 16:25:47 +01:00
Wojciech Slenska
fdc1cbf833 drivers: sensor: bmi323 interrupt fix
Interupts should be enabled after int line configuration in bmi.
When the device goes to a suspended state interrupts must be disabled.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2023-12-01 08:39:53 -06:00
Guillaume Gautier
20fd6a10e1 drivers: adc: stm32: prevent pm while measurement in progress
Prevent PM while ADC measurement in progress.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-12-01 14:31:05 +01:00
Tim Lin
08e42b147e ITE: drivers/gpio: Correct the wake up control input
The wake-up control input is IT8XXX2_IRQ_WU66.

Testing the wake-up functionality on GPF6 is normal.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-12-01 12:41:22 +01:00
Declan Snyder
fa69f472aa drivers: mdio_nxp_enet: fix ampersands typo
Fix code typo with &&->& and redundant operation

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-12-01 11:02:37 +00:00
Lukasz Majewski
8001ca7de4 drivers: net: tc6: cosmetic: Remove extra space at oa_tc6_send_chunks
Cleanup the extra space.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-01 10:54:27 +00:00
Lukasz Majewski
d3c0537ade drivers: net: lan865x: Select NET_L2_ETHERNET_MGMT when LAN865x used
The NET_L2_ETHERNET_MGMT configuration option is required to allow
setting MAC address or PLCA parameters with the LAN865x driver.

To avoid mistakes with per-board configuration files - it has been moved
to Kconfig and automatically selected when the driver support is enabled.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-01 10:54:27 +00:00
Lukasz Majewski
32e64cb8c5 drivers: net: tc6: Handle lost of device synchronization (SYNC == 0)
Handle the situation when OA TC6 compliant device signals to the host
that its configuration is lost - i.e. the SYNC bit in the footer is
cleared.

In this (unlikely happen) situation the device is reset and reconfigured.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-01 10:54:27 +00:00
Lukasz Majewski
384ba59c5b drivers: net: tc6: Change LOG_ERR to LOG_DBG when received data not valid
As part of IRQ service routine, there is at least one data transmission
performed between OA TC6 compliant device and HOST uC.

As this transmission can happen when there is no valid data to be read
(and its only purpose is to deassert the interrupt) the DV bit in footer
may be cleared. As this situation is expected with this approach - the
LOG level can be safely lowered from error to debug.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-01 10:54:27 +00:00
Lukasz Majewski
953c5f2d32 drivers: net: lan865x: Always read at least one chunk on IRQ received
According to the OPEN Alliance 10Base-T1x standard (point 7.7), it is
mandatory to read at least single data chunk (no matter if received data
is valid or not) to deassert the interrupt in the LAN865x (then the tc6
structure fields are also updated from the footer).

Current approach with reading OA_BUFSTS register was providing the
required information (RCA and TXC), but could cause transmission "stalls"
as this operation (i.e. control, not data transmission) is not causing
deassertion of the interrupt IRQ_N line from OA TC6 compliant device.

With this patch - the transmission is always performed at least once, so
interrupt is always deasserted.

As the functionality of oa_tc6_update_buf_info() - i.e reading value of
RCA and TXC - has been replaced with extracting data from footer, this
function can be safely removed.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-01 10:54:27 +00:00
Erwan Gouriou
d2ea9e4806 drivers: serial: stm32wba: Suspension required before stop in DMA Tx abort
In a previous change, STM32U5 GPDMA specific behavior was set into a
specific configuration applying only to few devices impacted by a specific
silicon erratum.
As part of this change, dma suspension before dma stop was set to apply
to the specific erratum workaround.
It appears, this was wrong and dma suspension before dma stop should
be done on all devices compatible with stm32u5 dma. This fix re-instantiate
the correct behavior.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-01 10:52:49 +00:00
Erwan Gouriou
ad1594ee75 drivers: serial: stm32: Small code refactoring
Wakeup-source configuration is about configuring registers.
It belongs to uart_stm32_registers_configure().

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-01 10:52:49 +00:00
Erwan Gouriou
0c541d7ad0 drivers: uart: stm32: Allow enabling FIFO mode
Add required bits to allow FIFO mode enabling.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-01 10:52:49 +00:00
HaiLong Yang
ba476c4b8a drivers: flash: update gd32 fmc v2
This fix some incorrect implement in gd32 flash v2 driver, also add
support to gd32a503 series.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2023-12-01 10:51:52 +00:00
Emil Lindqvist
79c2fafe6a modem: modem_cellular: add PAP authentication support
Some modems or networks require PAP authentication for successful
LCP handshake. Tested on U-blox SARA-R5 with zephyr,gsm-ppp.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2023-12-01 10:51:24 +00:00
Benedikt Schmidt
08bf74a825 drivers: adc: cleanup whitespaces in ADS114s0x
Cleanup the whitespaces with clang-format in the driver of the ADS114s0x.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-12-01 10:51:05 +00:00
Benedikt Schmidt
640b6911d6 drivers: adc: improve logging of ADS114s0x
Improve the logging of the ADC driver ADS114s0x.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-12-01 10:51:05 +00:00
Ryan McClelland
48e514f662 drivers: i3c: rename dcr i2c mode macro to lvr
This renames the I2C 'DCR' mode to 'LVR' as that is the variable it
should be looking at and not the dcr value. This also fixes the get
'lvr' mode argument.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-12-01 10:48:31 +00:00
Parthiban Nallathambi
e9e430c40d can: mcp251xfd: fix compilation
Either switching to CAN_DEVICE_DT_INST_DEFINE with [1] missed
updating mcp251xfd or missed in merge. Fix using function
pointer for init in mcp251xfd.

[1]: https://github.com/zephyrproject-rtos/zephyr/pull/62925

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2023-12-01 10:48:23 +01:00
Francois Ramu
de1bfd6a6e drivers: adc: stm32 adc fixing calibration for the stm32F1 serie
Configure the sw trigger just after calibration
So the conversion can start on regular channel on the
software control bit.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-11-30 12:22:46 +01:00
Dawid Niedzwiecki
75f7ffb2c9 Revert "timer: cortex_m_systick: handle cycle count overflow with idle timer"
This reverts commit 2ae09993ca.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-11-30 10:05:22 +01:00
Dawid Niedzwiecki
7388970c85 serial: stm32: do not clear TC flag in async mode
The Transfer Complete flag (TC) is used to check if a transfer is
complete. This mechanism is used before suspending the UART module to
make sure that all data are sent before the suspend procedure.

The UART ISR clears this flag after completion of a async transfer which
causes a hang during UART device suspend setup.

There is just no need to clear this flag in ISR, it is cleared every
time we start a new async transfer.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-11-30 10:04:57 +01:00
Yong Cong Sin
e6f77f9b73 driver: intc: plic: fix trigger type register bit calculation
The bit position calculation for the trigger type is wrong,
fix that.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-30 10:04:43 +01:00
Bartosz Bilas
55f2d72cd4 drivers: eth_esp32: allow selecting ref clk source
In case of boards where REF_CLK signal is not connected
to the GPIO0 by default add the possibility to use
the optional GPIO16/GPIO17 as a REF CLK source.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2023-11-30 10:02:31 +01:00
Daniel Gaston Ochoa
50f64eaeba drivers: spi: stm32h7: Use FIFO
Use H7 SPI FIFO to improve performance.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-11-30 10:01:19 +01:00
Daniel Gaston Ochoa
cb4f54535f drivers: spi: stm32h7: Simplify long function in small ones
Simplify and clarify spi_stm32_shift_m by splitting it in
3 smaller functions with clear names.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-11-30 10:01:19 +01:00
Daniel Gaston Ochoa
02f46fb1f2 drivers: spi: stm32h7: Use a better name for ll_func_tx_is_empty
In H7, TXP indicates when its FIFO has room for, at least, one
packet. Thus, rename ll_func_tx_is_empty as ll_func_tx_is_not_full,
to be consistent in all platforms.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-11-30 10:01:19 +01:00
Daniel Gaston Ochoa
2effd8cce7 drivers: spi: stm32h7: Move startMasterTransfer to transceive
Avoind calling startMasterTransfer multiple times in a
transaction by moving it to the transceive() function.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-11-30 10:01:19 +01:00
Marc Desvaux
1204aa25c8 drivers: usb: device: fix Rx FIFO min size
the FIFO Rx need to have a Minimum memory to works
distributed the rest of the ram_size memory between
the different TX FIFOs except the first which is
a control endtype with max data payload of 64 bytes

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-11-30 10:01:11 +01:00