public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add support for setting MUX for I2C lines
@ 2025-03-18 10:36 Jayesh Choudhary
  2025-03-18 10:36 ` [PATCH 1/2] dt-bindings: i2c: omap: Add mux-states property Jayesh Choudhary
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jayesh Choudhary @ 2025-03-18 10:36 UTC (permalink / raw)
  To: vigneshr, andi.shyti, robh, krzk+dt, conor+dt, linux-kernel
  Cc: aaro.koskinen, andreas, khilman, rogerq, tony, jmkrzyszt,
	linux-omap, linux-i2c, devicetree, j-choudhary

These 2 patches add support for mux-controller for I2C lines as required
in TI SoC J721S2 for main_i2c3 instance where the I2C lines after coming
out of SoC are routed through a MUX which is controlled by WKUP_GPIO54:

______                     MUX FOR I2C
      | SOM_I2C3_SCL    __ FOR DATA AND CLK LANES
 S    |----------------|  |--------------+-------------+-----I2C3_SCL
 O    |----------------|__|------------+-|-----------+-|-----I2C3_SDA
 M    | SOM_I2C3_SDA    |              | |           | |
______|                 |              | |           | |
                        |              | |           | |
                   WKUP_GPIO0_54     __|_|__       __|_|__
                                    |       |     |       |
                                    |       |     |       |
                                    |_______|     |_______|
                                     TCA6408       PCM3168

Setting GPIO hog for WKUP_GPIO54 is not enough as I2C and TCA6408 drivers
probe before the GPIO is hogged and since the I2C lines are not actually
high, I2C transactions for PCA953X driver fail which in turns result in
deferred probe for other peripherals like audio. I2C recovers after this
failed transaction but PCA953X is not probed again.

We get the following errors:

[...]

[    1.293131] pca953x 2-0020: supply vcc not found, using dummy regulator
[    1.299971] pca953x 2-0020: using no AI
[    1.318993] pca953x 2-0020: failed writing register: -121
[    1.324599] pca953x 2-0020: probe with driver pca953x failed with error -121

[...]

[   21.191584] i2c 2-0044: deferred probe pending: i2c: supplier 2-0020 not ready
[   21.198855] platform sound: deferred probe pending: j721e-audio: devm_snd_soc_register_card() failed: -517

So add mux-control in I2C driver to defer the I2C probe till WKUP_GPIO54 is
hogged to desired state and then continue with I2C probe.

Jayesh Choudhary (2):
  dt-bindings: i2c: omap: Add mux-states property
  i2c: omap: Add support for setting mux

 .../devicetree/bindings/i2c/ti,omap4-i2c.yaml |  6 +++++
 drivers/i2c/busses/Kconfig                    |  1 +
 drivers/i2c/busses/i2c-omap.c                 | 22 +++++++++++++++++++
 3 files changed, 29 insertions(+)

-- 
2.34.1


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

end of thread, other threads:[~2025-03-19 11:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-18 10:36 [PATCH 0/2] Add support for setting MUX for I2C lines Jayesh Choudhary
2025-03-18 10:36 ` [PATCH 1/2] dt-bindings: i2c: omap: Add mux-states property Jayesh Choudhary
2025-03-18 19:55   ` Ing. Josua Mayer
2025-03-18 22:18     ` Rob Herring
2025-03-19 11:32       ` Andreas Kemnade
2025-03-18 22:19   ` Rob Herring
2025-03-18 10:36 ` [PATCH 2/2] i2c: omap: Add support for setting mux Jayesh Choudhary
2025-03-19 10:11 ` [PATCH 0/2] Add support for setting MUX for I2C lines Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox