zephyr/drivers
Tim Lin e1b5b8b5f9 drivers/i2c: ite: Add handling for read operation with 0-byte length
The current I2C driver assumes that at least one byte will be read in CQ
(command queue) mode. However, when a 0-byte read is issued
(e.g., by cmd_i2c_scan),
The read handler uses (len - 1) to set the command queue length.
When len is 0, this underflows to 0xFF, leading to an incorrect transfer
length and possible crash.

To fix this, add a check in cq_mode_allowed() for reads with length 0:

-Fallback to PIO mode in such cases.
-Properly handle 0-byte reads by issuing STOP (E_FINISH) when the slave
 address is acknowledged.
-Add appropriate handling for NACK conditions when the slave address is
 not acknowledged.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-05-29 10:46:47 +02:00
..
adc drivers: adc_ad4130|adc_7124: Add ret initialization in *_perform_read() 2025-05-28 15:33:14 +02:00
audio drivers: audio: pcm1681: add driver 2025-05-23 11:03:32 +02:00
auxdisplay drivers/auxdisplay: format jhd1313 driver. 2025-05-12 13:31:13 +02:00
bbram drivers: bbram: npcx: bypass npcx49nf errata rev1.5 No.2.30 2025-03-20 07:21:23 +01:00
bluetooth Drivers: Bluetooth: H4: Use a semaphore to wake up HCI RX thread 2025-05-26 11:54:09 +02:00
cache cache: stm32: add cortex-m33 peripheral driver 2025-04-25 11:04:37 +02:00
can driver: can: renesas: remove first can bus starting at init 2025-05-29 06:31:47 +02:00
charger charger: axp2101: Guards against out-of-bounds read 2025-05-28 12:22:21 +02:00
clock_control drivers: clock_control: update clock control driver to support XMC7200 2025-05-28 21:29:20 +02:00
comparator dts: enum_macros: make sure that they are lowercase 2025-05-28 17:48:57 +02:00
console drivers: console: uart_mcumgr: rename callback 2025-04-22 09:58:40 +02:00
coredump
counter drivers: counter: introduce counter node in esp32 timers 2025-05-29 08:41:59 +02:00
crypto drivers; crypto: Remove TinyCrypt shim 2025-05-23 17:41:06 -04:00
dac drivers: dac: add driver for the NXP DAC12 2025-05-13 03:20:29 +02:00
dai Drivers: DAI: Intel: DMIC: Program start symmetrically for PDMx 2025-04-02 13:04:32 +02:00
disk drivers: disk: nvme: fix warnings 2025-04-24 20:27:50 +02:00
display drivers: display: ssd1306: fix reset 2025-05-28 01:47:24 +02:00
dma drivers: dma: sdma: Make access to DMA channel stats atomic 2025-05-28 20:02:31 +02:00
dp drivers: dp: use atomic APIs for pin set/reset 2025-05-22 13:44:55 +02:00
edac
eeprom drivers: eeprom: tmp11x: remove redundant build assert 2025-05-15 11:18:41 +02:00
entropy drivers: entropy: add iproc_rng200 (rpi_5) random generator driver 2025-05-14 09:11:42 +02:00
espi style: add missing curly braces in if/while/for statements. 2025-05-17 14:10:33 +02:00
ethernet drivers: ethernet: adapt code with new RTD 2.0.1 2025-05-28 05:54:38 +02:00
firmware drivers: firmware: nrf_ironside: add IRONside update service 2025-05-22 16:17:35 +02:00
flash driver: flash: Add Set/ Get write protect function 2025-05-28 08:14:27 +02:00
fpga drivers: fpga: ice40: Fix log level 2025-05-09 01:40:35 +02:00
fuel_gauge fuel_gauge: add basic support for AXP2101 chip 2025-05-22 04:51:27 +02:00
gnss drivers: gnss: gnss_emul missing month_day data 2025-04-29 16:49:29 +02:00
gpio drivers: gpio: Update GPIO driver to support XMC7200 2025-05-28 21:29:20 +02:00
haptics
hdlc_rcp_if drivers: nxp: Do not use private L2 data structure. 2025-05-05 14:25:13 +02:00
hwinfo hwinfo: stm32: reverse device id byte order to match v4.1 order 2025-05-23 11:04:10 +02:00
hwspinlock
i2c drivers/i2c: ite: Add handling for read operation with 0-byte length 2025-05-29 10:46:47 +02:00
i2s drivers: i2s: siwx91x: Add siwx91x I2S primary driver 2025-05-20 15:24:50 +02:00
i3c drivers: i3c: Fix misspelling of brief in doxygen 2025-05-07 11:44:33 +02:00
ieee802154 drivers: ieee802154: fix mcxw ieee802154 driver 2025-05-27 09:16:04 +02:00
input drivers: input: cap12xx Fix integer overflow warning 2025-05-28 01:48:22 +02:00
interrupt_controller modules: Update hal_wch 2025-05-24 18:03:53 +02:00
ipm driver: ipm: introduce IPM_MAX_DATA_SIZE build configuration 2025-05-27 10:29:20 +02:00
led led: drop led_context.h 2025-05-22 02:21:51 +02:00
led_strip leds: add arduino,modulino-smartleds 2025-05-14 11:03:10 +01:00
lora
mbox mbox: workaround for missing ic-msg 2025-05-21 17:34:56 +02:00
mdio drivers: eth/mdio: esp32: enable GPIO0 for phy clock out 2025-05-01 09:34:13 +02:00
memc drivers: memc: Add support for siwx91x QSPI controller 2025-05-15 09:00:39 +02:00
mfd drivers: mfd: add FLEXCOM drivers for Microchip SAM devices 2025-05-28 08:14:08 +02:00
mipi_dbi drivers: Wrap device driver APIs using DEVICE_API macro 2025-04-28 13:41:03 +02:00
mipi_dsi drivers: mipi_dsi: dsi_mcux_2l: Use NXP DCNano DBI driver for memory write 2025-04-23 10:03:42 +02:00
misc drivers: misc: Add nxp,rtxxx-dsp-ctrl 2025-05-21 12:34:32 +02:00
mm intel_adsp: ace30: mm: Set write permissions during memory mapping 2025-03-18 16:41:22 +01:00
modem modem_cellular: Add support for the simcom a76xx modem 2025-05-28 16:37:53 +02:00
mspi drivers: mspi: add apollo5x MSPI controller 2025-05-07 10:33:38 +02:00
net net: nsos_sockets: conn_mgr support 2025-05-22 11:31:54 +02:00
pcie
peci
pinctrl drivers: pinctrl: sam: add pinctrl for sama7g5 2025-05-28 08:14:08 +02:00
pm_cpu_ops
power_domain
ps2
ptp_clock drivers: ptp_clock_nxp_enet: re-enable ENET timestamp IRQ 2025-05-21 08:02:22 +02:00
pwm drivers: pwm: update variable and marco name in RTD 2.0.1 2025-05-28 05:54:38 +02:00
regulator regulator: npm1300: convert regulator GPIOs to array 2025-05-22 13:44:31 +02:00
reset drivers: Wrap device driver APIs using DEVICE_API macro 2025-04-28 13:41:03 +02:00
retained_mem drivers: retained_mem: Fix using multiple nRF retained memory regions 2025-03-07 20:23:42 +01:00
rtc drivers: rtc: pcf8563: fix get alarm time 2025-05-28 05:54:49 +02:00
sdhc drivers: sdhc: imx_usdhc: enable MMIO mapping 2025-05-12 16:47:49 +02:00
sensor sensor: afbr_s50: Add DTS configuration bindings 2025-05-28 21:29:13 +02:00
serial drivers: serial: Update UART driver to support XMC7200 2025-05-28 21:29:20 +02:00
sip_svc
smbus
spi drivers: spi: nrfx_spim: self resume until spi_release() 2025-05-20 16:09:11 +01:00
stepper drivers: stepper: allegro: Fix missing break statement 2025-05-27 17:56:27 +02:00
syscon drivers: syscon: Introduce BFLB Efuse driver 2025-05-19 10:11:58 +02:00
tee
timer drivers: timer: sam: add pit64b timer for sama7g5 2025-05-28 08:14:08 +02:00
usb drivers: usb: Enable USB and UDC OTGPHY clock 2025-05-28 10:04:40 +02:00
usb_c drivers: tcpc: Add TCPC driver for FUSB307 2025-05-27 11:50:29 +02:00
video video: sw_generator: remove frmival values check 2025-05-28 05:54:15 +02:00
virtualization
w1
watchdog drivers: wch: fix the ch32vfun.h path after the recent HAL update 2025-05-28 05:54:28 +02:00
wifi drivers: wifi: esp32: Add option for WiFi SPIRAM 2025-05-27 15:46:08 +02:00
xen
CMakeLists.txt kscan: drop kscan and any reference 2025-03-13 16:56:26 +00:00
Kconfig kscan: drop kscan and any reference 2025-03-13 16:56:26 +00:00