xref: /freebsd-src/sys/contrib/device-tree/Bindings/i2c/i2c-mux.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotCommon i2c bus multiplexer/switch properties.
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotAn i2c bus multiplexer/switch will have several child busses that are
4*c66ec88fSEmmanuel Vadotnumbered uniquely in a device dependent manner.  The nodes for an i2c bus
5*c66ec88fSEmmanuel Vadotmultiplexer/switch will have one child node for each child bus.
6*c66ec88fSEmmanuel Vadot
7*c66ec88fSEmmanuel VadotOptional properties:
8*c66ec88fSEmmanuel Vadot- #address-cells = <1>;
9*c66ec88fSEmmanuel Vadot   This property is required if the i2c-mux child node does not exist.
10*c66ec88fSEmmanuel Vadot
11*c66ec88fSEmmanuel Vadot- #size-cells = <0>;
12*c66ec88fSEmmanuel Vadot   This property is required if the i2c-mux child node does not exist.
13*c66ec88fSEmmanuel Vadot
14*c66ec88fSEmmanuel Vadot- i2c-mux
15*c66ec88fSEmmanuel Vadot   For i2c multiplexers/switches that have child nodes that are a mixture
16*c66ec88fSEmmanuel Vadot   of both i2c child busses and other child nodes, the 'i2c-mux' subnode
17*c66ec88fSEmmanuel Vadot   can be used for populating the i2c child busses.  If an 'i2c-mux'
18*c66ec88fSEmmanuel Vadot   subnode is present, only subnodes of this will be considered as i2c
19*c66ec88fSEmmanuel Vadot   child busses.
20*c66ec88fSEmmanuel Vadot
21*c66ec88fSEmmanuel VadotRequired properties for the i2c-mux child node:
22*c66ec88fSEmmanuel Vadot- #address-cells = <1>;
23*c66ec88fSEmmanuel Vadot- #size-cells = <0>;
24*c66ec88fSEmmanuel Vadot
25*c66ec88fSEmmanuel VadotRequired properties for i2c child bus nodes:
26*c66ec88fSEmmanuel Vadot- #address-cells = <1>;
27*c66ec88fSEmmanuel Vadot- #size-cells = <0>;
28*c66ec88fSEmmanuel Vadot- reg : The sub-bus number.
29*c66ec88fSEmmanuel Vadot
30*c66ec88fSEmmanuel VadotOptional properties for i2c child bus nodes:
31*c66ec88fSEmmanuel Vadot- Other properties specific to the multiplexer/switch hardware.
32*c66ec88fSEmmanuel Vadot- Child nodes conforming to i2c bus binding
33*c66ec88fSEmmanuel Vadot
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel VadotExample :
36*c66ec88fSEmmanuel Vadot
37*c66ec88fSEmmanuel Vadot	/*
38*c66ec88fSEmmanuel Vadot	   An NXP pca9548 8 channel I2C multiplexer at address 0x70
39*c66ec88fSEmmanuel Vadot	   with two NXP pca8574 GPIO expanders attached, one each to
40*c66ec88fSEmmanuel Vadot	   ports 3 and 4.
41*c66ec88fSEmmanuel Vadot	 */
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot	mux@70 {
44*c66ec88fSEmmanuel Vadot		compatible = "nxp,pca9548";
45*c66ec88fSEmmanuel Vadot		reg = <0x70>;
46*c66ec88fSEmmanuel Vadot		#address-cells = <1>;
47*c66ec88fSEmmanuel Vadot		#size-cells = <0>;
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel Vadot		i2c@3 {
50*c66ec88fSEmmanuel Vadot			#address-cells = <1>;
51*c66ec88fSEmmanuel Vadot			#size-cells = <0>;
52*c66ec88fSEmmanuel Vadot			reg = <3>;
53*c66ec88fSEmmanuel Vadot
54*c66ec88fSEmmanuel Vadot			gpio1: gpio@38 {
55*c66ec88fSEmmanuel Vadot				compatible = "nxp,pca8574";
56*c66ec88fSEmmanuel Vadot				reg = <0x38>;
57*c66ec88fSEmmanuel Vadot				#gpio-cells = <2>;
58*c66ec88fSEmmanuel Vadot				gpio-controller;
59*c66ec88fSEmmanuel Vadot			};
60*c66ec88fSEmmanuel Vadot		};
61*c66ec88fSEmmanuel Vadot		i2c@4 {
62*c66ec88fSEmmanuel Vadot			#address-cells = <1>;
63*c66ec88fSEmmanuel Vadot			#size-cells = <0>;
64*c66ec88fSEmmanuel Vadot			reg = <4>;
65*c66ec88fSEmmanuel Vadot
66*c66ec88fSEmmanuel Vadot			gpio2: gpio@38 {
67*c66ec88fSEmmanuel Vadot				compatible = "nxp,pca8574";
68*c66ec88fSEmmanuel Vadot				reg = <0x38>;
69*c66ec88fSEmmanuel Vadot				#gpio-cells = <2>;
70*c66ec88fSEmmanuel Vadot				gpio-controller;
71*c66ec88fSEmmanuel Vadot			};
72*c66ec88fSEmmanuel Vadot		};
73*c66ec88fSEmmanuel Vadot	};
74