GPIO line mux
Schema identifier ($id): "http://devicetree.org/schemas/gpio/gpio-line-mux.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Jonas Jelonek <jelonek.jonas@gmail.com>"
A GPIO controller to provide virtual GPIOs for a 1-to-many input-only mapping backed by a single shared GPIO and a multiplexer. A simple illustrated example is:
+----- A
IN /
<-----o------- B
/ |\
| | +----- C
| | \
| | +--- D
| |
M1 M0
MUX CONTROL
M1 M0 IN
0 0 A
0 1 B
1 0 C
1 1 D
This can be used in case a real GPIO is connected to multiple inputs and controlled by a multiplexer, and another subsystem/driver does not work directly with the multiplexer subsystem.
Properties and child nodes (properties) #
compatible — required here #
Exact value (const): "gpio-line-mux"
gpio-controller — required here #
true — No constraints added by this property rule.
#gpio-cells — not listed as required here #
Exact value (const): 2
gpio-line-mux-states — required here #
Mux states corresponding to the virtual GPIOs.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array
gpio-line-names — not listed as required here #
true — No constraints added by this property rule.
mux-controls — required here #
Maximum number of items (maxItems): 1
Phandle to the multiplexer to control access to the GPIOs.
ngpios — not listed as required here #
false — Not permitted by this property rule.
muxed-gpios — required here #
Maximum number of items (maxItems): 1
GPIO which is the '1' in 1-to-many and is shared by the virtual GPIOs and controlled via the mux.
Required in this object (required): "compatible", "gpio-controller", "gpio-line-mux-states", "mux-controls", "muxed-gpios"
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>
#include <dt-bindings/mux/mux.h>
sfp_gpio_mux: mux-controller-1 {
compatible = "gpio-mux";
mux-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>,
<&gpio0 1 GPIO_ACTIVE_HIGH>;
#mux-control-cells = <0>;
idle-state = <MUX_IDLE_AS_IS>;
};
sfp1_gpio: sfp-gpio-1 {
compatible = "gpio-line-mux";
gpio-controller;
#gpio-cells = <2>;
mux-controls = <&sfp_gpio_mux>;
muxed-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
gpio-line-mux-states = <0>, <1>, <3>;
};
sfp1: sfp-p1 {
compatible = "sff,sfp";
i2c-bus = <&sfp1_i2c>;
los-gpios = <&sfp1_gpio 0 GPIO_ACTIVE_HIGH>;
mod-def0-gpios = <&sfp1_gpio 1 GPIO_ACTIVE_LOW>;
tx-fault-gpios = <&sfp1_gpio 2 GPIO_ACTIVE_HIGH>;
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)