i2c: designware: Add support for recovery when GPIO need pinctrl
authorYann Sionneau <ysionneau@kalray.eu>
Tue, 22 Aug 2023 14:34:37 +0000 (16:34 +0200)
committerWolfram Sang <wsa@kernel.org>
Fri, 25 Aug 2023 20:26:03 +0000 (22:26 +0200)
commit4ba63869a0f539c1b8d5027ccf2295c23d66fa54
tree9465fb55b13dfaaa61348b0028657d71a87aa66a
parent2ed4fa9cb875a7720258fa25521ac67220e934b8
i2c: designware: Add support for recovery when GPIO need pinctrl

Currently if the SoC needs pinctrl to switch the SCL and SDA from the I2C
function to GPIO function, the recovery won't work.

scl-gpio = <>;
sda-gpio = <>;

Are not enough for some SoCs to have a working recovery.
Some need:

scl-gpio = <>;
sda-gpio = <>;
pinctrl-names = "default", "recovery";
pinctrl-0 = <&i2c_pins_hw>;
pinctrl-1 = <&i2c_pins_gpio>;

The driver was not filling rinfo->pinctrl with the device node
pinctrl data which is needed by generic recovery code.

Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-designware-master.c