xref: /freebsd/sys/contrib/device-tree/Bindings/i2c/i2c-mux-pinctrl.txt (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1Pinctrl-based I2C Bus Mux
2
3This binding describes an I2C bus multiplexer that uses pin multiplexing to
4route the I2C signals, and represents the pin multiplexing configuration
5using the pinctrl device tree bindings.
6
7                                 +-----+  +-----+
8                                 | dev |  | dev |
9    +------------------------+   +-----+  +-----+
10    | SoC                    |      |        |
11    |                   /----|------+--------+
12    |   +---+   +------+     | child bus A, on first set of pins
13    |   |I2C|---|Pinmux|     |
14    |   +---+   +------+     | child bus B, on second set of pins
15    |                   \----|------+--------+--------+
16    |                        |      |        |        |
17    +------------------------+  +-----+  +-----+  +-----+
18                                | dev |  | dev |  | dev |
19                                +-----+  +-----+  +-----+
20
21Required properties:
22- compatible: i2c-mux-pinctrl
23- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
24  port is connected to.
25
26Also required are:
27
28* Standard pinctrl properties that specify the pin mux state for each child
29  bus. See ../pinctrl/pinctrl-bindings.txt.
30
31* Standard I2C mux properties. See i2c-mux.yaml in this directory.
32
33* I2C child bus nodes. See i2c-mux.yaml in this directory.
34
35For each named state defined in the pinctrl-names property, an I2C child bus
36will be created. I2C child bus numbers are assigned based on the index into
37the pinctrl-names property.
38
39The only exception is that no bus will be created for a state named "idle". If
40such a state is defined, it must be the last entry in pinctrl-names. For
41example:
42
43	pinctrl-names = "ddc", "pta", "idle"  ->  ddc = bus 0, pta = bus 1
44	pinctrl-names = "ddc", "idle", "pta"  ->  Invalid ("idle" not last)
45	pinctrl-names = "idle", "ddc", "pta"  ->  Invalid ("idle" not last)
46
47Whenever an access is made to a device on a child bus, the relevant pinctrl
48state will be programmed into hardware.
49
50If an idle state is defined, whenever an access is not being made to a device
51on a child bus, the idle pinctrl state will be programmed into hardware.
52
53If an idle state is not defined, the most recently used pinctrl state will be
54left programmed into hardware whenever no access is being made of a device on
55a child bus.
56
57Example:
58
59	i2cmux {
60		compatible = "i2c-mux-pinctrl";
61		#address-cells = <1>;
62		#size-cells = <0>;
63
64		i2c-parent = <&i2c1>;
65
66		pinctrl-names = "ddc", "pta", "idle";
67		pinctrl-0 = <&state_i2cmux_ddc>;
68		pinctrl-1 = <&state_i2cmux_pta>;
69		pinctrl-2 = <&state_i2cmux_idle>;
70
71		i2c@0 {
72			reg = <0>;
73			#address-cells = <1>;
74			#size-cells = <0>;
75
76			eeprom {
77				compatible = "eeprom";
78				reg = <0x50>;
79			};
80		};
81
82		i2c@1 {
83			reg = <1>;
84			#address-cells = <1>;
85			#size-cells = <0>;
86
87			eeprom {
88				compatible = "eeprom";
89				reg = <0x50>;
90			};
91		};
92	};
93
94