mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Bastien Curutchet <bastien.curutchet@bootlin.com>,
	Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Peter Korsgaard <peter.korsgaard@barco.com>,
	Wolfram Sang <wsa@kernel.org>
Cc: linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Herve Codina <herve.codina@bootlin.com>,
	Christopher Cordahi <christophercordahi@nanometrics.ca>
Subject: Re: [PATCH v2 3/3] i2c: mux: gpio: Add support for the 'transition-delay-us' property
Date: Wed, 29 May 2024 14:16:58 +0200	[thread overview]
Message-ID: <ca3a96c2-e4d9-d935-cf1b-114f7a59872e@axentia.se> (raw)
In-Reply-To: <20240529091739.10808-4-bastien.curutchet@bootlin.com>

Hi!

2024-05-29 at 11:17, Bastien Curutchet wrote:
> Some hardware need some time to switch from a bus to another. This can
> cause the first transfers following the selection of a bus to fail.
> There is no way to configure this kind of waiting time in the driver.
> 
> Add support for the 'transition-delay-us' device-tree property. When set,
> the i2c_mux_gpio_select() applies a delay before returning, leaving
> enough time to the hardware to switch to the new bus.
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
> ---
>  drivers/i2c/muxes/i2c-mux-gpio.c           | 6 ++++++
>  include/linux/platform_data/i2c-mux-gpio.h | 2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
> index c61e9d9ea695..b9cfc80660e2 100644
> --- a/drivers/i2c/muxes/i2c-mux-gpio.c
> +++ b/drivers/i2c/muxes/i2c-mux-gpio.c
> @@ -6,6 +6,7 @@
>   */
>  
>  #include <linux/bits.h>
> +#include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/gpio/driver.h>
>  #include <linux/i2c.h>
> @@ -37,6 +38,9 @@ static int i2c_mux_gpio_select(struct i2c_mux_core *muxc, u32 chan)
>  
>  	i2c_mux_gpio_set(mux, chan);
>  
> +	if (mux->data.transition_delay)
> +		udelay(mux->data.transition_delay);

fsleep() is appropriate here.

Cheers,
Peter

      reply	other threads:[~2024-05-29 12:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29  9:17 [PATCH v2 0/3] i2c: mux: gpio: Add " Bastien Curutchet
2024-05-29  9:17 ` [PATCH v2 1/3] dt-bindings: i2c: " Bastien Curutchet
2024-05-29 12:13   ` Peter Rosin
2024-06-03 15:58     ` Rob Herring
2024-06-05 12:32       ` Bastien Curutchet
2024-05-29  9:17 ` [PATCH v2 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order Bastien Curutchet
2024-05-29  9:17 ` [PATCH v2 3/3] i2c: mux: gpio: Add support for the 'transition-delay-us' property Bastien Curutchet
2024-05-29 12:16   ` Peter Rosin [this message]

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=ca3a96c2-e4d9-d935-cf1b-114f7a59872e@axentia.se \
    --to=peda@axentia.se \
    --cc=andi.shyti@kernel.org \
    --cc=bastien.curutchet@bootlin.com \
    --cc=christophercordahi@nanometrics.ca \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.korsgaard@barco.com \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsa@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

all inboxes | Powered by JetHome®