From: <Ryan.Wanner@microchip.com>
To: <linus.walleij@linaro.org>
Cc: <linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-gpio@vger.kernel.org>, <alexandre.belloni@bootlin.com>,
<Ludovic.Desroches@microchip.com>, <Nicolas.Ferre@microchip.com>,
<Claudiu.Beznea@microchip.com>
Subject: Re: I2c GPIO Recovery with pinctrl strict mode
Date: Fri, 10 Feb 2023 15:21:47 +0000 [thread overview]
Message-ID: <961a2164-640a-86b5-980f-73668eb161e4@microchip.com> (raw)
In-Reply-To: <CACRpkdbK8A9X4nCZEc53-wXU0Vgkc53j_r5rLQiSeoNbmvm8sg@mail.gmail.com>
On 2/9/23 03:32, Linus Walleij wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Tue, Feb 7, 2023 at 6:56 PM <Ryan.Wanner@microchip.com> wrote:
>
>> My main issue is the process of freeing ownership of a pin(s) having
>> another driver, in this case gpio, to take ownership then free that
>> ownership back to the default state, in this case it would be back to
>> i2c.
>>
>> I have tried calling pinmux_disable_setting() and then claiming the
>> gpios then enabling them for recovery then disabling them again. This
>> causes lots of warnings and some cases the full ownership is not
>> transferred.
>>
>> It seems that what I am attempting to achieve is not doable currently.
>> Is this the case or am I missing some extra things needing to prepare
>> for this action?
>
> There are several other i2c bus drivers doing this already, for example
> drivers/i2c/busses/i2c-imx.c
>
> The idea is to have some different pinctrl states and move between
> them explicitly in the driver to move pins from i2c mode to GPIO
> mode and back.
>
> The imx driver depend on the ability of the i.MX pin controller to use
> the pins as a certain function and GPIO at the same time.
>
> This is due to the imx pin controller not setting the .strict attribute
> on the struct pinmux_ops so that pins can be used in parallel for
> i2c and GPIO and gpiod_get() will not fail. But the Atmel driver does
> not set this so you should be fine I think.
>
I am trying to enable .strict in the Atmel pinctrl driver, and that is
what is causing my issues. I have tried a similar approach to the imx
driver but it seems I cannot transfer ownership cleanly.
Best,
Ryan
next prev parent reply other threads:[~2023-02-10 15:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 17:56 I2c GPIO Recovery with pinctrl strict mode Ryan.Wanner
2023-02-09 10:32 ` Linus Walleij
2023-02-09 13:24 ` Michael Walle
2023-02-10 15:21 ` Ryan.Wanner [this message]
2023-02-13 9:29 ` Linus Walleij
2023-02-17 17:36 ` Ryan.Wanner
2023-02-18 23:29 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=961a2164-640a-86b5-980f-73668eb161e4@microchip.com \
--to=ryan.wanner@microchip.com \
--cc=Claudiu.Beznea@microchip.com \
--cc=Ludovic.Desroches@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox