Re: I2c GPIO Recovery with pinctrl strict mode

From: Ryan.Wanner
Date: Fri Feb 17 2023 - 12:37:00 EST


On 2/13/23 02:29, Linus Walleij wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Fri, Feb 10, 2023 at 4:21 PM <Ryan.Wanner@xxxxxxxxxxxxx> wrote:
>
>> I am trying to enable .strict in the Atmel pinctrl driver, and that is
>> what is causing my issues.
>
> Strictly speaking (ha!) that flag is for when you *cannot* use a pin
> in GPIO mode at the same time as another mode.
>
> Example: if you use the pin in I2C mode, then reading the GPIO
> input register will *not* reflect the value on the electrical line,
> because it has been decoupled physically. Then .strict should
> be true.
>
> The strict mode was not intended for policy, i.e. stopping kernel
> developers from doing wrong things. They have enough tools to
> do wrong things anyway, one more or less doesn't matter.

I understand, so .strict keeps the pins mapped to one ownership,
so if I2C has those pins GPIO could not have access to them.

When it comes to I2c recovery, looking at the I2C generic recovery,
the pins are both being used by the I2C and the GPIO at the same time.
This cannot happen with strict mode. So since I am enabling strict mode
for pinctrl-atmel-pio4.c I2C recovery cannot work?

Thanks,
Ryan
>
> Yours,
> Linus Walleij