xref: /freebsd/sys/contrib/device-tree/Bindings/mux/gpio-mux.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
15956d97fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
25956d97fSEmmanuel Vadot%YAML 1.2
35956d97fSEmmanuel Vadot---
45956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/mux/gpio-mux.yaml#
55956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65956d97fSEmmanuel Vadot
7*8bab661aSEmmanuel Vadottitle: GPIO-based multiplexer controller
85956d97fSEmmanuel Vadot
95956d97fSEmmanuel Vadotmaintainers:
105956d97fSEmmanuel Vadot  - Peter Rosin <peda@axentia.se>
115956d97fSEmmanuel Vadot
125956d97fSEmmanuel Vadotdescription: |+
135956d97fSEmmanuel Vadot  Define what GPIO pins are used to control a multiplexer. Or several
145956d97fSEmmanuel Vadot  multiplexers, if the same pins control more than one multiplexer.
155956d97fSEmmanuel Vadot
165956d97fSEmmanuel Vadot  The multiplexer state is defined as the number represented by the
175956d97fSEmmanuel Vadot  multiplexer GPIO pins, where the first pin is the least significant
185956d97fSEmmanuel Vadot  bit. An active pin is a binary 1, an inactive pin is a binary 0.
195956d97fSEmmanuel Vadot
205956d97fSEmmanuel Vadotproperties:
215956d97fSEmmanuel Vadot  compatible:
225956d97fSEmmanuel Vadot    const: gpio-mux
235956d97fSEmmanuel Vadot
245956d97fSEmmanuel Vadot  mux-gpios:
255956d97fSEmmanuel Vadot    description:
265956d97fSEmmanuel Vadot      List of gpios used to control the multiplexer, least significant bit first.
275956d97fSEmmanuel Vadot
285956d97fSEmmanuel Vadot  '#mux-control-cells':
29e67e8565SEmmanuel Vadot    enum: [ 0, 1 ]
30e67e8565SEmmanuel Vadot
31e67e8565SEmmanuel Vadot  '#mux-state-cells':
32e67e8565SEmmanuel Vadot    enum: [ 1, 2 ]
335956d97fSEmmanuel Vadot
345956d97fSEmmanuel Vadot  idle-state:
355956d97fSEmmanuel Vadot    default: -1
365956d97fSEmmanuel Vadot
375956d97fSEmmanuel Vadotrequired:
385956d97fSEmmanuel Vadot  - compatible
395956d97fSEmmanuel Vadot  - mux-gpios
40e67e8565SEmmanuel VadotanyOf:
41e67e8565SEmmanuel Vadot  - required:
425956d97fSEmmanuel Vadot      - "#mux-control-cells"
43e67e8565SEmmanuel Vadot  - required:
44e67e8565SEmmanuel Vadot      - "#mux-state-cells"
455956d97fSEmmanuel Vadot
465956d97fSEmmanuel VadotadditionalProperties: false
475956d97fSEmmanuel Vadot
485956d97fSEmmanuel Vadotexamples:
495956d97fSEmmanuel Vadot  - |
505956d97fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
515956d97fSEmmanuel Vadot
525956d97fSEmmanuel Vadot    mux: mux-controller {
535956d97fSEmmanuel Vadot        compatible = "gpio-mux";
545956d97fSEmmanuel Vadot        #mux-control-cells = <0>;
555956d97fSEmmanuel Vadot
565956d97fSEmmanuel Vadot        mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
575956d97fSEmmanuel Vadot              <&pioA 1 GPIO_ACTIVE_HIGH>;
585956d97fSEmmanuel Vadot    };
595956d97fSEmmanuel Vadot
605956d97fSEmmanuel Vadot    adc-mux {
615956d97fSEmmanuel Vadot        compatible = "io-channel-mux";
625956d97fSEmmanuel Vadot        io-channels = <&adc 0>;
635956d97fSEmmanuel Vadot        io-channel-names = "parent";
645956d97fSEmmanuel Vadot
655956d97fSEmmanuel Vadot        mux-controls = <&mux>;
665956d97fSEmmanuel Vadot
675956d97fSEmmanuel Vadot        channels = "sync-1", "in", "out", "sync-2";
685956d97fSEmmanuel Vadot    };
695956d97fSEmmanuel Vadot
705956d97fSEmmanuel Vadot    i2c-mux {
715956d97fSEmmanuel Vadot        compatible = "i2c-mux";
725956d97fSEmmanuel Vadot        i2c-parent = <&i2c1>;
735956d97fSEmmanuel Vadot
745956d97fSEmmanuel Vadot        mux-controls = <&mux>;
755956d97fSEmmanuel Vadot
765956d97fSEmmanuel Vadot        #address-cells = <1>;
775956d97fSEmmanuel Vadot        #size-cells = <0>;
785956d97fSEmmanuel Vadot
795956d97fSEmmanuel Vadot        i2c@0 {
805956d97fSEmmanuel Vadot            reg = <0>;
815956d97fSEmmanuel Vadot            #address-cells = <1>;
825956d97fSEmmanuel Vadot            #size-cells = <0>;
835956d97fSEmmanuel Vadot
845956d97fSEmmanuel Vadot            ssd1307: oled@3c {
855956d97fSEmmanuel Vadot                reg = <0x3c>;
865956d97fSEmmanuel Vadot            };
875956d97fSEmmanuel Vadot        };
885956d97fSEmmanuel Vadot
895956d97fSEmmanuel Vadot        i2c@3 {
905956d97fSEmmanuel Vadot            reg = <3>;
915956d97fSEmmanuel Vadot            #address-cells = <1>;
925956d97fSEmmanuel Vadot            #size-cells = <0>;
935956d97fSEmmanuel Vadot
945956d97fSEmmanuel Vadot            pca9555: pca9555@20 {
955956d97fSEmmanuel Vadot                reg = <0x20>;
965956d97fSEmmanuel Vadot            };
975956d97fSEmmanuel Vadot        };
985956d97fSEmmanuel Vadot    };
995956d97fSEmmanuel Vadot...
100