xref: /openbmc/linux/Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.yaml (revision b9221f71c285d4ce557c0a2a95e168f641f3396d)
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
7e9ab77a4SJonathan Camerontitle: I/O channel multiplexer bindings
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:
38e9ab77a4SJonathan Cameron    $ref: /schemas/types.yaml#/definitions/string-array
39e9ab77a4SJonathan Cameron    description:
40e9ab77a4SJonathan Cameron      List of strings, labeling the mux controller states.
41e9ab77a4SJonathan Cameron
42*b9221f71SVincent Whitchurch  settle-time-us:
43*b9221f71SVincent Whitchurch    default: 0
44*b9221f71SVincent Whitchurch    description:
45*b9221f71SVincent Whitchurch      Time required for analog signals to settle after muxing.
46*b9221f71SVincent Whitchurch
47e9ab77a4SJonathan Cameronrequired:
48e9ab77a4SJonathan Cameron  - compatible
49e9ab77a4SJonathan Cameron  - io-channels
50e9ab77a4SJonathan Cameron  - io-channel-names
51e9ab77a4SJonathan Cameron  - mux-controls
52e9ab77a4SJonathan Cameron  - channels
53e9ab77a4SJonathan Cameron
54e9ab77a4SJonathan CameronadditionalProperties: false
55e9ab77a4SJonathan Cameron
56e9ab77a4SJonathan Cameronexamples:
57e9ab77a4SJonathan Cameron  - |
58e9ab77a4SJonathan Cameron    #include <dt-bindings/gpio/gpio.h>
59e9ab77a4SJonathan Cameron    mux: mux-controller {
60e9ab77a4SJonathan Cameron      compatible = "gpio-mux";
61e9ab77a4SJonathan Cameron      #mux-control-cells = <0>;
62e9ab77a4SJonathan Cameron
63e9ab77a4SJonathan Cameron      mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
64e9ab77a4SJonathan Cameron                  <&pioA 1 GPIO_ACTIVE_HIGH>;
65e9ab77a4SJonathan Cameron    };
66e9ab77a4SJonathan Cameron
67e9ab77a4SJonathan Cameron    adc-mux {
68e9ab77a4SJonathan Cameron      compatible = "io-channel-mux";
69e9ab77a4SJonathan Cameron      io-channels = <&adc 0>;
70e9ab77a4SJonathan Cameron      io-channel-names = "parent";
71e9ab77a4SJonathan Cameron
72e9ab77a4SJonathan Cameron      mux-controls = <&mux>;
73e9ab77a4SJonathan Cameron      channels = "sync", "in", "system-regulator";
74e9ab77a4SJonathan Cameron    };
75e9ab77a4SJonathan Cameron...
76