[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ijj3xp5oacsyhygobi4nynerd6dxgfjxh5uzj6quvzraqrkf7x@eejujooa6odi>
Date: Wed, 12 Jun 2024 00:12:59 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: Farouk Bouabid <farouk.bouabid@...rry.de>
Cc: Peter Rosin <peda@...ntia.se>, Andi Shyti <andi.shyti@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Quentin Schulz <quentin.schulz@...rry.de>,
Heiko Stuebner <heiko@...ech.de>, linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH v3 0/7] Add Mule I2C multiplexer support
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@42 {
comptible = "mule";
reg = <0x42>;
subdev@0 {
compatible = "subdev"
reg = <0x00>;
}
subdev@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
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists