Thread (6 messages) 6 messages, 3 authors, 2020-06-09

Re: Re: [RFC PATCH] i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery

From: <Codrin.Ciubotariu@microchip.com>
Date: 2020-05-13 11:07:14
Also in: linux-arm-kernel, linux-i2c, lkml

On 05.05.2020 18:12, Wolfram Sang wrote:
On Wed, Apr 15, 2020 at 10:06:43AM +0300, Codrin Ciubotariu wrote:
quoted
devm_gpiod_get() usually calls gpio_request_enable() for non-strict pinmux
drivers. These puts the pins in GPIO mode, whithout notifying the pinctrl
driver. At this point, the I2C bus no longer owns the pins. To mux the
pins back to the I2C bus, we use the pinctrl driver to change the state
of the pins to GPIO, before using devm_gpiod_get(). After the pins are
received as GPIOs, we switch theer pinctrl state back to the default
one,

Fixes: d3d3fdcc4c90 ("i2c: at91: implement i2c bus recovery")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Applied to for-current, thanks!
Just looked at this patch and noticed that I should change the pinctrl 
state back to default if we can't get the gpio pins. I will submit a 
patch to fix this.
This will do for 5.7. For 5.8 or 5.9, I can imagine to take the two
pinctrl_state pointers into bus_recovery_info and handle all this in the
core. I will try this later this week if noone is super-eager to try it
out before.
By 'all this' you mean to move the entire function in the core, right? 
Having just these two pointers bus_recinovery_info won't help much. I 
can try it, if you haven't already started...

Best regards,
Codrin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help