diff options
| author | Jie Li <lj29312931@gmail.com> | 2026-05-11 13:37:26 +0200 |
|---|---|---|
| committer | Andi Shyti <andi.shyti@kernel.org> | 2026-07-29 23:38:13 +0200 |
| commit | 18ca2ce160ffff977f28456039f2475a3b500bc0 (patch) | |
| tree | 94fdf5d5f715ea952e9d1517cbdad4673d979c71 /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | 87e713f2004811062e5283a5a4efb52c883bb355 (diff) | |
i2c: core: support recovery for single-ended GPIOs
Currently, i2c_init_recovery() only assigns the set_sda/set_scl
hooks if gpiod_get_direction() returns GPIO_LINE_DIRECTION_OUT.
This logic fails on certain SoC controllers where open-drain lines
in a high-impedance state are physically reported as inputs. This
leads to a "deadlock" where the I2C core refuses to assign the
recovery hooks because it incorrectly assumes the pins are
input-only, even though they are fully capable of driving the bus
low for recovery.
Update the recovery initialization to use the new
gpiod_is_single_ended() helper. If a GPIO is configured as
open-drain or open-source in the firmware, it is safe to assume
it can be used for bus recovery, even if the current hardware
direction is reported as input.
Signed-off-by: Jie Li <jie.i.li@nokia.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260511113726.49041-3-jie.i.li@nokia.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
