[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200513111322.111114-1-codrin.ciubotariu@microchip.com>
Date: Wed, 13 May 2020 14:13:22 +0300
From: Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>
To: <linux-i2c@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <ludovic.desroches@...rochip.com>, <nicolas.ferre@...rochip.com>,
<alexandre.belloni@...tlin.com>, <wsa@...nel.org>,
<linus.walleij@...aro.org>,
Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>
Subject: [PATCH] i2c: at91: Restore pinctrl state if can't get scl/sda gpios
If there is a strict pinmux or if simply the scl/sda gpios are missing,
the pins will remain in gpio mode, compromizing the I2C bus.
Change to the default state of the pins before returning the error.
Fixes: a53acc7ebf27 ("i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>
---
drivers/i2c/busses/i2c-at91-master.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c
index d4a3aef4a594..363d540a8345 100644
--- a/drivers/i2c/busses/i2c-at91-master.c
+++ b/drivers/i2c/busses/i2c-at91-master.c
@@ -877,6 +877,7 @@ static int at91_init_twi_recovery_gpio(struct platform_device *pdev,
gpiod_put(rinfo->scl_gpiod);
rinfo->scl_gpiod = NULL;
}
+ pinctrl_select_state(dev->pinctrl, dev->pinctrl_pins_default);
return -EINVAL;
}
--
2.25.1
Powered by blists - more mailing lists