xref: /openbmc/linux/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.yaml (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1e9ab77a4SJonathan Cameron# SPDX-License-Identifier: GPL-2.0
2e9ab77a4SJonathan Cameron%YAML 1.2
3e9ab77a4SJonathan Cameron---
4e9ab77a4SJonathan Cameron$id: http://devicetree.org/schemas/iio/multiplexer/io-channel-mux.yaml#
5e9ab77a4SJonathan Cameron$schema: http://devicetree.org/meta-schemas/core.yaml#
6e9ab77a4SJonathan Cameron
7*84e85359SKrzysztof Kozlowskititle: I/O channel multiplexer
8e9ab77a4SJonathan Cameron
9e9ab77a4SJonathan Cameronmaintainers:
10e9ab77a4SJonathan Cameron  - Peter Rosin <peda@axentia.se>
11e9ab77a4SJonathan Cameron
12e9ab77a4SJonathan Camerondescription: |
13e9ab77a4SJonathan Cameron  If a multiplexer is used to select which hardware signal is fed to
14e9ab77a4SJonathan Cameron  e.g. an ADC channel, these bindings describe that situation.
15e9ab77a4SJonathan Cameron
16e9ab77a4SJonathan Cameron  For each non-empty string in the channels property, an io-channel will be
17e9ab77a4SJonathan Cameron  created. The number of this io-channel is the same as the index into the list
18e9ab77a4SJonathan Cameron  of strings in the channels property, and also matches the mux controller
19e9ab77a4SJonathan Cameron  state. The mux controller state is described in
20e9ab77a4SJonathan Cameron  Documentation/devicetree/bindings/mux/mux-controller.yaml
21e9ab77a4SJonathan Cameron
22e9ab77a4SJonathan Cameronproperties:
23e9ab77a4SJonathan Cameron
24e9ab77a4SJonathan Cameron  compatible:
25e9ab77a4SJonathan Cameron    const: io-channel-mux
26e9ab77a4SJonathan Cameron
27e9ab77a4SJonathan Cameron  io-channels:
28e9ab77a4SJonathan Cameron    maxItems: 1
29e9ab77a4SJonathan Cameron    description: Channel node of the parent channel that has multiplexed input.
30e9ab77a4SJonathan Cameron
31e9ab77a4SJonathan Cameron  io-channel-names:
32e9ab77a4SJonathan Cameron    const: parent
33e9ab77a4SJonathan Cameron
34e9ab77a4SJonathan Cameron  mux-controls: true
35e9ab77a4SJonathan Cameron  mux-control-names: true
36e9ab77a4SJonathan Cameron
37e9ab77a4SJonathan Cameron  channels:
38392998a8SPeter Rosin    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
39e9ab77a4SJonathan Cameron    description:
40392998a8SPeter Rosin      List of strings, labeling the mux controller states. An empty
41392998a8SPeter Rosin      string for a state means that the channel is not available.
42e9ab77a4SJonathan Cameron
43b9221f71SVincent Whitchurch  settle-time-us:
44b9221f71SVincent Whitchurch    default: 0
45b9221f71SVincent Whitchurch    description:
46b9221f71SVincent Whitchurch      Time required for analog signals to settle after muxing.
47b9221f71SVincent Whitchurch
4886477c23SPeter Rosin  "#io-channel-cells":
4986477c23SPeter Rosin    const: 1
5086477c23SPeter Rosin
51e9ab77a4SJonathan Cameronrequired:
52e9ab77a4SJonathan Cameron  - compatible
53e9ab77a4SJonathan Cameron  - io-channels
54e9ab77a4SJonathan Cameron  - io-channel-names
55e9ab77a4SJonathan Cameron  - mux-controls
56e9ab77a4SJonathan Cameron  - channels
57e9ab77a4SJonathan Cameron
58e9ab77a4SJonathan CameronadditionalProperties: false
59e9ab77a4SJonathan Cameron
60e9ab77a4SJonathan Cameronexamples:
61e9ab77a4SJonathan Cameron  - |
62e9ab77a4SJonathan Cameron    #include <dt-bindings/gpio/gpio.h>
63e9ab77a4SJonathan Cameron    mux: mux-controller {
64e9ab77a4SJonathan Cameron      compatible = "gpio-mux";
65e9ab77a4SJonathan Cameron      #mux-control-cells = <0>;
66e9ab77a4SJonathan Cameron
67e9ab77a4SJonathan Cameron      mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
68e9ab77a4SJonathan Cameron                  <&pioA 1 GPIO_ACTIVE_HIGH>;
69e9ab77a4SJonathan Cameron    };
70e9ab77a4SJonathan Cameron
71e9ab77a4SJonathan Cameron    adc-mux {
72e9ab77a4SJonathan Cameron      compatible = "io-channel-mux";
73e9ab77a4SJonathan Cameron      io-channels = <&adc 0>;
74e9ab77a4SJonathan Cameron      io-channel-names = "parent";
75e9ab77a4SJonathan Cameron
76e9ab77a4SJonathan Cameron      mux-controls = <&mux>;
77e9ab77a4SJonathan Cameron      channels = "sync", "in", "system-regulator";
78e9ab77a4SJonathan Cameron    };
79e9ab77a4SJonathan Cameron...
80