1*c66ec88fSEmmanuel VadotGeneral Purpose I2C Bus Mux 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThis binding describes an I2C bus multiplexer that uses a mux controller 4*c66ec88fSEmmanuel Vadotfrom the mux subsystem to route the I2C signals. 5*c66ec88fSEmmanuel Vadot 6*c66ec88fSEmmanuel Vadot .-----. .-----. 7*c66ec88fSEmmanuel Vadot | dev | | dev | 8*c66ec88fSEmmanuel Vadot .------------. '-----' '-----' 9*c66ec88fSEmmanuel Vadot | SoC | | | 10*c66ec88fSEmmanuel Vadot | | .--------+--------' 11*c66ec88fSEmmanuel Vadot | .------. | .------+ child bus A, on MUX value set to 0 12*c66ec88fSEmmanuel Vadot | | I2C |-|--| Mux | 13*c66ec88fSEmmanuel Vadot | '------' | '--+---+ child bus B, on MUX value set to 1 14*c66ec88fSEmmanuel Vadot | .------. | | '----------+--------+--------. 15*c66ec88fSEmmanuel Vadot | | MUX- | | | | | | 16*c66ec88fSEmmanuel Vadot | | Ctrl |-|-----+ .-----. .-----. .-----. 17*c66ec88fSEmmanuel Vadot | '------' | | dev | | dev | | dev | 18*c66ec88fSEmmanuel Vadot '------------' '-----' '-----' '-----' 19*c66ec88fSEmmanuel Vadot 20*c66ec88fSEmmanuel VadotRequired properties: 21*c66ec88fSEmmanuel Vadot- compatible: i2c-mux 22*c66ec88fSEmmanuel Vadot- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side 23*c66ec88fSEmmanuel Vadot port is connected to. 24*c66ec88fSEmmanuel Vadot- mux-controls: The phandle of the mux controller to use for operating the 25*c66ec88fSEmmanuel Vadot mux. 26*c66ec88fSEmmanuel Vadot* Standard I2C mux properties. See i2c-mux.txt in this directory. 27*c66ec88fSEmmanuel Vadot* I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number 28*c66ec88fSEmmanuel Vadot is also the mux-controller state described in ../mux/mux-controller.txt 29*c66ec88fSEmmanuel Vadot 30*c66ec88fSEmmanuel VadotOptional properties: 31*c66ec88fSEmmanuel Vadot- mux-locked: If present, explicitly allow unrelated I2C transactions on the 32*c66ec88fSEmmanuel Vadot parent I2C adapter at these times: 33*c66ec88fSEmmanuel Vadot + during setup of the multiplexer 34*c66ec88fSEmmanuel Vadot + between setup of the multiplexer and the child bus I2C transaction 35*c66ec88fSEmmanuel Vadot + between the child bus I2C transaction and releasing of the multiplexer 36*c66ec88fSEmmanuel Vadot + during releasing of the multiplexer 37*c66ec88fSEmmanuel Vadot However, I2C transactions to devices behind all I2C multiplexers connected 38*c66ec88fSEmmanuel Vadot to the same parent adapter that this multiplexer is connected to are blocked 39*c66ec88fSEmmanuel Vadot for the full duration of the complete multiplexed I2C transaction (i.e. 40*c66ec88fSEmmanuel Vadot including the times covered by the above list). 41*c66ec88fSEmmanuel Vadot If mux-locked is not present, the multiplexer is assumed to be parent-locked. 42*c66ec88fSEmmanuel Vadot This means that no unrelated I2C transactions are allowed on the parent I2C 43*c66ec88fSEmmanuel Vadot adapter for the complete multiplexed I2C transaction. 44*c66ec88fSEmmanuel Vadot The properties of mux-locked and parent-locked multiplexers are discussed 45*c66ec88fSEmmanuel Vadot in more detail in Documentation/i2c/i2c-topology.rst. 46*c66ec88fSEmmanuel Vadot 47*c66ec88fSEmmanuel VadotFor each i2c child node, an I2C child bus will be created. They will 48*c66ec88fSEmmanuel Vadotbe numbered based on their order in the device tree. 49*c66ec88fSEmmanuel Vadot 50*c66ec88fSEmmanuel VadotWhenever an access is made to a device on a child bus, the value set 51*c66ec88fSEmmanuel Vadotin the relevant node's reg property will be set as the state in the 52*c66ec88fSEmmanuel Vadotmux controller. 53*c66ec88fSEmmanuel Vadot 54*c66ec88fSEmmanuel VadotExample: 55*c66ec88fSEmmanuel Vadot mux: mux-controller { 56*c66ec88fSEmmanuel Vadot compatible = "gpio-mux"; 57*c66ec88fSEmmanuel Vadot #mux-control-cells = <0>; 58*c66ec88fSEmmanuel Vadot 59*c66ec88fSEmmanuel Vadot mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>, 60*c66ec88fSEmmanuel Vadot <&pioA 1 GPIO_ACTIVE_HIGH>; 61*c66ec88fSEmmanuel Vadot }; 62*c66ec88fSEmmanuel Vadot 63*c66ec88fSEmmanuel Vadot i2c-mux { 64*c66ec88fSEmmanuel Vadot compatible = "i2c-mux"; 65*c66ec88fSEmmanuel Vadot mux-locked; 66*c66ec88fSEmmanuel Vadot i2c-parent = <&i2c1>; 67*c66ec88fSEmmanuel Vadot 68*c66ec88fSEmmanuel Vadot mux-controls = <&mux>; 69*c66ec88fSEmmanuel Vadot 70*c66ec88fSEmmanuel Vadot #address-cells = <1>; 71*c66ec88fSEmmanuel Vadot #size-cells = <0>; 72*c66ec88fSEmmanuel Vadot 73*c66ec88fSEmmanuel Vadot i2c@1 { 74*c66ec88fSEmmanuel Vadot reg = <1>; 75*c66ec88fSEmmanuel Vadot #address-cells = <1>; 76*c66ec88fSEmmanuel Vadot #size-cells = <0>; 77*c66ec88fSEmmanuel Vadot 78*c66ec88fSEmmanuel Vadot ssd1307: oled@3c { 79*c66ec88fSEmmanuel Vadot compatible = "solomon,ssd1307fb-i2c"; 80*c66ec88fSEmmanuel Vadot reg = <0x3c>; 81*c66ec88fSEmmanuel Vadot pwms = <&pwm 4 3000>; 82*c66ec88fSEmmanuel Vadot reset-gpios = <&gpio2 7 1>; 83*c66ec88fSEmmanuel Vadot reset-active-low; 84*c66ec88fSEmmanuel Vadot }; 85*c66ec88fSEmmanuel Vadot }; 86*c66ec88fSEmmanuel Vadot 87*c66ec88fSEmmanuel Vadot i2c@3 { 88*c66ec88fSEmmanuel Vadot reg = <3>; 89*c66ec88fSEmmanuel Vadot #address-cells = <1>; 90*c66ec88fSEmmanuel Vadot #size-cells = <0>; 91*c66ec88fSEmmanuel Vadot 92*c66ec88fSEmmanuel Vadot pca9555: pca9555@20 { 93*c66ec88fSEmmanuel Vadot compatible = "nxp,pca9555"; 94*c66ec88fSEmmanuel Vadot gpio-controller; 95*c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 96*c66ec88fSEmmanuel Vadot reg = <0x20>; 97*c66ec88fSEmmanuel Vadot }; 98*c66ec88fSEmmanuel Vadot }; 99*c66ec88fSEmmanuel Vadot }; 100