Path: blob/master/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
26307 views
# SPDX-License-Identifier: GPL-2.01%YAML 1.22---3$id: http://devicetree.org/schemas/i2c/i2c-mux-gpmux.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: General Purpose I2C Bus Mux78maintainers:9- Peter Rosin <peda@axentia.se>1011description: |+12This binding describes an I2C bus multiplexer that uses a mux controller13from the mux subsystem to route the I2C signals.1415.-----. .-----.16| dev | | dev |17.------------. '-----' '-----'18| SoC | | |19| | .--------+--------'20| .------. | .------+ child bus A, on MUX value set to 021| | I2C |-|--| Mux |22| '------' | '--+---+ child bus B, on MUX value set to 123| .------. | | '----------+--------+--------.24| | MUX- | | | | | |25| | Ctrl |-|-----+ .-----. .-----. .-----.26| '------' | | dev | | dev | | dev |27'------------' '-----' '-----' '-----'282930allOf:31- $ref: /schemas/i2c/i2c-mux.yaml#3233properties:34compatible:35const: i2c-mux3637i2c-parent:38$ref: /schemas/types.yaml#/definitions/phandle39description:40The phandle of the I2C bus that this multiplexer's master-side port is41connected to.4243mux-controls:44maxItems: 145description:46The mux-controller states are the I2C sub-bus numbers.4748mux-locked:49type: boolean50description: |51Explicitly allow unrelated I2C transactions on the parent I2C adapter at52these times:53- during setup of the multiplexer54- between setup of the multiplexer and the child bus I2C transaction55- between the child bus I2C transaction and releasing of the multiplexer56- during releasing of the multiplexer5758However, I2C transactions to devices behind all I2C multiplexers connected59to the same parent adapter that this multiplexer is connected to are blocked60for the full duration of the complete multiplexed I2C transaction (i.e.61including the times covered by the above list).62If mux-locked is not present, the multiplexer is assumed to be parent-locked.63This means that no unrelated I2C transactions are allowed on the parent I2C64adapter for the complete multiplexed I2C transaction.65The properties of mux-locked and parent-locked multiplexers are discussed66in more detail in Documentation/i2c/i2c-topology.rst.6768required:69- compatible70- i2c-parent71- mux-controls7273unevaluatedProperties: false7475examples:76- |77#include <dt-bindings/gpio/gpio.h>78mux: mux-controller {79compatible = "gpio-mux";80#mux-control-cells = <0>;8182mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,83<&pioA 1 GPIO_ACTIVE_HIGH>;84};8586i2c-mux {87compatible = "i2c-mux";88mux-locked;89i2c-parent = <&i2c1>;9091mux-controls = <&mux>;9293#address-cells = <1>;94#size-cells = <0>;9596i2c@1 {97reg = <1>;98#address-cells = <1>;99#size-cells = <0>;100101gpio@20 {102compatible = "nxp,pca9555";103gpio-controller;104#gpio-cells = <2>;105reg = <0x20>;106};107};108109i2c@3 {110reg = <3>;111#address-cells = <1>;112#size-cells = <0>;113114gpio@20 {115compatible = "nxp,pca9555";116gpio-controller;117#gpio-cells = <2>;118reg = <0x20>;119};120};121};122...123124125