[PATCH 0/2] Add support for setting MUX for I2C lines

Jayesh Choudhary
2025-03-18T10:36:54Z

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