Commit graph

16727 commits

Author SHA1 Message Date
Jonathan Rico ea04fd95f9 Bluetooth: ATT: remove BT_ATT_ENFORCE_FLOW
Enforcing the peer's behavior is not strictly necessary. All the host
should do is make sure it is resilient to a spec-violating peer.

Moreover, a growing number of platforms were disabling the check, as the
spec allows "batching" HCI num complete packets events, stalling ATT RX.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-06 17:53:54 +00:00
Armin Brauns b8856aed0d drivers: bluetooth: add more documentation for BT_HCI_SET_PUBLIC_ADDR
Hopefully this should now aid driver developers as well as application
developers.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-12-06 16:42:41 +02:00
Armin Brauns 281f27ec38 drivers: bluetooth: fix and clean up BlueNRG HCI setup() function
If no public address was set, it should just do nothing instead of
erroring. The function should also be static and there's no need to copy
the address struct.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-12-06 16:42:41 +02:00
Abderrahmane Jarmouni 3ce60d2d34 drivers: bluetooth: hci: ipm_stm32wb: naming fix
STM32CubeWB v1.18.0 replaces Master with Central & Slave with Peripheral
in the file app_conf.h (modified in the commit updating lib/stm32wb)

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2023-12-06 12:10:08 +00:00
Abderrahmane Jarmouni 7bf996d3a7 drivers: pwm: pwm_stm32: F1X changes
Use "const LL_TIM_IC_GetCaptureCHx" & "const LL_TIM_IsActiveFlag_CCx"
with STM32F1X series, following changes in stm32cube:stm32f1xx:drivers:
include:stm32f1xx_ll_tim.h

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2023-12-06 12:10:08 +00:00
Abderrahmane Jarmouni c3835e0cdf drivers: counter: ll_stm32_timer: F1X changes
Use "const LL_TIM_OC_GetCompareCH" & "const LL_TIM_IsEnabledIT_CCx" with
STM32F1X series, following changes in stm32cube:stm32f1xx:drivers:
include:stm32f1xx_ll_tim.h

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2023-12-06 12:10:08 +00:00
Fabio Baltieri c161253287 drivers: input: fix few types
Fix few wrong types in various input drivers.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-06 09:25:49 +00:00
Andrei Emeltchenko 686f7ef982 drivers: intc_ioapic: Fix get_vtd()
Function acpi_drhd_get() gets pointer to union acpi_dmar_id and set
its fields.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-06 09:17:08 +00:00
Fabio Baltieri 808c0f1f78 input: kbd_matrix: add actual-key-mask support
Add an optional actual-key-mask property to filter out key combinations
that are not implemented in the actual keyboard matrix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-06 09:16:45 +00:00
Emil Lindqvist 1cd7c55af9 modem: modem_cellular: add U-blox SARA-R5 as modem
U-blox SARA-R4 already exists but the behavior is different,
requiring a separate driver instance. For instance, R5 autostarts,
so this commit also adds support for skipping power on pulse.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2023-12-05 16:29:55 -06:00
Dawid Niedzwiecki 78af1c1e38 entropy: stm32: suspend when pool is full
Suspend the RNG module when the pool is full to save power. The
generated numbers aren't used anyway.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-12-05 16:27:53 -06:00
Andriy Gelman bf7d9838ab drivers: ethernet: phy_mii: Remove unnecessary bitwise operation
value is already uint16_t.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-12-05 16:23:43 -06:00
Andriy Gelman c6b5c61667 drivers: ethernet: phy_mii: Fix invalid phy_id check
When there'is no phy at the address both registers will return
0xFFFF, giving a phy address of UINT32_MAX, not 0x00FFFFFF.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-12-05 16:23:43 -06:00
Fabio Baltieri 9080007ef9 input: gpio_keys: drop the pin filter from the callback
The bit check field is redundant since the callback struct is masked to
a single pin already. Drop it, simplify the code a bit.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-05 16:22:10 -06:00
Fabio Baltieri f6917bca14 input: gpio_keys: interrupt configure cleanup
Use the same ret variable name as the rest of the file, drop a redundant
mask, use gpio_pin_interrupt_configure_dt.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-05 16:22:10 -06:00
Fabio Baltieri 07bf0f95fe input: gpio_keys: drop zephyr_code from the callback struct
It's not really used from here, guess it was a leftover.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-05 16:22:10 -06:00
Marc Lasch afa1bd842c drivers: wifi: esp32: Mute implicit function declaration warning
Mute the function declaration warning, the compiler was emitting when
compiling the esp32 Wi-Fi driver with IPv4 disabled. The
net_dhcpv4_start() function was visible during compile time, even when
IPv4 was disabled.

Signed-off-by: Marc Lasch <mlasch@mailbox.org>
2023-12-05 10:22:30 +00:00
Gerson Fernando Budke 3b0aaab64a drivers: eth: sam: Fix regression from 62833
The 62833 added a regression at SAM ethernet drivers which always fail
to initialize due to a wrong switch case implementation and without
review from maintainer. This add more information and fix the issue.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-12-05 10:22:13 +00:00
Mike Voytovich 3c2a896796 drivers: sensor: lsm6dsv16x: fix gyro range
The range and sensitivity tables don't match the datasheet
or the DTS binding file.  This changes the array lookup tables
to match the datasheet and binding file.

Signed-off-by: Mike Voytovich <mike@rokkresearch.com>
2023-12-04 13:16:38 -06:00
Fabio Baltieri 3862c227d4 input: gpio_kbd_matrix: add poll and scan mode support
Add a poll and scan mode for the driver. If any of these are set, the
driver does not use the GPIO interrupts to detect when the matrix has to
switch to polling mode. Instead, it keeps polling it all the time,
either by enabling all the columns and poll the rows for activity, or
just keep scanning all the time.

Poll mode is useful if the specific SoC used does not support GPIO
interrupt on all the row GPIOs at the same time, scan mode if it does
not even support selecting all the columns at the same time.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-04 16:40:35 +00:00
Fabio Baltieri 56d73a8b0c input: kbd_matrix: always poll if poll_timeout_ms is 0
Tweak the polling mode so that the driver never exit polling mode if
poll_timeout_ms is 0. This is useful if the specific driver does not
support idle mode.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-04 16:40:35 +00:00
Fabio Baltieri f4bf74e402 input: kbd_matrix: clear unstable state correctly on release
The state variable to tracking the unstable state of a key is currently
being cleared based on the bit value, which means that on release it's
not being cleared at all. Fix that by clearing using the bit mask
instead.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-04 16:40:24 +00:00
Fabio Baltieri 71e5c66ea4 input: kbd_matrix: fix a typing issue for a cycle counter
scan_clk_cycle is used to store values from k_cycle_get_32(), it very
much needs to be a uint32_t.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-04 16:40:24 +00:00
Fabio Baltieri 506ede0c59 input: kbd_matrix: fix a debouncing timing issue
Fix a debouncing timing unit mismatch when comparing us to ms.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-04 16:40:24 +00:00
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
Jakub Michalski 56bb73d7c7 console: fix '\r' and '\n' handling in uart_console_isr()
Receiving uart messages like: "\r*\n*\n" ('*' is a wildcard here) resulted
in invalid echo and invalid console_getline() output.
For example after receiving "\rabc\nd\n" uart_console_isr() echoes
"\r\nabcd\r\n" (note that "\r\n" before 'd' is missing) and after calling
console_getline() twice we received "" and "abcd".

uart_console_isr() changes single occurences of '\n' and '\r' to "\r\n" and
to avoid outputting "\r\n\r\n" after receiving "\r\n" it keeps track of the
last character. But it was tracking only the control characters not all
characters so in case of inputs like "\r*\n" the '\n' was omitted because
the last tracked character was '\r'.

Its fixed by tracking last character no matter of its type

Signed-off-by: Jakub Michalski <jmichalski@internships.antmicro.com>
Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-11-29 17:16:35 -05:00
Fabio Baltieri 76791cd708 input: kbd_matrix: add a input_kbd_matrix_drive_column_hook option
Add an option to call an application specific hook when setting the
column to scan. This makes it possible to handle application specific
quirks.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-29 18:18:09 +00:00
Adrian Bonislawski 53df6efeb6 watchdog: intel_adsp: fix num cpus
This will allow to init watchdog on HW's supporting different
number of cpus and watchdogs based on runtime arch_num_cpus

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-11-29 11:42:15 -05:00
Fabio Baltieri f9ab050306 drivers: gnss: move gnss_publish.h in include/
Move gnss_publish.h in include/ so that out of tree drivers and tests
can use it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-29 14:30:40 +00:00
Fabio Baltieri 96b9bd4720 drivers: gnss: use absolute values for signed fractionals
Printing fractionals currently put the sign on integer values on the
fractional part, for example:

longitude : -6.-207483333

Run an extra abs to get rid of the sign there for latitude, longitude
and altitude, compute the sign separately so it works for numbers
between -1 and 0 as well.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-29 14:30:40 +00:00
Adam Wojasinski e654cb65b8 drivers: watchdog: wdt_nrfx: Add support for new instances
Add support for WDT30, WDT31, and WDT130

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-29 13:12:42 +01:00
Marcin Szymczyk 2a38230a31 drivers: spi: nrfx: add dependency to PPI for PAN 58 on nRF52832
While enabling workaround for PAN 58 the PPI driver is used.
This requires the nrfx PPI driver to be enabled thus CONFIG_NRFX_PPI
Kconfig symbol needs to be set.

Jira: NRFX-1616

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2023-11-29 11:30:04 +01:00
Chaitanya Tata 0a1eff8d97 drivers: spim: Move the length check to beginning
This check has to be done independent of whether RAM is used for buffers
or not and depends on device maximum length property.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-11-29 11:30:04 +01:00
Chaitanya Tata 2c0f121727 drivers: spi: spi_nrfx_spim: Use generic macro for RAM address check
Instead of assuming only RAM is accessible by EasyDMA, use the generic
DMA accessible function.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-11-29 11:30:04 +01:00
Adam Wojasinski 058eebe479 drivers: spi: spi_nrfx_spim: Add additional symbol check for frequency
Some targets may not have `NRF_SPIM_HAS_32_MHZ_FREQ` or
`NRF_SPIM_HAS_16_MHZ_FREQ` symbols but have `NRF_SPIM_HAS_PRESCALER`
symbol defined. The symbol informs that target supports 32 MHz and
16 MHz frequencies for SPIM instances.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-29 11:30:04 +01:00
Adam Wojasinski e6bcc986bf drivers: spi: spi_nrfx_spim: Include nrf_clock.h only for nRF5340
The CLOCK HAL header is only needed for nRF5340 SoC. It's used when
user wants to configure SPIM instance to 32 Mbps. The HAL checks
if is running at 128 MHz as only then 32 Mbps is supported.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-29 11:30:04 +01:00
Andriy Gelman 447bdaa506 drivers: ethernet: eth_sam_gmac: Fix ptp adjust
NSEC_PER_SEC is an unsigned literal which will promote variable increment
to unsigned for the comparison operation, thus returning -EINVAL for
negative increment values.

For positive increment, -NSEC_PER_SEC becomes a large unsigned value
which will also return -EINVAL.

Fix by casting NSEC_PER_SEC to an int.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-11-29 09:53:47 +00:00
Armin Brauns 4321f86f1e drivers: allow setting BlueNRG public address
The zephyr bluetooth stack expects the controller to know its public
address, if any. At least for BlueNRG, the public address is forgotten with
every reset/power cycle, so there needs to be a way to set it from within
zephyr. This is accomplished using the `Aci_Hal_Write_Config_Data` HCI
command, as described in PM0237.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-11-29 10:44:25 +01:00
Armin Brauns 57b04c1eb0 drivers: refactor BlueNRG SPI driver for more config options
"LL only" is not the only config option of potential interest, e.g. the
public address is also important.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-11-29 10:44:25 +01:00
Armin Brauns 5b1b260f80 bluetooth: add HCI driver parameter to set controller's public address
This allows HCI drivers to expose vendor-specific functions to set the
public address.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-11-29 10:44:25 +01:00
Ryan McClelland 1e91453005 drivers: i3c: cdns: use deterministic timeout for idle
Previously, the idle bit would be read for X amount of times. This
could vary alot depend on the CPU speed. Timeout is now to happen
from the cycle time.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-11-29 10:29:30 +01:00
Marek Pieta 8d8e2b0f42 drivers: usb: nrf_usbd_common: Remove unneeded assertion
Code uses local RAM buffer to properly handle the case where provided
USB transfer TX data is not in RAM.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2023-11-29 10:22:25 +01:00
Wojciech Sipak 76c8bf0f7c drivers: interrupt_controller: intc_plic: rewrite get_plic_dev_from_irq
There's a ternary operator that depends on configuration-defined macro:
`CONFIG_DYNAMIC_INTERRUPTS` is not enabled by default
for any of the platforms that use PLIC,
it is possbile to set it to `=y` though.

This triggered the Coverity check to report it as dead code.

Fixes #65576.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-11-29 10:09:48 +01:00
Lukasz Majewski f4a039e218 drivers: net: lan865x: Add support for setting T1S PLCA configuration
This commit provides support for changing PLCA parameters stored in
lan865x_config_plca structure.

After values are updated, the LAN865x needs to be reset and then
configured with new values.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-11-29 10:06:30 +01:00
Lukasz Majewski dd5027067a drivers: net: lan865x: Disable protected transmission mode before reset
The LAN865x device after HW reset supports only the non-protected control
transmission mode. When it is reset alone - without resetting already
configured HOST system - one must assure that in HOST's OA TC6 driver
the protection SPI transmission support is disabled.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-11-29 10:06:30 +01:00
Lukasz Majewski 5cdf2f0eb7 drivers: net: lan865x: Move reset setup code to dedicated function
The ctx->reset member of struct lan865x_data shall be cleared each time
one wants to reset the LAN8651 device.

Before this change this value was only initialized in the lan865x_init().

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-11-29 10:06:30 +01:00
Lukasz Majewski 9d8100f43f drivers: net: lan865x: Move PLCA configuration to dedicated structure
This change allows modification of the PLCA configuration in the lan865x
driver.

Values in this structure can be set via device tree as well as modified
by the user program.

Without this change the latter use case would not be possible as the
struct lan865x_config structure is defined as read only and its data
is only provided by device tree.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-11-29 10:06:30 +01:00
Declan Snyder fa73697735 drivers: eth_nxp_enet: Support PTP
Support PTP functionality in NXP ENET MAC driver

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-28 14:34:02 -06:00
Declan Snyder d85171fe6f drivers: ptp_clock: Add NXP ENET PTP Clock Driver
Add Driver for NXP ENET PTP Clock device

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-28 14:34:02 -06:00
Declan Snyder cc5bd51177 drivers: ptp_clock: Add init priority Kconfig
Add ptp clock driver init priority kconfig

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-28 14:34:02 -06:00
Declan Snyder 809e936c5e drivers: clock_control_mcux_ccm: Add ENET PLL clk
Add subsys value for ENET PLL / ENET Ref clk to CCM Driver

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-28 14:34:02 -06:00