[U-Boot] [PATCH v2 03/19] dm: i2c: Add support for multiplexed I2C buses
Simon Glass
sjg at chromium.org
Sun Aug 9 15:39:49 CEST 2015
On 3 August 2015 at 08:19, Simon Glass <sjg at chromium.org> wrote:
> 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 at chromium.org>
> ---
>
> Changes in v2:
> - Update commit message and header file to better explain select()/deselect()
>
> doc/device-tree-bindings/i2c/i2c-mux.txt | 60 ++++++++++
> drivers/i2c/Kconfig | 2 +
> drivers/i2c/Makefile | 2 +
> drivers/i2c/muxes/Kconfig | 8 ++
> drivers/i2c/muxes/Makefile | 6 +
> drivers/i2c/muxes/i2c-mux-uclass.c | 198 +++++++++++++++++++++++++++++++
> include/dm/uclass-id.h | 1 +
> include/i2c.h | 39 ++++++
> 8 files changed, 316 insertions(+)
> create mode 100644 doc/device-tree-bindings/i2c/i2c-mux.txt
> create mode 100644 drivers/i2c/muxes/Kconfig
> create mode 100644 drivers/i2c/muxes/Makefile
> create mode 100644 drivers/i2c/muxes/i2c-mux-uclass.c
Applied to u-boot-dm.
More information about the U-Boot
mailing list