xref: /freebsd/sys/contrib/device-tree/Bindings/iio/multiplexer/io-channel-mux.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotI/O channel multiplexer bindings
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotIf a multiplexer is used to select which hardware signal is fed to
4*c66ec88fSEmmanuel Vadote.g. an ADC channel, these bindings describe that situation.
5*c66ec88fSEmmanuel Vadot
6*c66ec88fSEmmanuel VadotRequired properties:
7*c66ec88fSEmmanuel Vadot- compatible : "io-channel-mux"
8*c66ec88fSEmmanuel Vadot- io-channels : Channel node of the parent channel that has multiplexed
9*c66ec88fSEmmanuel Vadot		input.
10*c66ec88fSEmmanuel Vadot- io-channel-names : Should be "parent".
11*c66ec88fSEmmanuel Vadot- #address-cells = <1>;
12*c66ec88fSEmmanuel Vadot- #size-cells = <0>;
13*c66ec88fSEmmanuel Vadot- mux-controls : Mux controller node to use for operating the mux
14*c66ec88fSEmmanuel Vadot- channels : List of strings, labeling the mux controller states.
15*c66ec88fSEmmanuel Vadot
16*c66ec88fSEmmanuel VadotFor each non-empty string in the channels property, an io-channel will
17*c66ec88fSEmmanuel Vadotbe created. The number of this io-channel is the same as the index into
18*c66ec88fSEmmanuel Vadotthe list of strings in the channels property, and also matches the mux
19*c66ec88fSEmmanuel Vadotcontroller state. The mux controller state is described in
20*c66ec88fSEmmanuel Vadot../mux/mux-controller.txt
21*c66ec88fSEmmanuel Vadot
22*c66ec88fSEmmanuel VadotExample:
23*c66ec88fSEmmanuel Vadot	mux: mux-controller {
24*c66ec88fSEmmanuel Vadot		compatible = "gpio-mux";
25*c66ec88fSEmmanuel Vadot		#mux-control-cells = <0>;
26*c66ec88fSEmmanuel Vadot
27*c66ec88fSEmmanuel Vadot		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
28*c66ec88fSEmmanuel Vadot			    <&pioA 1 GPIO_ACTIVE_HIGH>;
29*c66ec88fSEmmanuel Vadot	};
30*c66ec88fSEmmanuel Vadot
31*c66ec88fSEmmanuel Vadot	adc-mux {
32*c66ec88fSEmmanuel Vadot		compatible = "io-channel-mux";
33*c66ec88fSEmmanuel Vadot		io-channels = <&adc 0>;
34*c66ec88fSEmmanuel Vadot		io-channel-names = "parent";
35*c66ec88fSEmmanuel Vadot
36*c66ec88fSEmmanuel Vadot		mux-controls = <&mux>;
37*c66ec88fSEmmanuel Vadot
38*c66ec88fSEmmanuel Vadot		channels = "sync", "in", "system-regulator";
39*c66ec88fSEmmanuel Vadot	};
40