GPIO-based multiplexer controller

Schema identifier ($id): "http://devicetree.org/schemas/mux/gpio-mux.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Peter Rosin <peda@axentia.se>"

Define what GPIO pins are used to control a multiplexer. Or several multiplexers, if the same pins control more than one multiplexer.

The multiplexer state is defined as the number represented by the multiplexer GPIO pins, where the first pin is the least significant bit. An active pin is a binary 1, an inactive pin is a binary 0.

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "gpio-mux"

mux-gpios — required here #

List of gpios used to control the multiplexer, least significant bit first.

mux-supply — not listed as required here #

Regulator to power on the multiplexer.

#mux-control-cells — not listed as required here #

Allowed values (enum): 0, 1

#mux-state-cells — not listed as required here #

Allowed values (enum): 1, 2

idle-state — not listed as required here #

Default value (default): -1

Required in this object (required): "compatible", "mux-gpios"

At least one of these rules must match (anyOf) #

Rule 1 #

Required in this object (required): "#mux-control-cells"

Rule 2 #

Required in this object (required): "#mux-state-cells"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/gpio/gpio.h>

mux: mux-controller {
    compatible = "gpio-mux";
    #mux-control-cells = <0>;

    mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
          <&pioA 1 GPIO_ACTIVE_HIGH>;
};

adc-mux {
    compatible = "io-channel-mux";
    io-channels = <&adc 0>;
    io-channel-names = "parent";

    mux-controls = <&mux>;

    channels = "sync-1", "in", "out", "sync-2";
};

i2c-mux {
    compatible = "i2c-mux";
    i2c-parent = <&i2c1>;

    mux-controls = <&mux>;

    #address-cells = <1>;
    #size-cells = <0>;

    i2c@0 {
        reg = <0>;
        #address-cells = <1>;
        #size-cells = <0>;

        ssd1307: oled@3c {
            reg = <0x3c>;
        };
    };

    i2c@3 {
        reg = <3>;
        #address-cells = <1>;
        #size-cells = <0>;

        pca9555: pca9555@20 {
            reg = <0x20>;
        };
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Edit this page