Commit graph

23353 commits

Author SHA1 Message Date
Mike J. Chen
f55d281536 drivers: i3c: i3c_mcux: a number of improvements and bug fixes
The main improvement is that mcux_i3c_transfer() and
mcux_i3c_i2c_api_transfer() will try much harder to not return an error
that could be caused by the bus being busy. The bus could be busy because
of IBI handling, especially if there are multiple I3C devices all raising
IBI that need to be processed, which can involve a number of context
switches and delays and take considerable time such that an application
initiated I3C transfer request might have returned busy. Replaced the code
that polled for idle state with a timeout with an infinite loop on a
condvar. The condvar is broadcast to at the end of every stop, which should
be when the bus goes idle.

Details of other changes:

* Remove ibi_lock, which seemed not useful. Use the single lock (switched
  from semaphore to mutex so it can be released by condvar) for both IBI
  handling and application requests.

* Remove code that disables i3c controller interrupts during transfers.
  Since the only interrupt is SLVSTART, and that just posts a work, it
  didn't seem necessary to disable that interrupt.

* Don't clear SLVSTART interrupt in mcux_i3c_status_clear_all(), to prevent
  any application transfers from accidentally clearing the SLVSTART
  interrupt or the handling of one IBI clearing the START initiated by
  another I3C device immeidately as the other one finishes.
  The only clearing of SLVSTART is in the isr.

* Add back a wait in mcux_i3c_request_auto_ibi(), otherwise the ibitype
  could be 0 if the processor is faster than the auto ibi handling.
  An earlier change removed a wait for MCTRLDONE, which isn't
  always set when AUTO_IBI is requested, but that could mean we try to
  read the ibitype before it's ready. Waiting for IBIWON instead should be
  correct and better, since the AUTO_IBI should result in IBIWON status bit
  being set (and MCTRLDONE being set would not guarantee that IBIWON was
  set).

* Change mcux_i3c_request_emit_stop() to still wait for idle if requested,
  even if the STOP wasn't actually issued, and add the release of the new
  condvar

* Change mcux_i3c_do_one_xfer_read() to handle the IBI use case differently
  than the regular application requested transfer case. In the application
  requested transfer case, the rx_len is known and set in RDTERM, so we
  could check for the COMPLETE status bit, but for IBI transfers, we
  just do a read to the payload buffer without knowing how many bytes
  the target may send us so never get a COMPLETE. Rather than check for a
  COMPLETE bit that might never occur, just have both cases read until we
  either read all requested bytes or we get a timeout error. But for the
  timeout error, if it's IBI and non-zero bytes were received, return
  the bytes received instead of an error.

* Change mcux_i3c_do_one_xfer() to return the error returned by
  mcux_i3c_do_one_xfer_read/write().

* Remove spurious return -EIO from end of mcux_i3c_do_daa()

* Change mcux_i3c_ibi_enable() to restore SLVSTART on error, and
  add some LOG_ERR() messages for error cases. Also add check to
  make sure idx is valid since there is a limit to how many IBI
  this controller can support.

* Change mcux_i3c_ibi_disable() to always reenable SLVSTART interrupt,
  even if the CCC to tell the target to disable IBI events fails.

* Change mcux_i3c_isr() to reenable SLVSTART interrupt if the
  work_enqueue() fails.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2024-02-29 11:52:34 +00:00
Jordan Yates
bb27f0578b bluetooth: hci: spi: 0xFF is a valid payload length
A payload size of 0xFF is valid and should not be a reason to keep
looping for more headers. The complete reqiurement is now:
```
header_slave[STATUS_HEADER_READY] == READY_NOW &&
header_slave[STATUS_HEADER_TOREAD] > 0
```
This fixes events being dropped when the payload size is 255.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-02-28 19:47:55 -06:00
Marcin Niestroj
a6b06004c2 drivers: wifi: esp_at: handle commas in SSIDs during scan and status
SSIDs can contains commas (,) when receiving scan results (+CWLAP) or
status (+CWJAP) over AT command from ESP-AT chip. This is in conflict with
modem subsystem argument parsing, which separates arguments automatically
whenever comma is encountered.

Use a direct modem command parsing, so that commas within quoted strings
are taken into account to be part of that string, instead of being treated
as delimiter.

This solves `wifi scan` and `wifi status` Zephyr shell commands output, for
networks containing commas (like "My_2,4GHz_AP") as part of SSID.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-02-28 18:02:44 +00:00
Marcin Niestroj
de30757d21 drivers: wifi: esp_at: escape SSID and PSK
According to [1], SSID and PSK need to be escaped:

  Escape character syntax is needed if SSID or password contains any
  special characters, such as , or " or \

Implement character escaping to fix connection attempt to WiFi APs
containing special characters as part of SSID, like "My_2,4GHz_AP".
Increase "connect command" buffer length to handle worst-case scenario of
all the SSID and PSK characters being special characters.

[1] https://docs.espressif.com/projects/esp-at/en/release-v2.4.0.0/esp32/AT_Command_Set/Wi-Fi_AT_Commands.html#id6

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-02-28 18:02:44 +00:00
John Johnson
c13930791d drivers: entropy: stm32: fix missing rng in function call
Replace rng to dev_data->rng in call to LL_RNG_SetHealthConfig.

Signed-off-by: John Johnson <john.filip.johnson@gmail.com>
2024-02-28 07:44:41 -06:00
Mykola Kvach
ff8c8923ae drivers: clock_control: r8a779f0: add clocks related to MMC
Add the possibility to configure clocks related to MMC.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-02-28 12:38:23 +01:00
Brian Juel Folkmann
2580b5af77 stm32: flash: ospi: Make erase function less chatty
Change LOG_INF to LOG_DBG in flash erase command

Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
2024-02-27 18:43:32 +01:00
Brian Juel Folkmann
f9ac97e1c8 stm32: flash: ospi: Fix erase if flash is larger than 16MB
Opcodes for erase is taken from jedec basic flash parameter table
These expects 3 byte addresses.

When running with 4 byte addresses, opcodes to be used shall be taken
from JEDEC 4-byte Address Instruction Parameter table

Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
2024-02-27 18:43:32 +01:00
Ricardo Rivera-Matos
814a1875f6 drivers: regulator: cp9314: adds initial support
Adds support for the CP9314 switched capacitor converter. The
CP9314 is a multi-level DC/DC converter capable of operating in
2:1 and 3:1 modes.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2024-02-27 14:57:12 +01:00
Björn Stenberg
8cdcb2c167 uart_native_tty: Emulate an interrupt driven uart
Emulate SERIAL_SUPPORT_INTERRUPT for UART_NATIVE_TTY, using a thread that
polls the tty and invokes the callback.

This allows interrupt-driven subsystems such as modbus to use a native tty,
which is useful for testing purposes.

Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2024-02-27 14:49:02 +01:00
Mustafa Abdullah Kus
c9e908d7f3 drivers: rtc: rtc_ll_stm32: add rtc calibration out support
implementation rtc calibration output
frequency set routine.

Signed-off-by: Mustafa Abdullah Kus <mustafa.kus@sparsetechnology.com>
2024-02-27 14:47:31 +01:00
Gerard Marull-Paretas
f0b975032a drivers: misc: nordic_vpr_launcher: fix address handling
When CONFIG_XIP=y, execution address may come from a partition, so its
absolute address is needed. Fix code by using VPR_ADDR() macro in all
cases: execution and source addresses.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 21:39:30 +01:00
Abderrahmane Jarmouni
4affeaab20 drivers: serial: uart_stm32: fix for async_rx_buf_rsp
uart_stm32_async_rx_buf_rsp() does not return the necessary errors when
rx_next_buffer is already set & when async uart rx is disabled.
This patch was submitted by @mkaranki

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-02-26 14:30:27 +01:00
Dino Li
6b0b63b3a7 ITE: drivers/i2c target mode: Fix racing condition
The finish interrupt after the previous transaction is completed may
occur in the next transaction. To do hardware reset at this time could
potentially lead to the failure of the transaction.
Therefore, removing the hardware reset upon completing the transaction
helps to avoid a race condition.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-02-26 11:54:13 +00:00
Fabio Baltieri
cbad8eff46 drivers: display: drop a bunch of redundant placeholder API functions
Drop a bunch of display functions that only return "not supported", the
display API already handles these by checking for NULL API function
pointer.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-02-26 11:41:11 +00:00
Peter Ujfalusi
11f69be9fd drivers: dma: dma_dw_common: Log start and stop in info level
The start and stop of the DMA channel provides useful information in
default logs and they are not too frequent to cause bandwidth issues.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-02-26 11:40:39 +00:00
Peter Ujfalusi
f918aea733 drivers: dma: dma_intel_adsp_gpdma: Improve context information in logging
The LOG_* macros already print the module name and the function, printting
again the __func__ have no additional benefit.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-02-26 11:40:39 +00:00
Peter Ujfalusi
852f2ed1d4 drivers: dma: dma_dw_common: Improve context information in log prints
The LOG_* macros already print the module name and the function, printting
again the __func__ have no additional benefit.

The debug prints lack context which can be used to identify the channel
which the message was printed for.
For example:
<inf> dma_dw_common: dw_dma_stop: dw_dma_stop: dma 0 channel drain time out

when multiple channels from multiple controllers are used we don't know
the exact channel that has been stopped:
<inf> dma_dw_common: dw_dma_stop: dma@7c000: channel 0 drain time out
<inf> dma_dw_common: dw_dma_stop: dma@7d000: channel 0 drain time out

Convert all LOG prints to add usable context to them and use the following
pattern wherever it is possible:
dma_dw_common: <function name>: <DMA device name>: message
for example:
<inf> dma_dw_common: dw_dma_stop: dma@7c000: channel 0 config

The parameter list of dw_dma_avail_data_size() and dw_dma_free_data_size()
extended to pass the dev pointer.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-02-26 11:40:39 +00:00
Celina Sophie Kalus
83192c71e4 drivers: ipm: esp32: Allow doorbell without data transfer
IPM drivers are commonly used to send notifications/cause interrupts
without any transfer of data. To add this use case in the ESP32 IPM
driver, the guard statement is appended so that the pointer to the
data buffer is allowed to be zero only if the size of the data to be
transferred is zero. If size is given as 0 and data is equal to NULL,
we are thus only using the IPM as a doorbell, not to transfer data.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
2024-02-26 11:39:29 +00:00
Peter Ujfalusi
6423bc3bc8 drivers: dai: intel: ssp: Improve logging output
The printed logs lack usable information curerntly, for example:
arecord -Dhw:0,0 -fdat | aplay -Dhw:0,0 -fdat

results:
...
[13110.111051] <inf> dai_intel_ssp: dai_ssp_pre_start: dai_ssp_pre_start
[13110.111070] <inf> dai_intel_ssp: dai_ssp_start: dai_ssp_start
[13110.455085] <inf> dai_intel_ssp: dai_ssp_pre_start: dai_ssp_pre_start
[13110.455103] <inf> dai_intel_ssp: dai_ssp_start: dai_ssp_start
[13229.817080] <inf> dai_intel_ssp: dai_ssp_pause: dai_ssp_pause TX
[13229.819111] <inf> dai_intel_ssp: dai_ssp_stop: dai_ssp_stopTX stop
[13229.858060] <inf> dai_intel_ssp: dai_ssp_pause: dai_ssp_pause RX
[13229.858556] <inf> dai_intel_ssp: dai_ssp_stop: dai_ssp_stop RX stop
...

If we use multiple SSPs this gets even harder to understand. Which SSP is
starting exactly?

This patch improves the prints to prefix it with SSP instance and drops the
printing of __func__, resulting:
...
[13444.974460] <inf> dai_intel_ssp: dai_ssp_early_start: SSP0 RX
[13444.974486] <inf> dai_intel_ssp: dai_ssp_start: SSP0 RX
[13445.318453] <inf> dai_intel_ssp: dai_ssp_early_start: SSP0 TX
[13445.318478] <inf> dai_intel_ssp: dai_ssp_start: SSP0 TX
[13446.323438] <inf> dai_intel_ssp: dai_ssp_pause: SSP0 TX
[13446.324141] <inf> dai_intel_ssp: dai_ssp_stop: SSP0 TX
[13446.329403] <inf> dai_intel_ssp: dai_ssp_pause: SSP0 RX
[13446.330931] <inf> dai_intel_ssp: dai_ssp_stop: SSP0 RX
...

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-02-26 11:38:16 +00:00
Chen Xingyu
d181607f4e drivers: input: Implement driver for ADC keys
This commit introduces a driver for ADC keys, a common circuit design where
keys are connected to an ADC input via a resistor ladder.

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-02-26 11:35:19 +00:00
Mykola Kvach
448466a970 drivers: serial: add support of hscif driver for RCar boards
Add support of HSCIF UART driver for Renesas boards.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-02-26 11:34:16 +00:00
Ricardo Rivera-Matos
5868c701ef samples: charger: Demos new output limit properties
Adds use of CHARGER_PROP_DISCHARGE_CURRENT_NOTIFICATION and
CHARGER_PROP_SYSTEM_VOLTAGE_NOTIFICATION_UV to the charger
sample application.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2024-02-26 11:33:24 +00:00
Mulin Chao
cc3bfb67d3 drivers: espi: npcx: add ESPI_OOB_CHANNEL_RX_ASYNC support
Add CONFIG_ESPI_OOB_CHANNEL_RX_ASYNC support in npcx espi driver.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2024-02-26 12:27:22 +01:00
John Johnson
dbf3d6e911 drivers: esp_at: implement bind() and recvfrom() for UDP sockets
Implement bind() and recvfrom() for UDP sockets. This is achived by
setting remote field in net_pkt which in return makes recvfrom() fill
in *src_addr. This is only implemented for passiv mode and CIPDINFO needs
to be enabled. Also set net_if to non-dormant when enabling AP mode to
make binding to a port and address possible.

Signed-off-by: John Johnson <john.filip.johnson@gmail.com>
2024-02-26 12:21:47 +01:00
Adrian Warecki
9cf3e08429 mm: tlb: mtl: Fix memory page unmapping
The sys_mm_drv_unmap_page function first replaced the tlb entry with
the default one and then read the physical address that was mapped.
However, it was already overwritten, so it always release the default
physical address instead of the truly mapped one.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-02-26 12:19:32 +01:00
Adrian Warecki
46f3d78983 mm: tlb: mtl: Add support for changing mapped region flags
Added sys_mm_drv_update_page_flags function that allows to change access
flags to a already mapped memory region.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-02-26 12:19:32 +01:00
Jeppe Odgaard
398d297519 drivers: dac: stm32: add dac value range check
Compare value and DAC resolution in `dac_write_value` and return -EINVAL
if the value is above supported resolution.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-02-26 12:07:22 +01:00
Julien Panis
29e24948f8 drivers: spi_dw: Handle multiple interrupt lines for errors
This patch handles multiple interrupt lines for errors. Each of the
4 DW SPI error interrupts (txo_err, rxo_err, rxu_err, mst_err) can
use a different line of the GIC, instead of using a single line of
the GIC for all error interrupts (err_int).

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2024-02-26 11:49:10 +01:00
Julien Panis
30b6cd2647 drivers: spi_dw: Manage MMIO and 64 bit platforms
This patch manages DW SPI driver MMIO region. As a result, the driver now
runs properly on 64 bit platforms.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2024-02-26 11:49:10 +01:00
Francois Ramu
62e7b788aa drivers: timer: stm32 lptimer when sleeping for -1
When CONFIG_SYSTEM_SLOPPY_IDLE is not set, then system
can sleep for -1 means waking Up at the max possible
counter value (INT_MAX)
When CONFIG_SYSTEM_SLOPPY_IDLE is set sleeping K_TICKS_FOREVER
means never wakingUp

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-02-26 11:48:22 +01:00
Ali Hozhabri
88369606e2 drivers: bluetooth: hci: Multiple write transaction support for BlueNRG-MS
Provide multiple write transaction support for BlueNRG-MS, st_hci_spi_v1
protocol. Since by default, BlueNRG-MS write buffer supports up to 127
bytes; however, it is possible to have consecutive write transactions
so as to send data more than 127 bytes.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-02-26 11:47:32 +01:00
Yonatan Schachter
4ef0e1221d sys/util.h: Add IS_ALIGNED macro
Added IS_ALIGNED macro to check if a pointer is aligned to
a given alignment. Additionally, removed a macro with a
conflicting name in drivers/crypto_intel.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-02-26 11:46:30 +01:00
Bernt Johan Damslora
73d56dea66 drivers: mfd: npm6001: set SWREADY
Sets SWREADY in MFD initialization, so that hysteresis mode can be used.

Signed-off-by: Bernt Johan Damslora <bernt.damslora@nordicsemi.no>
2024-02-26 10:42:38 +01:00
Mateusz Michalek
517d5ce2e3 drivers: flash: rram singlethreading support
Adds conditional usage of locking mechanisms to allow building
without multithreading.

Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
2024-02-26 10:27:23 +01:00
Jakub Zymelka
5e313608fe drivers: flash: rram: minor driver code changes
Minor changes to standardize the driver code.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-02-26 10:27:23 +01:00
Pierce Lowe
609b864537 drivers: flash: rram: Make rram flash timeout multiplier user selectable
Make flash timeout multiplier user selectable for rram flash driver

Signed-off-by: Pierce Lowe <pierce.lowe@nordicsemi.no>
2024-02-26 10:27:23 +01:00
Andrzej Puzdrowski
e40dc3879d drivers/flash/rram: set to use up to 512 B burst writes by default
Now RRAMC is set to use up to 512 B burst writes by default as most
time effective.
Requested slot time was changed to 8000 us for that case, as this is
required in order to hold the longest write operation.
Drivers differs slot duration depending on configured RRAMC buffers count
(CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE).

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2024-02-26 10:27:23 +01:00
Andrzej Puzdrowski
06c68caec5 drivers/flash: fix nRF RRAM write-length issue while MPSL in use
When radio-synchronization was on
(CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE=n) context of writing was shifted
by 4 instead of write-length (this caused redundant, self-shortening
writes to the same block.)

write-len was unset when requested write len was less than
RRAM_MAX_WRITE_BUFFER.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-02-26 10:27:23 +01:00
Andrzej Puzdrowski
fdac87738b drivers/flash: add radio synchronization to RRAM
Added synchronization with BLE radio operation to the RRAM flash
driver. The implementation is using framework which is already
provided for nrf52's flash driver.

Additional added resource locking mechanism while driver does writing
which solves mutual exclusion write access problem.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-02-26 10:27:23 +01:00
Jakub Zymelka
3a8ee7df91 drivers: Add flash driver for RRAM
Added a simple driver for RRAM. It is implemented as a flash driver,
because the "RRAM eFlash" macro obeys flash-like constraints.
Although users are not required to erase before write.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-02-26 10:27:23 +01:00
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