xref: /openbmc/linux/Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt (revision b3fdd32799d834e2626fae087906e886037350c6)
1*b3fdd327SYork SunRegister-based I2C Bus Mux
2*b3fdd327SYork Sun
3*b3fdd327SYork SunThis binding describes an I2C bus multiplexer that uses a single register
4*b3fdd327SYork Sunto route the I2C signals.
5*b3fdd327SYork Sun
6*b3fdd327SYork SunRequired properties:
7*b3fdd327SYork Sun- compatible: i2c-mux-reg
8*b3fdd327SYork Sun- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
9*b3fdd327SYork Sun  port is connected to.
10*b3fdd327SYork Sun* Standard I2C mux properties. See mux.txt in this directory.
11*b3fdd327SYork Sun* I2C child bus nodes. See mux.txt in this directory.
12*b3fdd327SYork Sun
13*b3fdd327SYork SunOptional properties:
14*b3fdd327SYork Sun- reg: this pair of <offset size> specifies the register to control the mux.
15*b3fdd327SYork Sun  The <offset size> depends on its parent node. It can be any memory-mapped
16*b3fdd327SYork Sun  address. The size must be either 1, 2, or 4 bytes. If reg is omitted, the
17*b3fdd327SYork Sun  resource of this device will be used.
18*b3fdd327SYork Sun- little-endian: The existence indicates the register is in little endian.
19*b3fdd327SYork Sun- big-endian: The existence indicates the register is in big endian.
20*b3fdd327SYork Sun  If both little-endian and big-endian are omitted, the endianness of the
21*b3fdd327SYork Sun  CPU will be used.
22*b3fdd327SYork Sun- write-only: The existence indicates the register is write-only.
23*b3fdd327SYork Sun- idle-state: value to set the muxer to when idle. When no value is
24*b3fdd327SYork Sun  given, it defaults to the last value used.
25*b3fdd327SYork Sun
26*b3fdd327SYork SunWhenever an access is made to a device on a child bus, the value set
27*b3fdd327SYork Sunin the revelant node's reg property will be output to the register.
28*b3fdd327SYork Sun
29*b3fdd327SYork SunIf an idle state is defined, using the idle-state (optional) property,
30*b3fdd327SYork Sunwhenever an access is not being made to a device on a child bus, the
31*b3fdd327SYork Sunregister will be set according to the idle value.
32*b3fdd327SYork Sun
33*b3fdd327SYork SunIf an idle state is not defined, the most recently used value will be
34*b3fdd327SYork Sunleft programmed into the register.
35*b3fdd327SYork Sun
36*b3fdd327SYork SunExample of a mux on PCIe card, the host is a powerpc SoC (big endian):
37*b3fdd327SYork Sun
38*b3fdd327SYork Sun	i2c-mux {
39*b3fdd327SYork Sun		/* the <offset size> depends on the address translation
40*b3fdd327SYork Sun		 * of the parent device. If omitted, device resource
41*b3fdd327SYork Sun		 * will be used instead. The size is to determine
42*b3fdd327SYork Sun		 * whether iowrite32, iowrite16, or iowrite8 will be used.
43*b3fdd327SYork Sun		 */
44*b3fdd327SYork Sun		reg = <0x6028 0x4>;
45*b3fdd327SYork Sun		little-endian;		/* little endian register on PCIe */
46*b3fdd327SYork Sun		compatible = "i2c-mux-reg";
47*b3fdd327SYork Sun		#address-cells = <1>;
48*b3fdd327SYork Sun		#size-cells = <0>;
49*b3fdd327SYork Sun		i2c-parent = <&i2c1>;
50*b3fdd327SYork Sun		i2c@0 {
51*b3fdd327SYork Sun			reg = <0>;
52*b3fdd327SYork Sun			#address-cells = <1>;
53*b3fdd327SYork Sun			#size-cells = <0>;
54*b3fdd327SYork Sun
55*b3fdd327SYork Sun			si5338: clock-generator@70 {
56*b3fdd327SYork Sun				compatible = "silabs,si5338";
57*b3fdd327SYork Sun				reg = <0x70>;
58*b3fdd327SYork Sun				/* other stuff */
59*b3fdd327SYork Sun			};
60*b3fdd327SYork Sun		};
61*b3fdd327SYork Sun
62*b3fdd327SYork Sun		i2c@1 {
63*b3fdd327SYork Sun			/* data is written using iowrite32 */
64*b3fdd327SYork Sun			reg = <1>;
65*b3fdd327SYork Sun			#address-cells = <1>;
66*b3fdd327SYork Sun			#size-cells = <0>;
67*b3fdd327SYork Sun
68*b3fdd327SYork Sun			si5338: clock-generator@70 {
69*b3fdd327SYork Sun				compatible = "silabs,si5338";
70*b3fdd327SYork Sun				reg = <0x70>;
71*b3fdd327SYork Sun				/* other stuff */
72*b3fdd327SYork Sun			};
73*b3fdd327SYork Sun		};
74*b3fdd327SYork Sun	};
75