]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
dm: i2c: Add support for multiplexed I2C buses
authorSimon Glass <sjg@chromium.org>
Mon, 3 Aug 2015 14:19:21 +0000 (08:19 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:17:13 +0000 (08:17 +0200)
commitfb367f6a5c5afce0df14d18e1ef537320c30579d
tree3fdb2c1f0aeaaf7267acd38b930cf5084be0c29e
parentdf62b7d8447b1b4f1f93afb337623779398d7e8b
dm: i2c: Add support for multiplexed I2C buses

Add a new I2C_MUX uclass. Devices in this class can multiplex between
several I2C buses, selecting them one at a time for use by the system.
The multiplexing mechanism is left to the driver to decide - it may be
controlled by GPIOs, for example.

The uclass supports only two methods: select() and deselect().

The current mux state is expected to be stored in the mux itself since
it is the only thing that knows how to make things work. The mux can
record the current state and then avoid switching unless it is necessary.
So select() can be skipped if the mux is already in the correct state.
Also deselect() can be made a nop if required.

Signed-off-by: Simon Glass <sjg@chromium.org>
doc/device-tree-bindings/i2c/i2c-mux.txt [new file with mode: 0644]
drivers/i2c/Kconfig
drivers/i2c/Makefile
drivers/i2c/muxes/Kconfig [new file with mode: 0644]
drivers/i2c/muxes/Makefile [new file with mode: 0644]
drivers/i2c/muxes/i2c-mux-uclass.c [new file with mode: 0644]
include/dm/uclass-id.h
include/i2c.h