devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property
@ 2024-06-17 12:08 Bastien Curutchet
  2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Bastien Curutchet @ 2024-06-17 12:08 UTC (permalink / raw)
  To: Peter Rosin, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi, Bastien Curutchet

Hi all,

The i2c-gpio-mux can be used to describe a multiplexer built upon
several i2c isolators having an enable pin (such as LTC4310):

 +---------------+                     +------+  +------+
 | +-----------+ |                     | dev  |  | dev  |
 | | GPIO_EN_A |-|-----------|         +------+  +------+
 | +-----------+ |     +-----+---+         |         |
 |               |  |--| isol. A |---------+---------+
 |     +-----+   |  |  +---------+
 | SOC | I2C |---|--|
 |     +-----+   |  |  +---------+
 |               |  |--| isol. B |------+---------+---------+
 | +-----------+ |     +-----+---+      |         |         |
 | | GPIO_EN_B |-|-----------|      +------+  +------+  +------+
 | +-----------+ |                  | dev  |  | dev  |  | dev  |
 +---------------+                  +------+  +------+  +------+

These isolators often need some time between their enable pin's
assertion and the first i2c transfer. If the first i2c transfer
happens before this enabling time is reached, transfer fails.

There is no available option to configure such a time in the
i2c-gpio-mux driver.

Add a optional property in the bindings called 'transition-delay-us'.
If present, driver waits for this delay every time a new bus is
selected, i.e. before returning from the bus_select() callback.

Changes in v2:
 * Rewrite bindings' commit log
 * Express the 'transition delay' in us instead of ms

Changes in v3:
 * Rename DT property to 'settle-time-us'
 * Use fsleep instead of udelay

[v1] : https://lore.kernel.org/all/20240527113908.127893-1-bastien.curutchet@bootlin.com/
[v2] : https://lore.kernel.org/all/20240529091739.10808-1-bastien.curutchet@bootlin.com/

Bastien Curutchet (3):
  dt-bindings: i2c: gpio: Add 'settle-time-us' property
  i2c: mux: gpio: Re-order #include to match alphabetic order
  i2c: mux: gpio: Add support for the 'settle-time-us' property

 .../devicetree/bindings/i2c/i2c-mux-gpio.yaml      |  3 +++
 drivers/i2c/muxes/i2c-mux-gpio.c                   | 14 ++++++++++----
 include/linux/platform_data/i2c-mux-gpio.h         |  2 ++
 3 files changed, 15 insertions(+), 4 deletions(-)

-- 
2.45.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 1/3] dt-bindings: i2c: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property Bastien Curutchet
@ 2024-06-17 12:08 ` Bastien Curutchet
  2024-06-17 12:19   ` Krzysztof Kozlowski
                     ` (3 more replies)
  2024-06-17 12:08 ` [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order Bastien Curutchet
                   ` (4 subsequent siblings)
  5 siblings, 4 replies; 17+ messages in thread
From: Bastien Curutchet @ 2024-06-17 12:08 UTC (permalink / raw)
  To: Peter Rosin, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi, Bastien Curutchet

I2C MUXes described by the i2c-gpio-mux sometimes need a significant
amount of time to switch from a bus to another. When a new bus is
selected, the first I2C transfer can fail if it occurs too early. There
is no way to describe this transition delay that has to be waited before
starting the first I2C transfer.

Add a 'settle-time-us' property that indicates the delay to be
respected before doing the first i2c transfer.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
---
 Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml
index f34cc7ad5a00..4a93d1f78f93 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml
+++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml
@@ -57,6 +57,9 @@ properties:
       last value used.
     $ref: /schemas/types.yaml#/definitions/uint32
 
+  settle-time-us:
+    description: Delay to wait before doing any transfer when a new bus gets selected.
+
 allOf:
   - $ref: i2c-mux.yaml
 
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order
  2024-06-17 12:08 [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property Bastien Curutchet
  2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
@ 2024-06-17 12:08 ` Bastien Curutchet
  2024-07-09 21:42   ` Andi Shyti
  2024-07-10  8:02   ` Peter Rosin
  2024-06-17 12:08 ` [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property Bastien Curutchet
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 17+ messages in thread
From: Bastien Curutchet @ 2024-06-17 12:08 UTC (permalink / raw)
  To: Peter Rosin, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi, Bastien Curutchet

The #includes don't match alphabetic order.

Re-order #includes to match the alphabetic order before adding a new
one.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
---
 drivers/i2c/muxes/i2c-mux-gpio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index d6bbb8b68333..c61e9d9ea695 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -5,16 +5,16 @@
  * Peter Korsgaard <peter.korsgaard@barco.com>
  */
 
+#include <linux/bits.h>
+#include <linux/gpio/consumer.h>
+#include <linux/gpio/driver.h>
 #include <linux/i2c.h>
 #include <linux/i2c-mux.h>
+#include <linux/module.h>
 #include <linux/overflow.h>
 #include <linux/platform_data/i2c-mux-gpio.h>
 #include <linux/platform_device.h>
-#include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/bits.h>
-#include <linux/gpio/consumer.h>
-#include <linux/gpio/driver.h>
 
 struct gpiomux {
 	struct i2c_mux_gpio_platform_data data;
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property
  2024-06-17 12:08 [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property Bastien Curutchet
  2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
  2024-06-17 12:08 ` [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order Bastien Curutchet
@ 2024-06-17 12:08 ` Bastien Curutchet
  2024-07-09 21:43   ` Andi Shyti
                     ` (2 more replies)
  2024-07-03  9:35 ` [PATCH v3 0/3] i2c: mux: gpio: Add " Bastien Curutchet
                   ` (2 subsequent siblings)
  5 siblings, 3 replies; 17+ messages in thread
From: Bastien Curutchet @ 2024-06-17 12:08 UTC (permalink / raw)
  To: Peter Rosin, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi, Bastien Curutchet

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 'settle-time-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..944577bb09c1 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.settle_time)
+		fsleep(mux->data.settle_time);
+
 	return 0;
 }
 
@@ -116,6 +120,8 @@ static int i2c_mux_gpio_probe_fw(struct gpiomux *mux,
 	if (device_property_read_u32(dev, "idle-state", &mux->data.idle))
 		mux->data.idle = I2C_MUX_GPIO_NO_IDLE;
 
+	device_property_read_u32(dev, "settle-time-us", &mux->data.settle_time);
+
 	return 0;
 }
 
diff --git a/include/linux/platform_data/i2c-mux-gpio.h b/include/linux/platform_data/i2c-mux-gpio.h
index 816a4cd3ccb5..b548588aa1f2 100644
--- a/include/linux/platform_data/i2c-mux-gpio.h
+++ b/include/linux/platform_data/i2c-mux-gpio.h
@@ -19,6 +19,7 @@
  *	position
  * @n_values: Number of multiplexer positions (busses to instantiate)
  * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
+ * @settle_time: Delay to wait when a new bus is selected
  */
 struct i2c_mux_gpio_platform_data {
 	int parent;
@@ -26,6 +27,7 @@ struct i2c_mux_gpio_platform_data {
 	const unsigned *values;
 	int n_values;
 	unsigned idle;
+	int settle_time;
 };
 
 #endif /* _LINUX_I2C_MUX_GPIO_H */
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: i2c: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
@ 2024-06-17 12:19   ` Krzysztof Kozlowski
  2024-07-09 21:42   ` Andi Shyti
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-17 12:19 UTC (permalink / raw)
  To: Bastien Curutchet, Peter Rosin, Andi Shyti, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi

On 17/06/2024 14:08, Bastien Curutchet wrote:
> I2C MUXes described by the i2c-gpio-mux sometimes need a significant
> amount of time to switch from a bus to another. When a new bus is
> selected, the first I2C transfer can fail if it occurs too early. There
> is no way to describe this transition delay that has to be waited before
> starting the first I2C transfer.
> 
> Add a 'settle-time-us' property that indicates the delay to be
> respected before doing the first i2c transfer.
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property Bastien Curutchet
                   ` (2 preceding siblings ...)
  2024-06-17 12:08 ` [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property Bastien Curutchet
@ 2024-07-03  9:35 ` Bastien Curutchet
  2024-07-09 21:45 ` Andi Shyti
  2024-07-16 18:28 ` Andi Shyti
  5 siblings, 0 replies; 17+ messages in thread
From: Bastien Curutchet @ 2024-07-03  9:35 UTC (permalink / raw)
  To: Peter Rosin, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi

Hi all,

On 6/17/24 14:08, Bastien Curutchet wrote:
> Hi all,
> 
> The i2c-gpio-mux can be used to describe a multiplexer built upon
> several i2c isolators having an enable pin (such as LTC4310):
> 
>   +---------------+                     +------+  +------+
>   | +-----------+ |                     | dev  |  | dev  |
>   | | GPIO_EN_A |-|-----------|         +------+  +------+
>   | +-----------+ |     +-----+---+         |         |
>   |               |  |--| isol. A |---------+---------+
>   |     +-----+   |  |  +---------+
>   | SOC | I2C |---|--|
>   |     +-----+   |  |  +---------+
>   |               |  |--| isol. B |------+---------+---------+
>   | +-----------+ |     +-----+---+      |         |         |
>   | | GPIO_EN_B |-|-----------|      +------+  +------+  +------+
>   | +-----------+ |                  | dev  |  | dev  |  | dev  |
>   +---------------+                  +------+  +------+  +------+
> 
> These isolators often need some time between their enable pin's
> assertion and the first i2c transfer. If the first i2c transfer
> happens before this enabling time is reached, transfer fails.
> 
> There is no available option to configure such a time in the
> i2c-gpio-mux driver.
> 
> Add a optional property in the bindings called 'transition-delay-us'.
> If present, driver waits for this delay every time a new bus is
> selected, i.e. before returning from the bus_select() callback.
> 
> Changes in v2:
>   * Rewrite bindings' commit log
>   * Express the 'transition delay' in us instead of ms
> 
> Changes in v3:
>   * Rename DT property to 'settle-time-us'
>   * Use fsleep instead of udelay
> 
> [v1] : https://lore.kernel.org/all/20240527113908.127893-1-bastien.curutchet@bootlin.com/
> [v2] : https://lore.kernel.org/all/20240529091739.10808-1-bastien.curutchet@bootlin.com/
> 

I don't think I've received any feedback since the bindings were 
reviewed by Krzysztof. Has anyone had a chance to look at this V3 
iteration yet?


Best regards,
Bastien

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: i2c: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
  2024-06-17 12:19   ` Krzysztof Kozlowski
@ 2024-07-09 21:42   ` Andi Shyti
  2024-07-10  8:01   ` Peter Rosin
  2024-07-12  7:00   ` Wolfram Sang
  3 siblings, 0 replies; 17+ messages in thread
From: Andi Shyti @ 2024-07-09 21:42 UTC (permalink / raw)
  To: Bastien Curutchet
  Cc: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Korsgaard, Wolfram Sang, linux-i2c, devicetree,
	linux-kernel, Thomas Petazzoni, Herve Codina, Christopher Cordahi

Hi,

On Mon, Jun 17, 2024 at 02:08:16PM GMT, Bastien Curutchet wrote:
> I2C MUXes described by the i2c-gpio-mux sometimes need a significant
> amount of time to switch from a bus to another. When a new bus is
> selected, the first I2C transfer can fail if it occurs too early. There
> is no way to describe this transition delay that has to be waited before
> starting the first I2C transfer.
> 
> Add a 'settle-time-us' property that indicates the delay to be
> respected before doing the first i2c transfer.
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order
  2024-06-17 12:08 ` [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order Bastien Curutchet
@ 2024-07-09 21:42   ` Andi Shyti
  2024-07-10  8:02   ` Peter Rosin
  1 sibling, 0 replies; 17+ messages in thread
From: Andi Shyti @ 2024-07-09 21:42 UTC (permalink / raw)
  To: Bastien Curutchet
  Cc: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Korsgaard, Wolfram Sang, linux-i2c, devicetree,
	linux-kernel, Thomas Petazzoni, Herve Codina, Christopher Cordahi

Hi,

On Mon, Jun 17, 2024 at 02:08:17PM GMT, Bastien Curutchet wrote:
> The #includes don't match alphabetic order.
> 
> Re-order #includes to match the alphabetic order before adding a new
> one.
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Thanks,
Andi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property
  2024-06-17 12:08 ` [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property Bastien Curutchet
@ 2024-07-09 21:43   ` Andi Shyti
  2024-07-10  8:02   ` Peter Rosin
  2024-07-12  6:58   ` Wolfram Sang
  2 siblings, 0 replies; 17+ messages in thread
From: Andi Shyti @ 2024-07-09 21:43 UTC (permalink / raw)
  To: Bastien Curutchet
  Cc: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Korsgaard, Wolfram Sang, linux-i2c, devicetree,
	linux-kernel, Thomas Petazzoni, Herve Codina, Christopher Cordahi

Hi,

On Mon, Jun 17, 2024 at 02:08:18PM GMT, 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 'settle-time-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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Thanks,
Andi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property Bastien Curutchet
                   ` (3 preceding siblings ...)
  2024-07-03  9:35 ` [PATCH v3 0/3] i2c: mux: gpio: Add " Bastien Curutchet
@ 2024-07-09 21:45 ` Andi Shyti
  2024-07-10  8:04   ` Peter Rosin
  2024-07-16 18:28 ` Andi Shyti
  5 siblings, 1 reply; 17+ messages in thread
From: Andi Shyti @ 2024-07-09 21:45 UTC (permalink / raw)
  To: Bastien Curutchet
  Cc: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Korsgaard, Wolfram Sang, linux-i2c, devicetree,
	linux-kernel, Thomas Petazzoni, Herve Codina, Christopher Cordahi

Hi Peter,

any thoughts on this. Do you want me to go ahead and pick this
series up?

Andi

On Mon, Jun 17, 2024 at 02:08:15PM GMT, Bastien Curutchet wrote:
> Hi all,
> 
> The i2c-gpio-mux can be used to describe a multiplexer built upon
> several i2c isolators having an enable pin (such as LTC4310):
> 
>  +---------------+                     +------+  +------+
>  | +-----------+ |                     | dev  |  | dev  |
>  | | GPIO_EN_A |-|-----------|         +------+  +------+
>  | +-----------+ |     +-----+---+         |         |
>  |               |  |--| isol. A |---------+---------+
>  |     +-----+   |  |  +---------+
>  | SOC | I2C |---|--|
>  |     +-----+   |  |  +---------+
>  |               |  |--| isol. B |------+---------+---------+
>  | +-----------+ |     +-----+---+      |         |         |
>  | | GPIO_EN_B |-|-----------|      +------+  +------+  +------+
>  | +-----------+ |                  | dev  |  | dev  |  | dev  |
>  +---------------+                  +------+  +------+  +------+
> 
> These isolators often need some time between their enable pin's
> assertion and the first i2c transfer. If the first i2c transfer
> happens before this enabling time is reached, transfer fails.
> 
> There is no available option to configure such a time in the
> i2c-gpio-mux driver.
> 
> Add a optional property in the bindings called 'transition-delay-us'.
> If present, driver waits for this delay every time a new bus is
> selected, i.e. before returning from the bus_select() callback.
> 
> Changes in v2:
>  * Rewrite bindings' commit log
>  * Express the 'transition delay' in us instead of ms
> 
> Changes in v3:
>  * Rename DT property to 'settle-time-us'
>  * Use fsleep instead of udelay
> 
> [v1] : https://lore.kernel.org/all/20240527113908.127893-1-bastien.curutchet@bootlin.com/
> [v2] : https://lore.kernel.org/all/20240529091739.10808-1-bastien.curutchet@bootlin.com/
> 
> Bastien Curutchet (3):
>   dt-bindings: i2c: gpio: Add 'settle-time-us' property
>   i2c: mux: gpio: Re-order #include to match alphabetic order
>   i2c: mux: gpio: Add support for the 'settle-time-us' property
> 
>  .../devicetree/bindings/i2c/i2c-mux-gpio.yaml      |  3 +++
>  drivers/i2c/muxes/i2c-mux-gpio.c                   | 14 ++++++++++----
>  include/linux/platform_data/i2c-mux-gpio.h         |  2 ++
>  3 files changed, 15 insertions(+), 4 deletions(-)
> 
> -- 
> 2.45.0
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: i2c: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
  2024-06-17 12:19   ` Krzysztof Kozlowski
  2024-07-09 21:42   ` Andi Shyti
@ 2024-07-10  8:01   ` Peter Rosin
  2024-07-12  7:00   ` Wolfram Sang
  3 siblings, 0 replies; 17+ messages in thread
From: Peter Rosin @ 2024-07-10  8:01 UTC (permalink / raw)
  To: Bastien Curutchet, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi

2024-06-17 at 14:08, Bastien Curutchet wrote:
> I2C MUXes described by the i2c-gpio-mux sometimes need a significant
> amount of time to switch from a bus to another. When a new bus is
> selected, the first I2C transfer can fail if it occurs too early. There
> is no way to describe this transition delay that has to be waited before
> starting the first I2C transfer.
> 
> Add a 'settle-time-us' property that indicates the delay to be
> respected before doing the first i2c transfer.
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>

Acked-by: Peter Rosin <peda@axentia.se>

Cheers,
Peter

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order
  2024-06-17 12:08 ` [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order Bastien Curutchet
  2024-07-09 21:42   ` Andi Shyti
@ 2024-07-10  8:02   ` Peter Rosin
  1 sibling, 0 replies; 17+ messages in thread
From: Peter Rosin @ 2024-07-10  8:02 UTC (permalink / raw)
  To: Bastien Curutchet, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi

2024-06-17 at 14:08, Bastien Curutchet wrote:
> The #includes don't match alphabetic order.
> 
> Re-order #includes to match the alphabetic order before adding a new
> one.
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>

Acked-by: Peter Rosin <peda@axentia.se>

Cheers,
Peter


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property
  2024-06-17 12:08 ` [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property Bastien Curutchet
  2024-07-09 21:43   ` Andi Shyti
@ 2024-07-10  8:02   ` Peter Rosin
  2024-07-12  6:58   ` Wolfram Sang
  2 siblings, 0 replies; 17+ messages in thread
From: Peter Rosin @ 2024-07-10  8:02 UTC (permalink / raw)
  To: Bastien Curutchet, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang
  Cc: linux-i2c, devicetree, linux-kernel, Thomas Petazzoni,
	Herve Codina, Christopher Cordahi

2024-06-17 at 14:08, 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 'settle-time-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>

Acked-by: Peter Rosin <peda@axentia.se>

Cheers,
Peter


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property
  2024-07-09 21:45 ` Andi Shyti
@ 2024-07-10  8:04   ` Peter Rosin
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Rosin @ 2024-07-10  8:04 UTC (permalink / raw)
  To: Andi Shyti, Bastien Curutchet
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Korsgaard,
	Wolfram Sang, linux-i2c, devicetree, linux-kernel,
	Thomas Petazzoni, Herve Codina, Christopher Cordahi

Hi Andi!

2024-07-09 at 23:45, Andi Shyti wrote:
> Hi Peter,
> 
> any thoughts on this. Do you want me to go ahead and pick this

Looks mighty fine to me, please pick it up. And sorry to all for
being unresponsive.

Cheers,
Peter

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property
  2024-06-17 12:08 ` [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property Bastien Curutchet
  2024-07-09 21:43   ` Andi Shyti
  2024-07-10  8:02   ` Peter Rosin
@ 2024-07-12  6:58   ` Wolfram Sang
  2 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2024-07-12  6:58 UTC (permalink / raw)
  To: Bastien Curutchet
  Cc: Peter Rosin, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang, linux-i2c,
	devicetree, linux-kernel, Thomas Petazzoni, Herve Codina,
	Christopher Cordahi

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

Hi Andi,

> +	int settle_time;

Could you change this to u32 when applying?

Sorry for being late... if you already applied this, I can send an
incremental patch.

Happy hacking,

   Wolfram


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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: i2c: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
                     ` (2 preceding siblings ...)
  2024-07-10  8:01   ` Peter Rosin
@ 2024-07-12  7:00   ` Wolfram Sang
  3 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2024-07-12  7:00 UTC (permalink / raw)
  To: Bastien Curutchet
  Cc: Peter Rosin, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Korsgaard, Wolfram Sang, linux-i2c,
	devicetree, linux-kernel, Thomas Petazzoni, Herve Codina,
	Christopher Cordahi

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


$subject should be "mux-gpio" instead of just "gpio". It could be mixed
up with the i2c-gpio controller driver otherwise.


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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property
  2024-06-17 12:08 [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property Bastien Curutchet
                   ` (4 preceding siblings ...)
  2024-07-09 21:45 ` Andi Shyti
@ 2024-07-16 18:28 ` Andi Shyti
  5 siblings, 0 replies; 17+ messages in thread
From: Andi Shyti @ 2024-07-16 18:28 UTC (permalink / raw)
  To: Bastien Curutchet
  Cc: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Korsgaard, Wolfram Sang, linux-i2c, devicetree,
	linux-kernel, Thomas Petazzoni, Herve Codina, Christopher Cordahi

Hi Bastien,

with:

 - commit log fixed (gpio/mux-gpio)
 - int/u32 changed

applied to i2c/i2c-host

Thanks,
Andi

On Mon, Jun 17, 2024 at 02:08:15PM GMT, Bastien Curutchet wrote:
> Hi all,
> 
> The i2c-gpio-mux can be used to describe a multiplexer built upon
> several i2c isolators having an enable pin (such as LTC4310):
> 
>  +---------------+                     +------+  +------+
>  | +-----------+ |                     | dev  |  | dev  |
>  | | GPIO_EN_A |-|-----------|         +------+  +------+
>  | +-----------+ |     +-----+---+         |         |
>  |               |  |--| isol. A |---------+---------+
>  |     +-----+   |  |  +---------+
>  | SOC | I2C |---|--|
>  |     +-----+   |  |  +---------+
>  |               |  |--| isol. B |------+---------+---------+
>  | +-----------+ |     +-----+---+      |         |         |
>  | | GPIO_EN_B |-|-----------|      +------+  +------+  +------+
>  | +-----------+ |                  | dev  |  | dev  |  | dev  |
>  +---------------+                  +------+  +------+  +------+
> 
> These isolators often need some time between their enable pin's
> assertion and the first i2c transfer. If the first i2c transfer
> happens before this enabling time is reached, transfer fails.
> 
> There is no available option to configure such a time in the
> i2c-gpio-mux driver.
> 
> Add a optional property in the bindings called 'transition-delay-us'.
> If present, driver waits for this delay every time a new bus is
> selected, i.e. before returning from the bus_select() callback.
> 
> Changes in v2:
>  * Rewrite bindings' commit log
>  * Express the 'transition delay' in us instead of ms
> 
> Changes in v3:
>  * Rename DT property to 'settle-time-us'
>  * Use fsleep instead of udelay
> 
> [v1] : https://lore.kernel.org/all/20240527113908.127893-1-bastien.curutchet@bootlin.com/
> [v2] : https://lore.kernel.org/all/20240529091739.10808-1-bastien.curutchet@bootlin.com/
> 
> Bastien Curutchet (3):
>   dt-bindings: i2c: gpio: Add 'settle-time-us' property
>   i2c: mux: gpio: Re-order #include to match alphabetic order
>   i2c: mux: gpio: Add support for the 'settle-time-us' property
> 
>  .../devicetree/bindings/i2c/i2c-mux-gpio.yaml      |  3 +++
>  drivers/i2c/muxes/i2c-mux-gpio.c                   | 14 ++++++++++----
>  include/linux/platform_data/i2c-mux-gpio.h         |  2 ++
>  3 files changed, 15 insertions(+), 4 deletions(-)
> 
> -- 
> 2.45.0
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-07-16 18:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17 12:08 [PATCH v3 0/3] i2c: mux: gpio: Add 'settle-time-us' property Bastien Curutchet
2024-06-17 12:08 ` [PATCH v3 1/3] dt-bindings: i2c: " Bastien Curutchet
2024-06-17 12:19   ` Krzysztof Kozlowski
2024-07-09 21:42   ` Andi Shyti
2024-07-10  8:01   ` Peter Rosin
2024-07-12  7:00   ` Wolfram Sang
2024-06-17 12:08 ` [PATCH v3 2/3] i2c: mux: gpio: Re-order #include to match alphabetic order Bastien Curutchet
2024-07-09 21:42   ` Andi Shyti
2024-07-10  8:02   ` Peter Rosin
2024-06-17 12:08 ` [PATCH v3 3/3] i2c: mux: gpio: Add support for the 'settle-time-us' property Bastien Curutchet
2024-07-09 21:43   ` Andi Shyti
2024-07-10  8:02   ` Peter Rosin
2024-07-12  6:58   ` Wolfram Sang
2024-07-03  9:35 ` [PATCH v3 0/3] i2c: mux: gpio: Add " Bastien Curutchet
2024-07-09 21:45 ` Andi Shyti
2024-07-10  8:04   ` Peter Rosin
2024-07-16 18:28 ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).