Commit 0de61943 authored by Troy Mitchell's avatar Troy Mitchell Committed by Wolfram Sang
Browse files

i2c: spacemit: ensure SDA is released after bus reset



After performing a conditional bus reset, the controller must ensure
that the SDA line is actually released.

Previously, the reset routine only performed a single check,
which could leave the bus in a locked state in some situations.

This patch introduces a loop that toggles the reset cycle and issues
a reset request up to SPACEMIT_BUS_RESET_CLK_CNT_MAX times, checking
SDA after each attempt. If SDA is released before the maximum count,
the function returns early. Otherwise, a warning is emitted.

This change improves bus recovery reliability.

Fixes: 5ea55847 ("i2c: spacemit: add support for SpacemiT K1 SoC")
Signed-off-by: default avatarTroy Mitchell <troy.mitchell@linux.spacemit.com>
Reviewed-by: default avatarAurelien Jarno <aurelien@aurel32.net>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
parent db7720ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment