Merge commit '81fd23e2b3ccf71c807e671444e8accaba98ca53' of https://git.pengutronix...
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / mux / gpio-mux.yaml
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/mux/gpio-mux.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: GPIO-based multiplexer controller bindings
8
9 maintainers:
10   - Peter Rosin <peda@axentia.se>
11
12 description: |+
13   Define what GPIO pins are used to control a multiplexer. Or several
14   multiplexers, if the same pins control more than one multiplexer.
15
16   The multiplexer state is defined as the number represented by the
17   multiplexer GPIO pins, where the first pin is the least significant
18   bit. An active pin is a binary 1, an inactive pin is a binary 0.
19
20 properties:
21   compatible:
22     const: gpio-mux
23
24   mux-gpios:
25     description:
26       List of gpios used to control the multiplexer, least significant bit first.
27
28   '#mux-control-cells':
29     const: 0
30
31   idle-state:
32     default: -1
33
34 required:
35   - compatible
36   - mux-gpios
37   - "#mux-control-cells"
38
39 additionalProperties: false
40
41 examples:
42   - |
43     #include <dt-bindings/gpio/gpio.h>
44
45     mux: mux-controller {
46         compatible = "gpio-mux";
47         #mux-control-cells = <0>;
48
49         mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
50               <&pioA 1 GPIO_ACTIVE_HIGH>;
51     };
52
53     adc-mux {
54         compatible = "io-channel-mux";
55         io-channels = <&adc 0>;
56         io-channel-names = "parent";
57
58         mux-controls = <&mux>;
59
60         channels = "sync-1", "in", "out", "sync-2";
61     };
62
63     i2c-mux {
64         compatible = "i2c-mux";
65         i2c-parent = <&i2c1>;
66
67         mux-controls = <&mux>;
68
69         #address-cells = <1>;
70         #size-cells = <0>;
71
72         i2c@0 {
73             reg = <0>;
74             #address-cells = <1>;
75             #size-cells = <0>;
76
77             ssd1307: oled@3c {
78                 reg = <0x3c>;
79             };
80         };
81
82         i2c@3 {
83             reg = <3>;
84             #address-cells = <1>;
85             #size-cells = <0>;
86
87             pca9555: pca9555@20 {
88                 reg = <0x20>;
89             };
90         };
91     };
92 ...