[PATCH v3 0/7] Add Mule I2C multiplexer support
Wolfram Sang
wsa+renesas at sang-engineering.com
Tue Jun 11 15:12:59 PDT 2024
Hi Farouk,
first of all, thanks for the patches and tackling this problem. I have
to say that I have many concerns on high-level, though. I hope to be
able to give helpful recommendations.
> Mule is an mcu that emulates a set of I2C devices which are reachable
> through an I2C-mux.
I am not 100% convinced this is really a mux. Another possible DT
representation could be (pseudo-code):
i2c-bus {
mpu at 42 {
comptible = "mule";
reg = <0x42>;
subdev at 0 {
compatible = "subdev"
reg = <0x00>;
}
subdev at 1 {
...
}
}
Dunno if MFD can handle that. Maybe someone else knows?
If all fails, I think you could write an I2C mux-driver which uses the
above DT snippet. It should then do:
- write the mule config register according to 'reg' of the subdev
- replace 'addr' in all 'i2c_msgs' to the addr of the parent mule device
- i2ctransfer
- restore 'addr' in all 'i2c_msgs' to the original addr
A little simiar of what i2c-atr.c does, check
Documentation/i2c/i2c-address-translators.rst
> The emulated devices share a single I2C address with the mux itself
> where the requested register is what determines which logic is executed
> (muxing logic or device logic):
This design is... unfortunate, if you ask me. But well, things happen.
> The current I2C-mux implementation does not allow the mux to use the
> I2C address of a child device. As a workaround, A new I2C-adapter quirk is
> introduced to skip the check for conflict between a child device and the
> mux core I2C address when adding the child device.
Not acceptable, sorry. The adapter itself is fine, so this is clearly
not an adapter quirk. The client is what is quirky. I don't want to
maintain patch 1 because of this one "creative" design of a client. I
think we can handle it outside of the I2C core.
So far understandable?
Happy hacking,
Wolfram
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240612/679f3572/attachment.sig>
More information about the linux-arm-kernel
mailing list