Path: blob/master/Documentation/devicetree/bindings/gpio/gpio-line-mux.yaml
121834 views
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/gpio/gpio-line-mux.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: GPIO line mux78maintainers:9- Jonas Jelonek <jelonek.jonas@gmail.com>1011description: |12A GPIO controller to provide virtual GPIOs for a 1-to-many input-only mapping13backed by a single shared GPIO and a multiplexer. A simple illustrated14example is:1516+----- A17IN /18<-----o------- B19/ |\20| | +----- C21| | \22| | +--- D23| |24M1 M02526MUX CONTROL2728M1 M0 IN290 0 A300 1 B311 0 C321 1 D3334This can be used in case a real GPIO is connected to multiple inputs and35controlled by a multiplexer, and another subsystem/driver does not work36directly with the multiplexer subsystem.3738properties:39compatible:40const: gpio-line-mux4142gpio-controller: true4344"#gpio-cells":45const: 24647gpio-line-mux-states:48description: Mux states corresponding to the virtual GPIOs.49$ref: /schemas/types.yaml#/definitions/uint32-array5051gpio-line-names: true5253mux-controls:54maxItems: 155description:56Phandle to the multiplexer to control access to the GPIOs.5758ngpios: false5960muxed-gpios:61maxItems: 162description:63GPIO which is the '1' in 1-to-many and is shared by the virtual GPIOs64and controlled via the mux.6566required:67- compatible68- gpio-controller69- gpio-line-mux-states70- mux-controls71- muxed-gpios7273additionalProperties: false7475examples:76- |77#include <dt-bindings/gpio/gpio.h>78#include <dt-bindings/mux/mux.h>7980sfp_gpio_mux: mux-controller-1 {81compatible = "gpio-mux";82mux-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>,83<&gpio0 1 GPIO_ACTIVE_HIGH>;84#mux-control-cells = <0>;85idle-state = <MUX_IDLE_AS_IS>;86};8788sfp1_gpio: sfp-gpio-1 {89compatible = "gpio-line-mux";90gpio-controller;91#gpio-cells = <2>;9293mux-controls = <&sfp_gpio_mux>;94muxed-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;9596gpio-line-mux-states = <0>, <1>, <3>;97};9899sfp1: sfp-p1 {100compatible = "sff,sfp";101102i2c-bus = <&sfp1_i2c>;103los-gpios = <&sfp1_gpio 0 GPIO_ACTIVE_HIGH>;104mod-def0-gpios = <&sfp1_gpio 1 GPIO_ACTIVE_LOW>;105tx-fault-gpios = <&sfp1_gpio 2 GPIO_ACTIVE_HIGH>;106};107108109