[PATCH] i2c: core: Use GPIO descriptors for recovery

Linus Walleij linus.walleij at linaro.org
Fri Dec 8 05:05:46 PST 2017


On Fri, Dec 8, 2017 at 11:50 AM, Wolfram Sang <wsa at the-dreams.de> wrote:
> On Fri, Dec 08, 2017 at 11:20:02AM +0100, Linus Walleij wrote:
>> The I2C core contains code for handling a fallback recovery
>> using GPIO when a piece of I2C hardware fails in duty.
>>
>> This code passes GPIO numbers from the global GPIO
>> numberspace around and we want to get rid of this and use
>> GPIO descriptors associated with the devices.
>>
>> After some digging it turns out that there are two users
>> of the mechanism in the entire kernel:
>>
>> - i.MX that simply define "scl-gpios" and "sda-gpios" in
>>   the device tree which is already creating descriptors
>>   associated with the device, that we can pick up and use.
>>
>> - Two DaVinci boards that pass the SCL and SDA GPIOs using
>>   custom platform data.
>>
>> Refactor the core to grab the SCL and SDA GPIO descriptors
>> on-demand when doing recovery, and release them when
>> recovery is done. Grab the named descriptors "scl" and
>> "sda" which will make the i.MX method work out of the
>> box.
>>
>> Augment the two DaVinci board files to pass descriptors
>> using static tables.
>>
>> Cc: Shawn Guo <shawnguo at kernel.org>
>> Cc: Sascha Hauer <kernel at pengutronix.de>
>> Cc: Fabio Estevam <fabio.estevam at nxp.com>
>> Cc: Sekhar Nori <nsekhar at ti.com>
>> Cc: Kevin Hilman <khilman at kernel.org>
>> Cc: Keerthy <j-keerthy at ti.com>
>> Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
>
> We have this in i2c/for-next:
>
> 3991c5c80beaf7 ("i2c: Switch to using gpiod interface for gpio bus recovery")
>
> Sorry, I just noticed you were not on CC. I wrongly remembered you took
> part in that discussion, too.

Haha OK no problem, I'll go review the other patch.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list