All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Cc: linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com,
	nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
	kamel.bouhara@bootlin.com, linux@armlinux.org.uk,
	linus.walleij@linaro.org, alan@softiron.com
Subject: Re: [RFC PATCH] i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery
Date: Tue, 5 May 2020 17:12:56 +0200	[thread overview]
Message-ID: <20200505151256.GF2468@ninjato> (raw)
In-Reply-To: <20200415070643.23663-1-codrin.ciubotariu@microchip.com>

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

On Wed, Apr 15, 2020 at 10:06:43AM +0300, Codrin Ciubotariu wrote:
> 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!

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.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Cc: alan@softiron.com, kamel.bouhara@bootlin.com,
	alexandre.belloni@bootlin.com, linus.walleij@linaro.org,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	ludovic.desroches@microchip.com, linux-i2c@vger.kernel.org,
	linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH] i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery
Date: Tue, 5 May 2020 17:12:56 +0200	[thread overview]
Message-ID: <20200505151256.GF2468@ninjato> (raw)
In-Reply-To: <20200415070643.23663-1-codrin.ciubotariu@microchip.com>


[-- Attachment #1.1: Type: text/plain, Size: 933 bytes --]

On Wed, Apr 15, 2020 at 10:06:43AM +0300, Codrin Ciubotariu wrote:
> 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!

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.


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-05-05 15:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  7:06 [RFC PATCH] i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery Codrin Ciubotariu
2020-04-15  7:06 ` Codrin Ciubotariu
2020-04-19 12:50 ` ludovic.desroches
2020-04-19 12:50   ` ludovic.desroches
2020-05-05 15:12 ` Wolfram Sang [this message]
2020-05-05 15:12   ` Wolfram Sang
2020-05-13 11:07   ` Codrin.Ciubotariu
2020-05-13 11:07     ` Codrin.Ciubotariu
2020-05-20 16:27     ` Wolfram Sang
2020-05-20 16:27       ` Wolfram Sang
2020-06-09 11:43       ` Codrin.Ciubotariu
2020-06-09 11:43         ` Codrin.Ciubotariu

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=20200505151256.GF2468@ninjato \
    --to=wsa@the-dreams.de \
    --cc=alan@softiron.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=codrin.ciubotariu@microchip.com \
    --cc=kamel.bouhara@bootlin.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ludovic.desroches@microchip.com \
    --cc=nicolas.ferre@microchip.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.