Lines Matching +full:mux +full:- +full:gpios
1 # SPDX-License-Identifier: GPL-2.0
3 ---
4 $id: http://devicetree.org/schemas/mux/mux-controller.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Peter Rosin <peda@axentia.se>
13 A multiplexer (or mux) controller will have one, or several, consumer devices
14 that uses the mux controller. Thus, a mux controller can possibly control
16 multiplexer needed by each consumer, but a single mux controller can of course
19 A mux controller provides a number of states to its consumers, and the state
20 space is a simple zero-based enumeration. I.e. 0-1 for a 2-way multiplexer,
21 0-7 for an 8-way multiplexer, etc.
24 Mux controller nodes
25 --------------------
27 Mux controller nodes must specify the number of cells used for the
28 specifier using the '#mux-control-cells' property.
30 Optionally, mux controller nodes can also specify the state the mux should
31 have when it is idle. The idle-state property is used for this. If the
32 idle-state is not present, the mux controller is typically left as is when
33 it is idle. For multiplexer chips that expose several mux controllers, the
34 idle-state property is an array with one idle state for each mux controller.
36 The special value (-1) may be used to indicate that the mux should be left
38 mux controller chips with more than one mux controller, particularly when
39 there is a need to "step past" a mux controller and set some other idle
40 state for a mux controller with a higher index.
42 Some mux controllers have the ability to disconnect the input/output of the
43 multiplexer. Using this disconnected high-impedance state as the idle state
44 is indicated with idle state (-2).
48 #include <dt-bindings/mux/mux.h>
50 as MUX_IDLE_AS_IS (-1) and MUX_IDLE_DISCONNECT (-2).
52 An example mux controller node look like this (the adg972a chip is a triple
53 4-way multiplexer):
55 mux: mux-controller@50 {
58 #mux-control-cells = <1>;
60 idle-state = <MUX_IDLE_DISCONNECT MUX_IDLE_AS_IS 2>;
65 - properties:
67 pattern: '^mux-controller'
68 - required:
69 - '#mux-control-cells'
73 pattern: '^mux-controller(@.*|-[0-9a-f]+)?$'
75 '#mux-control-cells':
78 idle-state:
80 minimum: -2
82 idle-states:
84 Mux controller nodes can specify the state the mux should have when it is
85 idle. If the idle-state is not present, the mux controller is typically
86 left as is when it is idle. For multiplexer chips that expose several mux
87 controllers, the idle-state property is an array with one idle state for
88 each mux controller.
90 The special value (-1) may be used to indicate that the mux should be left
92 mux controller chips with more than one mux controller, particularly when
93 there is a need to "step past" a mux controller and set some other idle
94 state for a mux controller with a higher index.
96 Some mux controllers have the ability to disconnect the input/output of the
97 multiplexer. Using this disconnected high-impedance state as the idle state
98 is indicated with idle state (-2).
99 $ref: /schemas/types.yaml#/definitions/int32-array
101 minimum: -2
106 - |
107 #include <dt-bindings/gpio/gpio.h>
109 /* One consumer of a 2-way mux controller (one GPIO-line) */
110 mux: mux-controller {
111 compatible = "gpio-mux";
112 #mux-control-cells = <0>;
114 mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>;
117 adc-mux {
118 compatible = "io-channel-mux";
119 io-channels = <&adc 0>;
120 io-channel-names = "parent";
122 mux-controls = <&mux>;
123 mux-control-names = "adc";
128 - |
129 #include <dt-bindings/gpio/gpio.h>
133 * parallel 4-way multiplexers controlled by the same two GPIO-lines.
135 mux2: mux-controller {
136 compatible = "gpio-mux";
137 #mux-control-cells = <0>;
139 mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
143 adc-mux {
144 compatible = "io-channel-mux";
145 io-channels = <&adc 0>;
146 io-channel-names = "parent";
148 mux-controls = <&mux2>;
150 channels = "sync-1", "in", "out", "sync-2";
153 i2c-mux {
154 compatible = "i2c-mux";
155 i2c-parent = <&i2c1>;
157 mux-controls = <&mux2>;
159 #address-cells = <1>;
160 #size-cells = <0>;
164 #address-cells = <1>;
165 #size-cells = <0>;
174 #address-cells = <1>;
175 #size-cells = <0>;