Commit graph

17412 commits

Author SHA1 Message Date
Gustavo Silva 3850f4ca64 drivers: sensor: add ScioSense ENS160 driver
Add driver for ScioSense ENS160 multi-gas sensor. The driver includes
support for I2C and SPI, attributes for setting temperature and
humidity compensation and data ready trigger.
Also add ScioSense to the list of vendor prefixes.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
2024-02-25 22:27:22 -05:00
Mahesh Mahadevan 94540a9dee drivers: gpio: Update NXP LPC GPIO driver to enable wakeup
Process the GPIO_INT_WAKEUP flag and set appropraite bits
in the SoC to wakeup the system from deep sleep mode.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-02-25 22:26:00 -05:00
Mahesh Mahadevan e17045a02d drivers: gpio: Add default for switch statement
This causes a warning when making changes to add
support for GPIO_INT_WAKEUP flag.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-02-25 22:26:00 -05:00
Jukka Rissanen bf31b0985e drivers: ethernet: Disable drivers if tests are enabled
The network tests at tests/net use simulated network interfaces
and set CONFIG_NET_TEST to indicate that. If the config option
is set, then we do not want any extra Ethernet driver to
complicate the testing scenario so all external Ethernet
network interfaces should be disabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-25 20:50:42 -05:00
Sylvio Alves a79c54dc43 drivers: dac: esp32: fix clock control subsys argument
Current cfg->clock_subsys is passed as address and is
causing driver assertion.

Fixes #69198

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-02-25 20:49:01 -05:00
Renato Soma 5bec53b73a drivers: sensor: tmag5273: cast value to int64_t
Cast val1 from sensor_value before multiplication in order to avoid
integer overflow, as indicated by Coverity CID 347136.

Signed-off-by: Renato Soma <renatoys08@gmail.com>
2024-02-25 20:47:31 -05:00
Mathieu Choplain 6ff47b15db drivers: can: add missing argument to LOG_ERR call
PR #64399 introduced checks for out-of-bounds filter IDs
in CAN drivers, along with logging of said IDs; however,
the call to LOG_ERR in the native POSIX/Linux driver is
missing the 'filter_id' argument.

This commit adds the missing argument to ensure proper
data is printed when the LOG_ERR call is performed.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-02-25 20:45:29 -05:00
Tim Lin 77244aae1d ITE: drivers/gpio: Fix untrusted loop bound
The pin in the loop start counting from 0, so the condition of the
for loop should not be equal to num_pins.

Fixes #69118

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-02-19 19:59:27 +01:00
Venkataramana Kotakonda ca371d6890 drivers: espi: Clear virtual wire interrupt before calling handler
Clearing virtual wire interrupt after calling handler may cause next
interrupt miss if the same virtual wire changes due to action in handler.
As the interrupt source is read from register, it can be cleared before
calling handler to avoid next interrupt miss due to action/delay in the
callback handler.

Signed-off-by: Venkataramana Kotakonda <venkataramana.kotakonda@intel.com>
2024-02-19 19:58:28 +01:00
Henrik Brix Andersen 79d5857e9f drivers: adc: max1125x: use K_KERNEL_STACK_SIZEOF()
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69129

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-19 12:52:52 -06:00
Henrik Brix Andersen ad85283906 drivers: adc: ad5592: use K_KERNEL_STACK_SIZEOF()
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69133

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-19 12:52:52 -06:00
Henrik Brix Andersen 4274d1b365 drivers: adc: ads7052: use K_KERNEL_STACK_SIZEOF()
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69132

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-19 12:52:52 -06:00
Henrik Brix Andersen 0e321ecc90 drivers: adc: lmp90xxx: use K_KERNEL_STACK_SIZEOF()
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69131

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-19 12:52:52 -06:00
Henrik Brix Andersen ae81429a81 drivers: adc: mcp320x: use K_KERNEL_STACK_SIZEOF()
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69130

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-19 12:52:52 -06:00
Gustavo Silva b2b4016963 drivers: charger: bq25180: fix return value check
Fix missing check of the return value of `bq25180_set_charge_current`
function, resulting in logically dead code, as indicated by Coverity
CID 347197.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
2024-02-19 09:38:50 -06:00
Ayush Singh 7c9dbde659 ieee802154: ieee802154_cc13xx_cc26xx_subg: Fix 6lowpan for cc1352p7
- Fix using custom setup function
- Enable pRegOverrideTxStd and pRegOverrideTx20 in
  ieee802154_cc13xx_subg_radio_div_setup struct

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-17 21:14:30 +01:00
Thomas Stranger ade3c72a35 drivers: wifi: esp_at: fix ssid_len calucation for AP query.
The driver seems to be designed to use the very last byte of the
buffer(scan, connect), so null terminating the status query
might have unintended consequences.
However we should not use strlen to determine the ssid_len,
to avoid depending on the following buffer(bssid) to be zeroed.
Related to CID 316354

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-02-16 10:15:37 -06:00
Jose Alberto Meza f3d591815f drivers: ecia: microchip: Prevent lost eSPI interrupts
Clearing virtual wire interrupt after calling callback may cause
interrupt miss if the same virtual wire changes due to action
in handler.

e.g. HOST_RST_WRN pulse within 50 us

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2024-02-16 07:26:36 +01:00
Declan Snyder 9ce374b24a drivers: eth_mcux: Fix PM_DEVICE build failure
device power management is not yet supported with eth_mcux
except on the kinetis series, but this should not break
the build for other platforms when PM_DEVICE is set

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-02-16 07:26:18 +01:00
Ryan Erickson 034fc93db7 modem: hl7800: Fix null reference in hl7800_net_addr6_pton
Ensure a potential null pointer is not incremented.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-15 22:17:43 +01:00
Guennadi Liakhovetski 2f04a8c91e dma: intel-adsp: hda: avoid division by 0
A division by 0 has once been observed inside
intel_adsp_hda_dma_host_reload(). It is apparently caused by a
preceding logic or hardware error, but in any case values, read from
the hardware should be checked for 0 before being used as a divisor.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-02-15 16:23:49 +01:00
Ian Morris d3a0830ea5 drivers: clock_control: ra: sub-clock oscillator select fix
Due to a typo it is not possible to select the sub-clock oscillator
(SOSC) as a clock source for an RA Microcontroller. This patch resolves
the issue.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-02-15 09:20:30 +01:00
Mateusz Sierszulski 09a43661c3 drivers: serial: liteuart: Enable interrupt driven mode
This commit enables interrupt driven liteuart.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2024-02-15 09:19:57 +01:00
Ryan Erickson 63d6ea958e modem: hl7800: fix parsing APN username
Ensure a null reference cannot happen if there is an issue
parsing the APN username.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-14 19:08:13 +01:00
Henrik Brix Andersen 6e5c1ba3c1 drivers: can: mcan: fix handling of bus-off status events
Fix handling bus-off events in the Bosch M_CAN driver backend:
- Cancel all pending TX buffers when entering bus-off state
- Call all pending TX buffer callbacks with -ENETUNREACH when entering
  bus-off
- Automatically initiate bus-off recovery if
  CONFIG_CAN_AUTO_BUS_OFF_RECOVERY=y

Fixes: #68953

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-14 19:07:18 +01:00
Ryan Erickson d8afcfb501 modem: hl7800: validate IPv4 DNS addr len for IPv6
If the IPv6 DNS address is not a valid address, DNS will fallback
to the IPv4 DNS address.
Fix copying the IPv4 address to the IPv6 address by using
the IPv6 address destination length.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-14 19:03:02 +01:00
Bjarki Arge Andreasen 080d51bb36 modem: modem_cellular: CID 338067
incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen b668296a50 modem: modem_cellular: CID 338073
incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen 08a51bae89 modem: modem_cellular: CID 338115
incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen ae951f5f02 modem: modem_cellular: CID 338140
incorrect size passed to strncpy

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen adcdf64a0f modem: modem_cellular: CID 338164
strncpy() passed incorrect size

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Mikkel Jakobsen ef8e32561d drivers: led_strip: tlc5971: fix brightness control bit shifting
The lower bits of the brightness control registers were erroneously
shifted even though FIELD_PREP already does the shifting. In practice,
the effect is negliglible but of course should be fixed.

Also add missing parenthesis around shifting operations to satisy static
analysis.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2024-02-14 13:09:54 +01:00
Rajavardhan Gundi 57f1976ea8 drivers: i2c_mchp: Replace slave by target
Replace slave_register with target_register and slave_unregister
with target_unregister.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2024-02-14 12:06:20 +01:00
Guillaume Gautier b0e1e9f5fb drivers: bbram: stm32: add include to fix compilation error
Driver BBRAM for STM32 had a compilation error: "unknown type name
'RTC_TypeDef'" due to missing include file.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-02-14 10:40:00 +01:00
Thomas Stranger 61f065230a drivers: sensor: ltrf216a: fix overflow in conversion
The conversion of the raw sensor value overflows because
only a 32 bit multiplication is executed.
Fix the issue by promoting the raw sensor value to uint64_t before
executing the multiplication.

Analysis:
The current implementation overflows for all raw values grater
than 9544(14-bit).
But according to the datasheet the sensor has a maximum resolution of
20-bit. So Multiplying that value with 450.000 would need at least 39
bit to avoid an overflow, hence do it using 64-bit arithmetic.

Fixes CID 330657

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-02-13 21:14:21 +01:00
Henrik Brix Andersen ded0d48779 drivers: entropy: neorv32: add missing soc.h include
Add missing soc.h include for NEORV32_SYSINFO_FEATURES.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-13 10:42:04 +01:00
Tahsin Mutlugun dde9e48394 drivers: counter: maxim_ds3231: Fix coverity errors
Casting 64-bit time_t values into 32-bit unsigned integers causes
CWE-197 violations. Explicitly truncate these values by masking
time_t to avoid these warnings.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-02-13 10:25:53 +01:00
Tahsin Mutlugun 0e532d8909 drivers: counter: maxim_ds3231: Remove unused variables
data->rtc_base is not being used anywhere while data->rtc_registers is
only used as a temporary variable. Remove them from the driver.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-02-13 10:25:53 +01:00
Ryan Erickson cc1d545619 modem: bg9x: ignore sem return value
The semaphore waits forever, ignore the return value.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-13 10:25:23 +01:00
Jose Alberto Meza 3e65c94d7a drivers: espi: mec172x: Do not enable interrupt if VW is disabled
Do check if a VW is enabled before enabling interrupt

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2024-02-13 08:58:18 +01:00
Krzysztof Chruściński 5db338c035 drivers: serial: nrfx_uarte: Fix misbehavior due to preemption
UART_RX_RDY event can be generated from UARTE interrupt or k_timer
handler. When ENDRX event occurs then k_timer is stopped (it can
be restarted if there is another buffer provided). However, if UARTE
interrupt priority is higher than k_timer priority (RTC is used
underneath) then k_timer handler may still be executed later.
K_timer notifies new bytes based on RXDRDY HW event which is
counter by the TIMER (using PPI). It may happen that RXDRDY
event arrives due to byte received into RX FIFO but since there is
not buffer provided it stays in that FIFO. Given all this, it
was possible that RX_RDY event was reported from ENDRX UARTE event,
timer was stopped but because UARTE interrupt had higher priority
timer handler is executed after UARTE interrupt is handled. In
timer handler TIMER counter reports more bytes and calls
UART_RX_RDY event with null buffer and non-zero amount of bytes.

Fixed by generating UART_RX_RDY event only if RX buffer is not
null.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-02-12 12:52:32 +01:00
Guillaume Gautier 02219189d0 drivers: adc: stm32: add dma support for stm32f4 adc
Add ADC DMA support for STM32F4 (and similar series F2, F7 and L1)

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-02-12 12:19:56 +01:00
Thomas Stranger 850382bfd2 drivers: led: lp50xx: brightness: don't check uint >= 0
No need to check if an uint8_t is greater or equal 0 in
lp50xx_set_brightness.
Fixes CID 322654

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-02-10 16:32:23 +01:00
Tobias Röhmel 20f173773c drivers: Fix signs in max31865 temperature calculation
The reference document says that the formula for negative
temperatures has two minus signs missing.

fixes #68710

Signed-off-by: Tobias Röhmel <tobias.roehmel@rwth-aachen.de>
2024-02-09 17:38:31 +00:00
Laurentiu Mihalcea 41289dac06 drivers: dma: dma_nxp_edma: add function for channel filtering
The point of this commit is to allow users to request specific
channels. The following code snippet shows how this may now be
achieved:

	int requested_channel = 5;
	int ret = dma_request_channel(dev, &requested_channel);

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-02-09 16:20:34 +00:00
Laurentiu Mihalcea 4ff5e29cfe drivers: dma: dma_nxp_edma: switch to using DT_INST_IRQN_BY_IDX
After #63289, multi-level interrupts are now encoded using
macro magic. This means that using the generic DT_INST_IRQ_BY_IDX()
to fetch the INTID is no longer an option as the queried INTID
will be the one specified through the node's `interrupts`
properties. To fix this, switch to using DT_INST_IRQN_BY_IDX()
which will return the correctly encoded INTID.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-02-09 16:20:34 +00:00
Laurentiu Mihalcea c07d987431 drivers: dma: dma_nxp_edma: query channel number from HAL config
Currently, the number of channels supported by the controlled
is computed based on the size of the channel array. This
works well only if there's no gaps (i.e: "dma-channels" property
is used or "valid-channels" property is used with contiguous
channels) but will break if there are any gaps. For instance,
if the user wants to use channels 16 and 17 and specifies them
through the "valid-channels" property, they won't be allowed
to do so because dma_request_channels() will stop at channel 1.
As such, to fix this, simply use the number of channels from
the HAL configuration which is the maximum number of channels.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-02-09 16:20:34 +00:00
Daniel DeGrasse c73428062d drivers: mipi_dbi: mipi_dbi_spi: change reset pin polarity
Change reset pin polarity for MIPI DBI SPI controller, so that the board
devicetree is responsible for setting the GPIO to active low, and the
driver always sets the pin to a logic 1 to reset the display.

Fixes #68562

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-08 19:42:38 +01:00
Peter Ujfalusi 84631ce17c drivers: dma: dma_dw_common: Disable channel even if draining times out
If the channel suspend with draining fails on stop because of reasons
outside of the scope of the DMA driver (the peripheral is powered off
before trying to drain for example) we must continue and disable the
channel.

The channel can be released by the client despite of it remained enabled.
A new DMA channel request can pick the channel (as it is released) but
re-configuration is going to be skipped and the use of the channel is going
to fail. Then we will see the same drain timeout on channel stop again
since the channel retained the configuration which resulted the first
timeout.

The drain timeout was made fatal by an earlier commit which fixed the
WAIT_FOR return value handling.

Fixes: 6226f9e6e4 ("dma: dw: fix the return value check")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-02-08 18:03:09 +01:00
Thomas Stranger 505cc19941 drivers: w1: fix return check in bit_read for w1-gpio
The driver masked the return value of a pin read operation before
checking the error.
Thus not detecting a potential error and leading to logically
dead code, which was detected by coverity in CID 340853.
Anther instance XORs 1 before returning, resulting in an unexpected
return value;

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-02-08 12:14:36 +00:00
Thomas Stranger cbc75f8504 drivers: modem: ublox-sara-r4: freeaddrinfo mark unused param
The res param in offload_freeaddrinfo is not used.
Mark it as unused, to avoid static analysis complaining about
Parse warning (PW.PARAM_SET_BUT_NOT_USED)
Fixes CID 316235

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-02-08 07:03:48 +01:00
Ryan Erickson b65ab5fe88 modem: hl7800: check sem take in event handler
Only execute event callbacks if the semaphore is successfully taken.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-08 07:03:30 +01:00
Ryan Erickson 34ec42b8f3 modem: hl7800: sock_read len arg is not used
The static function sock_read does not need a length arg, remove it.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-08 07:03:12 +01:00
Andreas Anderberg 2b43c3b4a3 drivers: serial: emul: Make fifo_read() respect size
uart_emul_fifo_read() didn't regard the size arg, hence if the RX ring
buffer contained more data than the size of the input rx_data buffer
size, this could result in buffer overflow. This becomes more obvious
when configuring device tree property latch-buffer-size > 1.

Signed-off-by: Andreas Anderberg <andreas.anderberg@u-blox.com>
2024-02-07 12:52:43 -06:00
Maciej Baczmanski dbe74b3299 Revert "drivers: ieee802154: nrf: cache radio channel"
This reverts commit 780b12854c.
"drivers: ieee802154: nrf: cache radio channel"

Implementation affected RCP devices in openthread as MAC layer
does not call `Receive()` functions after transmit is done.

Additionally, after sending a frame to a new channel (for example
while discovery operation), radio switches to RX state immediately
after TX, but continues to listen on old channel for about 5ms,
until MAC layer calls `Receive` operation, forcing to change the
channel.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-02-07 15:35:29 +00:00
Tom Chang d558b31af5 drivers: espi: npcx: update for espi reset level
This CL updates the event data returned by espi_reset.
Return 0 for eSPI bus in reset, and 1 for eSPI bus out-of-reset.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-02-07 10:20:27 +01:00
Gerard Marull-Paretas b548a73e79 drivers: console: uart_mux: fix incorrect usage of configuration API
First, the API ops are available only if
CONFIG_UART_USE_RUNTIME_CONFIGURE=y, but the driver was not guarding the
code. Also, according to the API specs, these functions are optional,
and the interface already returns -ENOSYS if they are not implemented.
To solve both problems, just drop the dummy implementation.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-06 19:33:42 +01:00
Guillaume Gautier c1327db630 drivers: serial: stm32: always enable clock when exiting low power
Systematically enable the UART clock again when exiting a low power mode
before reading the UART register.
Even though the previous code worked on STM32WBA, for most series, it is
necessary to enable the clock to access the registers, otherwise they read
as 0.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-02-06 08:48:05 -06:00
Parthiban Nallathambi fd85021718 modem: change log level of events prints to debug
info level is printed always to console and it's noisy.
Change to debug level, which can be enabled with
CONFIG_MODEM_MODULES_LOG_LEVEL_DBG

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2024-02-06 13:00:05 +01:00
Krzysztof Chruściński f6ecad20a1 drivers: serial: Fix async to interrupt driven adaptation layer
Whenever UART_RX_DISABLED event is received module attempts to
re-enable receiver since in interrupt driven API receiver is
always on. However, it is possible that there is no free buffers
and in that case attempt to enable the receiver will fail with
-EBUSY. That scenario shall be accepted since the receiver will
be re-enabled when at least one buffer will be freed.

Given that, -EBUSY return shall be accepted (no assert) and
number of pending RX buffer requests shall be reset only on
successful enabling.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-02-06 09:54:34 +01:00
Jannis Ruellmann 1d9441c872 drivers: rpi_pico_pwm: Fix compilation warnings
return value of pwm_rpi_get_clkdiv contains implicit conversions
from 'float' to 'double', triggered by floating-point operations
involving mixed data types.

Signed-off-by: Jannis Ruellmann <j.ruellmann@kunbus.com>
2024-02-05 19:58:18 +00:00
Juliane Schulze 1683f1913b drivers: Add support for TI TMAG5273 3D Hall sensor
Product Homepage:
https://www.ti.com/product/TMAG5273

Datasheet:
https://www.ti.com/lit/ds/symlink/tmag5273.pdf

Tested on a custom hardware with nRF52840.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-02-05 13:23:24 -06:00
Grant Ramsay 6865e2ab67 drivers: can: mcan: Fix off-by-one errors in asserts
Fix off-by-one errors in asserts.

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2024-02-05 12:37:27 -06:00
Kai Vehmanen 00d4661273 drivers: dma: intel-adsp-hda: modify stop dma logic
Commit b2eaa6448076 ("drivers: dma: intel-adsp-hda: add delay to stop
host dma") added a wait on GBUSY state to host DMA stop.

This is problematic as in some case (like SOF chain-DMA usage),
the host DMA side RUN bit is not cleared when intel_adsp_hda_dma_stop()
is called. It is not possible to wait on GBUSY bit as there are
valid cases where it can remain set.

Address the original problem described in SOF bug #8686 and add a
polling check for intel_adsp_hda_is_enabled(). As per the bug
description, in some cases the GEN/FIFORDY bits are not cleared
immediately and if a new call to intel_adsp_hda_dma_stop() is made, the
PM refcounting will go haywire.

Link: https://github.com/thesofproject/sof/issues/8686
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-02-05 14:50:14 +01:00
Joel Guittet 415cb65e3f drivers: input: cst816s: add alternative chip id
The CST816S chip ID have an alternative value. It seems that this
field represents in fact a version number of controller. Fix by adding
the new chip ID.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2024-02-05 14:49:33 +01:00
Armando Visconti 277d649bda drivers: sensor: tmp108: fix coverity integer handling issue
Fix coverity integer handling issue (CWE-188).
Modifying a variable through a pointer of an incompatible type (other
than unsigned char) can lead to unpredictable results.

Fix: #67965
Coverity-CID: 248434

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-02-05 13:13:51 +01:00
Joel Guittet e90613efb2 drivers: display: gc9x01x: fix bindings include
The GC9X01X driver relies on panel.h instead of gc9x01x.h (doesn't
exist).

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2024-02-05 09:38:57 +00:00
Ian Morris 826d67af91 drivers: serial: ra: reduce uart baud rate error
Using the 8 base clock cycles per bit period setting (instead of 16)
reduces the uart baud rate error when using a 12MHz crystal (found on
many RA Microcontroller development kits boards). This setting also
slightly reduces the error when using the internal 48MHz oscillator,
used by the Arduino UNO R4 Minima board currently support by Zephyr.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-02-04 19:55:45 -06:00
Anas Nashif d7678f1694 xtensa: move to use system cache API support for coherency
Remove custom implementation and use system cache interface instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-03 13:42:33 -05:00
Guilherme Casa Nova 583f24e7e8 i2c_mcux_flexcomm: add transaction timeout option
With the device_sync_sem semaphore, there is the possibility of
the code not returning to give it back
(mcux_flexcomm_master_transfer_callback is never called),
causing it to get stuck in k_sem_take(&data->device_sync_sem, K_FOREVER)
in subsequent calls.

The i2c driver recovers by other means
(enabling FSL_FEATURE_I2C_TIMEOUT_RECOVERY)
but the callback might not return.

Adding a timeout option allows for this occurrence to be avoided.

Signed-off-by: Guilherme Casa Nova <guilherme.casa_nova@dell.com>
2024-02-02 15:24:26 -06:00
Abderrahmane Jarmouni 32fd2f57b1 drivers: display: stm32_ltdc: fix for stm32f429i_disc1
Display is not working on STM32F429i-DISC1 board because
display_blanking_off() needs to be sent to ILI9341 device, but it's sent
to LTDC instead which does not implement it.
This patch adds a LTDC DT property that provides the pHandle of the
display's own controller so that display_blanking_off/on are forwarded to
it when they are called by an application.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-02-02 19:54:45 +01:00
Daniel DeGrasse b6feb567d1 drivers: display: ili9xxx: do not delay for reset unless supported
Check the return code of mipi_dbi_reset, and do not delay for the reset
wait time unless the mipi controller has issued a hardware reset to the
display.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-02 11:52:17 -06:00
Daniel DeGrasse 5b767a0dd2 drvers: display: ili9xxx: fix usage of MIPI buffer descriptor
Fix usage of MIPI buffer descriptor in ili9xxx driver. Previously, the
buffer descriptor size was being set to display buffer size. For cases
where the write height/width  was not equal to the size of the buffer, this
resulted in additional data being written that was not needed. To
resolve this, calculate the mipi descriptor buffer size in the driver

Also, remove the unconditional setting of mipi_desc.height, as this
would override the previous (correct) setting.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-02 11:52:17 -06:00
Armando Visconti 12017b8481 drivers/sensor: lps2xdf: Fix uninitialized variables
Fix some uninitialized variables calling the proper get()
routine prior the equivalent set() operation.

Fixes: #66791, #66778, #66772.
Coverity-CID: 338119, 338144, 338157.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-02-02 10:53:32 -06:00
Juliane Schulze 34cb22e919 sensors: Add driver for Vischay VCNL36825T Proximity Sensor
Driver for the Vishay VCNL36825T including power management support.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-02-02 10:51:10 -06:00
Gerard Marull-Paretas d230542f1d drivers: serial: nrfx_uarte2: drop soc.h
As it is not required (e.g. RISC-V nRF54H port does not provide soc.h)

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Gerard Marull-Paretas d1468b8484 drivers: misc: nordic_vpr_launcher: initial version
Add a custom driver that takes care of loading and launching RISC-V VPR
cores found on the new nRF54 SoCs.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek bb065262bc drivers: timer: nrf_grtc_timer: Add dependency on nRF clock control
... in the related parts, so that the driver can be used on nRF54H20
where the clock control is not present yet.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek 976de4edbe drivers: serial: nrfx: Allow new UARTE instances to be used
Extend Kconfig definitions and nrfx_config translations so that UARTE
instances that are available in nRF54H20 can be used.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek 784688a511 drivers: serial: Kconfig.nrfx: Filter out options unsupported on nRF54H20
On nRF54H20, only the new shim can be used and the enhanced poll out
cannot be enabled since there is no DPPI support for this SoC yet.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek 139b97a64a modules: hal_nordic: Use common nrfx_config section for GRTC
Move code that prepares `NRFX_CONFIG_GRTC_*` definitions based on
information from devicetree from the nRF54L15 nrfx_config header
to the global one, so that the code can be used by nRF54H20, too.

The checks that validate owned-channels and child-owned-channels
DT properties are moved to the nrf_grtc_timer driver so that
the global nrfx_config is not polluted unnecessarily.

The default values in nrfx_config_nrf54l15_enga_application.h
are restored to those from the corresponding template file.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Tomas Galbicka 069bcbcb7f drivers: mbox: Add NXP Mailbox driver for mbox
This adds new NXP mailbox driver for MBOX device.

NXP mailbox IP driver supports sending data between cores.
It uses 32 bit register to trigger irq to other core.
This driver implementation uses 4 bits for channel selection of
triggering mode, 4 bits for channel selection of data transfer and
rest 24 bits for data.

NXP mailbox IP Reference Manual UM11126, Chapter 52.
https://www.nxp.com/webapp/Download?colCode=UM11126

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-02-02 09:31:33 -06:00
Francois Ramu b44f558059 drivers: flash: stm32 qspi drivers gets address and size from DTS
Address and size are given by the DTS register property
of the qspi nor : to be used by the qspi driver.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-02-02 13:48:18 +01:00
Francois Ramu 0bbd7bf977 drivers: flash: stm32 ospi drivers gets address and size from DTS
Address and size are given by the DTS register property
of the ospi nor : to be used by the ospi driver.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-02-02 13:48:18 +01:00
Fabio Baltieri 01be4aff40 input: gpio_qdec: add power management support
Add power management support to the gpio-qdec driver.

This is a bit complicated by the fact that the driver has two modes of
operation and the interrupt, timer and idle work ineract with each
other.

The suspend sequence is:
- set the suspended bit (inhibits the poll timer so that it does not
  resubmit the idle work)
- cancel the idle work (so that it does not schedule and re-set the
  interrupt or timers)
- disable interrupts (if used)
- stop the sampling timer
- disconnect the pins

The resume sequence is more or less the opposite.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-02-02 12:43:12 +01:00
Manuel Argüelles ce647d17b4 drivers: counter: mcux_rtc: enable oscillator if supported
Some devices like S32K1xx don't feature an internal 32.768 KHz
oscillator. Also, updated the code to use the existing HAL API
for this purpose.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-02-02 12:43:00 +01:00
Petr Hlineny a97c825d64 drivers: i2c: stm32: Disable suspend to idle during transaction
Suspend-to-idle stops I2C module clocks, which must remain active during
transaction

Signed-off-by: Petr Hlineny <development@hlineny.cz>
2024-02-02 10:07:59 +01:00
Chun-Chieh Li bc1a988f9d drivers: usb: device: support Nuvoton NuMaker series USBD controller driver
1. Configure 'core-clock' to 192MHz to generate necessary 48MHz
2. Support workaround to disallowing ISO IN/OUT EPs to be assigned
   the same EP numbers

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2024-02-02 10:07:43 +01:00
Kshitij Shah 24ebebdcc9 drivers: sensor: bma4xx: Add bma4xx emulator
Add emulator for bma4xx sensor.

Signed-off-by: Kshitij Shah <tij@google.com>
2024-02-01 21:42:49 -06:00
Sumit Batra 286a3ce37f drivers: eth: phy: tja1103: Handle link change
drivers: eth: phy: tja1103: Handle link change
These changes enable -
TJA1103 driver to gracefully handle Link connect or disconnect events
between Ethernet PHY and its link partner and notify it to the
upper network layers

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2024-02-01 14:29:43 -06:00
Sumit Batra bbc1087e83 drivers: eth: s32 gmac: Handle link change
These changes enable -
1. S32 gmac driver to gracefully handle
net iface down and up net shell commands and
2. Link connect or disconnect events between
Ethernet PHY and its link partner.

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2024-02-01 14:29:43 -06:00
Laurentiu Mihalcea 6644fa9104 dai: nxp: sai: Disable data line on pause trigger
Currently, whenever performing TRIGGER_PAUSE operation, the
data line is not disabled. This works well if TX and RX don't
operate at the same time or they operate in ASYNC-ASYNC mode. This
is because sai_tx_rx_disable() will disable transmitter/receiver
all the time since there's no dependencies to take into consideration.
However, in the ASYNC-SYNC mode, sai_tx_rx_disable() may not disable
the current asynchronous side if the synchronous side is still enabled.
As a consequence, the asynchronous side will remain enabled, thus
leading to an underrun/overrun.

To fix this issue, sai_trigger_pause() should disable the data line
each time it's called. This way, even if sai_tx_rx_disable() doesn't
disable the current direction, the data line will be disabled, thus
stopping the consumption/production of frames.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-02-01 14:27:37 -06:00
Daniel Gaston Ochoa 4c88deaa82 drivers: spi: stm32h7: Ignore spurious interrupts
Supurious interrupts can be generated when the SPI device
is disabled. Ignore them within the SPI IRQ handler.

Co-authored-by: Georgij Cernysiov <geo.cgv@gmail.com>

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2024-02-01 14:31:12 +00:00
Daniel Gaston Ochoa 9991d2ba65 drivers: spi: stm32h7: Use SPI FIFO
Allow to use H7 SPI FIFO to improve performance.

SPI FIFO usage can be enabled/disabled from devicetree.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2024-02-01 14:31:12 +00:00
Daniel Gaston Ochoa eb78d4dfde drivers: spi: stm32h7: Use transferSize and EOT
Set the transfer size in SPI H7 and check EOT instead of TXC
to be sure the transaction has finished. This is required to
enable the use of the SPI FIFO, as otherwise SPI seems to
operate in "continuous mode", which produces several SCK cycles
after the last frame has been sent/received. More details in the PR.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2024-02-01 14:31:12 +00:00
Daniel Gaston Ochoa cc9c90c767 devicetree: spi: stm32h7: Allow to enable SPI FIFO from DT
Allow to enable/disable the STM32 SPI FIFO usage from
devicetree.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2024-02-01 14:31:12 +00:00
Krzysztof Chruściński 25173f71cd pm: device_runtime: Extend with synchronous runtime PM
In many cases suspending or resuming of a device is limited to
just a few register writes. Current solution assumes that those
operations may be blocking, asynchronous and take a lot of time.
Due to this assumption runtime PM API cannot be effectively used
from the interrupt context. Zephyr has few driver APIs which
can be used from an interrupt context and now use of runtime PM
is limited in those cases.

Patch introduces a new type of PM device - synchronous PM. If
device is specified as capable of synchronous PM operations then
device runtime getting and putting is executed in the critical
section. In that case, runtime API can be used from an interrupt
context. Additionally, this approach reduces RAM needed for
PM device (104 -> 20 bytes of RAM on ARM Cortex-M).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-02-01 15:03:42 +01:00
Daniel DeGrasse 5df4e513f7 drivers: mipi_dbi: mipi_dbi_spi: cleanup pin checks
Add cleanups to pin presence checks within the mipi_dbi SPI driver.
The cleanups now verify that GPIO and RESET pin devices are ready,
if they are present for the device instance.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-01 14:37:30 +01:00
Henrik Brix Andersen 927c7ba193 drivers: can: fake: use delegate for reporting core clock rate
Use a delegate for reporting the core clock rate of the fake CAN
driver. This allows overriding the delegate at run-time and inspecting its
call count.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-01 13:19:46 +00:00
Mateusz Holenko 516fc76f84 drivers: eth_stm32_hal: Fix compilation warnings
Promote clk_ratio_adj to double for internal calculations related to ratio
to avoid compilation warnings related to implicit conversion from float
to double.

Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-02-01 14:11:55 +01:00
Martin Åberg e13d4a14df drivers/spi: Add support for GRLIB SPIMCTRL
This adds support for the GRLIB SPIMCTRL SPI controller used in LEON and
NOEL-V systems. SPIMCTRL can operate in two different modes: In the
default mode it allows memory-mapped read access to the flash data. When
set in the user mode, it can be used to generate SPI bus transactions.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2024-02-01 14:06:38 +01:00
Flavio Ceolin d4ba37739f drivers: modem/simcom: Unused variable
Make coverity happy and mark a variable as unused.

Fixes CID-248325
Fixes #58572

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-02-01 14:06:27 +01:00
Daniel DeGrasse 9d7a3fb647 drivers: flash: flash_flexspi_nor: support SFDP probe
Support SFDP probe in flexspi nor driver. This probe will allow the
flash driver to dynamically configure quad spi flashes for 1-4-4 mode,
expanding the flash chips supported with this driver.

The following data is read from the SFDP header:
- quad enable method
- fast read command (1-4-4 is maximum supported)

Fixes #55379

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-01 10:57:35 +01:00
Daniel DeGrasse a10fee2d5e drivers: clock_control: ccm_rev2: add support for reclocking FlexSPI
Add support for reclocking flexspi in ccm_rev2 driver. Clock update
functions are provided for the RT11xx.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-01 10:57:35 +01:00
Daniel DeGrasse f81113e948 drivers: clock_control: add support for FlexSPI reclock on NXP iMX RT10XX
Add support for reclocking the FlexSPI on NXP iMX RT10XX. This
functionality requires an SOC specific clock function to set
the clock rate, since the FlexSPI must be reset directly
before applying the new clock frequency.

Note that all clock constants are defined in this commit, since the
memc flexspi driver now depends on a clock node being present.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-01 10:57:35 +01:00
Harshit Agarwal 785d349de2 drivers: fpga: add Microchip PolarFire SoC FPGA driver
Add FPGA driver support for Microchip PolarFire SoC.

Signed-off-by: Harshit Agarwal <harshit.agarwal@microchip.com>
2024-02-01 04:33:16 -05:00
Kevin Wang 03a2dcf4b1 drivers: dma: atcdmac300: Update driver for bug 68129
1. Remove redundant include, <soc.h> is not needed.
2. Fix some wrong MACRO defined

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2024-01-31 23:19:39 -06:00
Fabio Baltieri 044529d0cd charger: bq25180: implement online and status properties
Implement CHARGER_PROP_ONLINE and CHARGER_PROP_STATUS for the bq25180
driver.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-31 17:59:50 -06:00
Fabio Baltieri 63cdde10d3 charger: bq25180: reuse bq25180_set_charge_current for the initial set
Reuse bq25180_set_charge_current for the initial setting of the charging
current.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-31 17:59:50 -06:00
Navinkumar Balabakthan a8490c3c3e drivers: interrupt_controller: changes in shared irq
Updated the shared IRQ handler function in the shared interrupt controller
drivers to include support for the 'irq_number' parameter. When a single
driver manages multiple shared IRQs, it becomes challenging to determine
which IRQ line is invoking the handler. Therefore, I've introduced an
option to share the IRQ number to address this issue.

Signed-off-by: Navinkumar Balabakthan <navinkumar.balabakthan@intel.com>
2024-01-31 13:47:39 -06:00
Anas Nashif a1e03d079a console: winstream: define as a proper console
eb2e5de01c made this a console driver but without adding the needed
hooks. This adds the hooks to support the console interface.

Fixes #65987
Fixes #66264

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-31 19:19:19 +01:00
Anas Nashif 8b80a2fd04 drivers: dma: andes: remove soc.h inclusion
Not needed or present soc.h

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-31 18:22:10 +01:00
Jeff Welder 59a87038df drivers: veml7700: Add white channel
Add the white light channel to the
veml7700 sensor to allow for correction
of light sources with strong infrared
content.

Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
2024-01-31 10:44:33 -06:00
Dino Li a059da947c soc/it8xxx2: add support for raising EC bus to 24MHz
This change was made to reduce read/write EC registers latency.
Without enabling CONFIG_SOC_IT8XXX2_EC_BUS_24MHZ:
- Read EC register 64 times takes 80us latency.
- Write EC register 64 times takes 60us latency.
With enabling CONFIG_SOC_IT8XXX2_EC_BUS_24MHZ:
- Read EC register 64 times takes 40us latency.
- Write EC register 64 times takes 30us latency.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-01-31 16:43:46 +00:00
Daniel DeGrasse 3dbbb73319 drivers: display: ili9xxx: convert to MIPI DBI API
Convert ili9xxx display drivers to use MIPI DBI API. Due to the fact
this change requires a new devicetree structure for the display driver
to build, required devicetree changes are also included in this commit
for all boards and shields defining an instance of an ili9xxx display.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-31 16:01:45 +00:00
Daniel DeGrasse 571de47e16 drivers: mipi_dbi: add SPI based MIPI DBI mode C driver
SPI controllers can easily implement MIPI DBI mode C, with the help of
GPIO pins for the reset and command/data signals. Introduce a MIPI DBI
compliant SPI driver, which emulates MIPI DBI mode C (SPI 3 and 4 wire).

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-31 16:01:45 +00:00
Daniel DeGrasse 3ab6572856 drivers: mipi_dbi: introduce MIPI DBI driver class
Introduce MIPI DBI driver class. MIPI DBI devices encompass several
interface types. All interfaces have a data/command, reset, chip select,
and tearing effect signal

Beyond this, MIPI DBI operates in 3 modes:

Mode A- 16/8 data pins, one clock pin, one read/write pin. Similar to
Motorola type 6800 bus

Mode B- 16/8 data pins, one read/write pin. Similar to Intel 8080 bus

Mode C- 1 data output pin, 1 data input pin, one clock pin.
Implementable using SPI peripheral, or MIPI-DBI specific controller.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-31 16:01:45 +00:00
Armando Visconti 4828340b92 drivers/sensor: add support to LIS2DE12 accelerometer
The LIS2DE12 is an ultra-low-power high- performance three-axis
linear accelerometer belonging to the “femto” family with digital
I2C/SPI serial interface standard output.

This driver is based on stmemsc HAL i/f v2.3

https://www.st.com/en/datasheet/lis2de12.pdf

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-01-31 15:39:45 +01:00
Armando Visconti dadac5d0ce drivers/sensor: stmemsc: add new sets of i2c/spi APIs
Add APIs to:

    1. read/write sensor regs on i2c/spi bus enabling adrress
       auto-increment in a stmemsc specific way.
    2. read/write sensor custom APIs.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-01-31 15:39:45 +01:00
Kevin Wang c181dcced4 drivers: spi: Support dma mode for atcspi200
1. Support the dma mode for andes_atcspi200
   and use board adp_xc7k_ae350 for testing.
2. Refine the function mechanism.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2024-01-31 15:03:28 +01:00
Kevin Wang a02011bac6 drivers: spi: Refine some coding style for andes_atcspi200
1. Remove the redundant code.
2. Use sys_set_bits and sys_clear_bits instead of customized MACRO.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2024-01-31 15:03:28 +01:00
Najumon B.A 34a2fbfba1 drivers: pci: update prt retrieve based on pnp id
update prt retrieve based on acpi pnp id instead of acpi device
path/name

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Naga Sureshkumar Relli 4d6a8bc65a drivers: spi: Add support for Polarfire SOC SPI
Add driver for the Microchip Polarfire SOC MSS SPI controller.
The interrupts of the MSS SPI are routed through PLIC(Platform level
interrupt controller).

Tested with generic spi-nor flash driver(spi_flash) with both Fixed
flash configuration and Read flash parameters at runtime(using SFDP).

Signed-off-by: Naga Sureshkumar Relli <nagasuresh.relli@microchip.com>
2024-01-31 06:36:21 -05:00
Mykola Kvach 739ec3072b drivers: serial: add missed binding for xen dom0 consoleio driver
Add missed binding and appropriate changes for Xen Dom0/Dom0less
UART driver.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-01-30 18:52:13 -05:00
Jordan Yates ef21569ac9 wifi: conn_mgr connectivity bindings
Bind WiFi network devices to the generic WiFi connectivity backend if
the appropriate option is set.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-30 18:51:46 -05:00
Magdalena Pastula 5a32e6e21c drivers: hwinfo: update to be aligned to nRF54L15
Update hwinfo driver to be aligned to nRF54L15.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Witold Lukasik 6d3009ff2b drivers: cache: add Nordic cache driver
Add Nordic driver for cache.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Magdalena Pastula b605c4219b drivers: timer: add GRTC driver
Add Nordic driver for GRTC.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Witold Lukasik ae78cf017d drivers: timer: move SYSTEM_CLOCK_WAIT to Kconfig.nrf_xrtc
SYSTEM_CLOCK_WAIT will be a common part for a next
version of Nordic timer.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Magdalena Pastula 9b3b34f16e drivers: serial: align to nRF54L15
Align UARTE driver config to nRF54L15.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Andriy Gelman c7dab3df08 drivers: can: Add xmc4xxx CAN support
Adds CAN drivers for XMC4xxx SoCs.

XMC4xxx has multiple CAN nodes. The nodes share a common clock and
a message object pool.

The CAN nodes do not have a loopback mode. Instead there is an
internal bus which can be used to exchange messages between
nodes on the SoC. For this reason tests/samples which rely on the
loopback feature have been disabled.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-01-30 19:06:06 +01:00
Navinkumar Balabakthan 966c4c37ab drivers: flash: Added cdns Nand Driver
Added Cadence NAND driver to support reading, erasing and writing data.

Signed-off-by: Navinkumar Balabakthan <navinkumar.balabakthan@intel.com>
2024-01-30 18:01:31 +01:00
Guillaume Gautier 624139ad9a drivers: clock_control: stm32wba: remove disabling of backup access
Disabling Backup access prevents Suspend to RAM to work.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-30 18:01:00 +01:00
Guillaume Gautier b097e3198f drivers: clock: wba: add get status function
Add a function to get the clock status on STM32WBA

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-30 18:01:00 +01:00
Wei-Tai Lee ab97a44096 drivers: i2c: andes: Remove the inclusion of soc.h
Remove the inclusion of empty file which will cause
twister-build error.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2024-01-30 17:56:07 +01:00
Gerard Marull-Paretas 5ef7404c7c drivers: spi: ifx_cat1: drop non-existing DT properties
It looks like driver references quite a few non-existing properties in
devicetree (see dts/bindings/spi/infineon,cat1-spi.yml). This mistake
was hidden because of DT_INST_PROP_OR(), which expands to the default if
the property is not present. However, after
260fc89643, the issue became visible
because sme DT_INST_PROP_OR() were changed to DT_INST_PROP().

Note that only fields not initialized to 0 (or false) have been kept.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-30 17:44:18 +01:00
Guillaume Gautier 62f1105550 drivers: adc: stm32: do not disable adc after measurement
Do not disable the ADC after the end of the measurement to avoid systematic
enabling which is time-consuming in case the configuration is unchanged.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-30 14:13:28 +00:00
Emil Lindqvist 548fb97142 cache: stm32: add new cache API to display and i2s
Use sys_cache API to handle cache flush/invalidate.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-01-30 14:12:57 +00:00
Laczen JMS 50597b2e52 flash: correct userspace flash_handlers
fixes #68248

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2024-01-30 08:30:32 -05:00
Pisit Sawangvonganan defab59dc4 drivers: can: mcp251xfd: reducing number of *reg pointer dereferences
Reducing the number of times the code dereferences the pointer *reg,
which points to SRAM. By using a local variable tmp for operations before
assigning it to *reg.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-30 08:29:52 -05:00
Guillaume Gautier ffb581a552 drivers: counter: stm32 rtc: add basic pm support
Add basic PM support for STM32 RTC counter.
It is useful for Suspend to RAM support to reenable the RTC register clock
after wakeup from Standby.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-30 10:49:22 +01:00
Armin Brauns 6a41a7abba drivers: mcp23xxx: explain more common causes for spurious interrupts
Interrupt handling in this chip is broken beyond repair, anyone unfortunate
enough to have to use it will probably come across this error and wonder
what's up.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-01-30 08:46:39 +01:00
Roman Studenikin 260fc89643 drivers: use DT_INST_PROP over DT_INST_PROP_OR if possible
It might happens that DT(_INST)_PROP_OR is used with boolean properties.
For instance:

	.single_wire = DT_INST_PROP_OR(index, single_wire, false),	\
	.tx_rx_swap = DT_INST_PROP_OR(index, tx_rx_swap, false),	\

This is not required as boolean properties are generated with false
value when not present, so the _OR macro extension is superflous
and the above code can be replaced by:

	.single_wire = DT_INST_PROP(index, single_wire),		\
	.tx_rx_swap = DT_INST_PROP(index, tx_rx_swap),			\

Signed-off-by: Roman Studenikin <srv@meta.com>
2024-01-30 00:26:58 +00:00
Sumit Batra 67474db716 drivers: sensor: qdec_s32k: fix double promotion warning
Fixing this "revealed" bug which got introduced when
a PR added the -Wdouble-promotion flag to GCC builds

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2024-01-29 20:24:52 +00:00
Francois Ramu 7795558ad5 drivers: flash: stm32 flash base address from the DTS node
For the flash driver, the base address is the MCU internal flash
address (usually 0x8000000). This PR gets the that address
from the device tree node "st,stm32-nv-flash"
instead of relying on the CONFIG_FLASH_BASE_ADDRESS
which might differ when building for another flash memory.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-01-29 14:12:47 -06:00
Benedikt Schmidt 5a2359332f drivers: gpio: fix build of BD8LB600FS on intel_adl_crb
Fix the build of the gpio driver BD8LB600FS on the
board intel_adl_crb.
Fixes #68219.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-29 10:26:08 -06:00
Tomasz Moń 76e12a33d9 drivers: i2s_nrfx: Generate master clock if pin is connected
The driver uses pinctrl to configure pins instead of nrfx I2S API.
Check whether MCK pin was actually connected by pinctrl instead of
comparing nrfx_cfg.mck_pin that is always NRF_I2S_PIN_NOT_CONNECTED.

This makes it possible for nRF I2S to provide master clock even when
operating in I2S Slave mode.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-01-29 14:03:20 +01:00
Marc Desvaux c7cc58ca77 drivers: usb_dc_stm32: Fix OUT transfer issue
The driver cannot handle OUT transactions for an endpoint with an
MPS smaller than 64 bytes. To solve the issue, we will not use one
fixed value, EP_MPS, but instead use the actual MPS of an endpoint,
ep_state->ep_mps.

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2024-01-29 11:07:22 +00:00
Bjarki Arge Andreasen 98d95851c6 drivers: gnss: lcx7g: Add Kconfigs for configurable buffers
Added Kconfigs to define the size of:
- UART backend receive buffer
- UART backend transmit buffer
- Satellites array size

and increased the UART RX buffer size a default to 256 as 128
is just on the edge of to small at a baudrate of 115200.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-29 10:58:58 +00:00
Bjarki Arge Andreasen 41240f9fb1 drivers: gnss: lcx7g: Close pipe on suspend
The pipe should be closed when suspended, both to save ressources
and to flush it. Without flushing the pipe, the driver may fail
to either resume or suspend the GNSS as the chat module starts
processing old data, which can contain acks to commands, breaking
the scripts.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-29 10:58:58 +00:00