Everything is now merged into the normal Pi kernel. None of the interim files referenced in the discussion are now needed.
EDIT 11/5/2016
As other i2c muxes have been added to the 4.4 kernel, one generic overlay has been created rather than specific ones for individual chips.
The overlay command is now:
Code: Select all
dtoverlay=i2c-mux,pca9548,addr=0x70
Support is now present for pca9542 (2 channel), pca9545 (4 channel), and pca9548 (8 channel) muxes.
Original post left below for reference.
---------------
Following on from discussions on viewtopic.php?f=44&t=140054 I've had a play with the kernel support for I2C multiplexers, mainly the NXP PCA9548A. People such as Adafruit sell it neatly mounted up. It turns out it works surprisingly well.
I've just created a pull request for support to be merged into the main kernel, and it includes a device tree overlay to load it easily.
Add
Code: Select all
dtoverlay=i2c-mux-pca9548a
Code: Select all
pi@raspberrypi:/ $ ls /dev/i2c*
/dev/i2c-1 /dev/i2c-10 /dev/i2c-3 /dev/i2c-4 /dev/i2c-5 /dev/i2c-6 /dev/i2c-7 /dev/i2c-8 /dev/i2c-9
Another useful feature is that the muxed ports are all 5V tolerant, so it will also act as an I2C level shifter into the bargain.
If you're wanting to try it out before it hits the main tree then I've pushed the modules to https://github.com/6by9/RPiTest/tree/master/i2c-mux. The commit text tells you where to copy files to. Please note that those files are for 4.4.6, so you'll need to have done a "sudo BRANCH=next rpi-update" for them to be appropriate. I rpi-update'd early this evening, so it should work against 7e9f1ca7629d765111bd7b0c31ebdc056ef17656.
I hope it's of use to some people who are trying to use multiple identical devices, and it's much easier than making userspace take control of the mux.