Massi wrote:i have to admit that more than the PCA9548A board, i'd like to put my hands on a couple of PCA9544A boards (since i have 2 separate places where i'd need to split i2c channels
this seems to be even harder to find..
If you look at the
driver source, it claims support for:
* This module supports the PCA954x series of I2C multiplexer/switch chips
* made by Philips Semiconductors.
* This includes the:
* PCA9540, PCA9542, PCA9543, PCA9544, PCA9545, PCA9546, PCA9547
* and PCA9548.
so PCA9544 should work. If there isn't significant impact on board space or price, then take the hit with PCA9548A as at least it is then easy to prototype.
Massi wrote:btw, do you think the "dt approach" will allow to manage at kernel's level multiple multiplexer? (i'm not thinking to nest them

)
In theory, yes. You should be able to create almost any form of tree architecture you fancy with muxes PROVIDED you can access each of the control nodes uniquely. PCA954x devices all have an I2C address of their own, so that has to be uniquely accessible and not collide with your actual I2C device addresses.
Don't ask me to code it into DT, but the following should be possible
Code: Select all
C0 ->
C1 ->
C2 ->
C3 ->
A0 -> PCA9548 (0x77)C4 -> (0x71, 0x72, and 0x77 not available on these ports)
C5 ->
C6 ->
C7 ->
A1 -> (0x71 and 0x72 not available on these ports)
A2 ->
A3 ->
i2c-1 +> PCA9548 (0x71) A4 ->
| A5 ->
| A6 ->
| A7 ->
|
| B0 -> (0x71 and 0x72 not available on these ports)
| B1 ->
| B2 ->
|> PCA9548 (0x72) B3 ->
| B4 ->
| B5 ->
| B6 ->
| B7 ->
+-> Random other devices, but not 0x71 or 0x72.
So you've now got 25 I2C ports available, but addresses 0x71, and 0x72 are not available on any port for your devices, and 0x77 is also used for 9 of the ports (A0 and C0-C7). You could also cascade another PCA9548A onto (eg) A7, also using address 0x77, as A0 and A7 won't both be active at once. How far do you want to push it?!
Don't expect to do that lot via a simple overlay though - it's beyond the complexity level that overlays are aimed at (all node details are effectively hard coded).
NB There is kernel support for GPIO controlled I2C muxes too, so you can change your choice of chip and regain the use of those addresses at the expense of some dedicated GPIO.
If you really want to explore this lot, then do read the kernel docs on it. I've just seen there's even a pinmux based control driver (docs at
http://lxr.free-electrons.com/source/Do ... inctrl.txt), so on a Compute Module you can have the kernel automatically switch i2c1 between pins 2&3 and 44&45 as two apparently independent i2c buses. The GPU already does a similar thing with i2c0 to switch between multiple cameras on the Compute Module.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.