i2c: riic: Implement bus recovery
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Thu, 1 May 2025 20:40:03 +0000 (21:40 +0100)
committerAndi Shyti <andi@smida.it>
Mon, 19 May 2025 20:23:57 +0000 (22:23 +0200)
commitba9e1b5254783528e10b45b1f0fb40e21f4ff88a
treefff41396a6e0ce3f94cef3d0beab2aa5c8c03e3a
parent218d2318185b165d254b4ddc013f99d3906e1859
i2c: riic: Implement bus recovery

Implement I2C bus recovery support for the RIIC controller by making use
of software-controlled SCL and SDA line manipulation. The controller allows
forcing SCL and SDA levels through control bits, which enables generation
of manual clock pulses and a stop condition to free a stuck bus.

This implementation wires up the bus recovery mechanism using
i2c_generic_scl_recovery and provides get/set operations for SCL and SDA.

This allows the RIIC driver to recover from bus hang scenarios where SDA
is held low by a slave.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Link: https://lore.kernel.org/r/20250501204003.141134-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-riic.c