diff options
author | Troy Mitchell <troy.mitchell@linux.spacemit.com> | 2025-09-25 10:02:29 +0800 |
---|---|---|
committer | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2025-09-25 23:49:08 +0200 |
commit | 0de61943244dec418d396633a587adca1c350b55 (patch) | |
tree | 42bfba1707c4874d0f5b1f5fd8d499668c32bf24 /rust/helpers/platform.c | |
parent | db7720ef50e0103be70a3887bc66e9c909933ad9 (diff) |
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: 5ea558473fa31 ("i2c: spacemit: add support for SpacemiT K1 SoC")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'rust/helpers/platform.c')
0 files changed, 0 insertions, 0 deletions