summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/mux/gpio-mux.txt
blob: b8f746344d801bd091e10389b46916e441453698 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
GPIO-based multiplexer controller bindings

Define what GPIO pins are used to control a multiplexer. Or several
multiplexers, if the same pins control more than one multiplexer.

Required properties:
- compatible : "gpio-mux"
- mux-gpios : list of gpios used to control the multiplexer, least
	      significant bit first.
- #mux-control-cells : <0>
* Standard mux-controller bindings as decribed in mux-controller.txt

Optional properties:
- idle-state : if present, the state the mux will have when idle. The
	       special state MUX_IDLE_AS_IS is the default.

The multiplexer state is defined as the number represented by the
multiplexer GPIO pins, where the first pin is the least significant
bit. An active pin is a binary 1, an inactive pin is a binary 0.

Example:

	mux: mux-controller {
		compatible = "gpio-mux";
		#mux-control-cells = <0>;

		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
			    <&pioA 1 GPIO_ACTIVE_HIGH>;
	};

	adc-mux {
		compatible = "io-channel-mux";
		io-channels = <&adc 0>;
		io-channel-names = "parent";

		mux-controls = <&mux>;

		channels = "sync-1", "in", "out", "sync-2";
	};

	i2c-mux {
		compatible = "i2c-mux";
		i2c-parent = <&i2c1>;

		mux-controls = <&mux>;

		#address-cells = <1>;
		#size-cells = <0>;

		i2c@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;

			ssd1307: oled@3c {
				/* ... */
			};
		};

		i2c@3 {
			reg = <3>;
			#address-cells = <1>;
			#size-cells = <0>;

			pca9555: pca9555@20 {
				/* ... */
			};
		};
	};