Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/mux/gpio-mux.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: GPIO-based multiplexer controller bindings
0008 
0009 maintainers:
0010   - Peter Rosin <peda@axentia.se>
0011 
0012 description: |+
0013   Define what GPIO pins are used to control a multiplexer. Or several
0014   multiplexers, if the same pins control more than one multiplexer.
0015 
0016   The multiplexer state is defined as the number represented by the
0017   multiplexer GPIO pins, where the first pin is the least significant
0018   bit. An active pin is a binary 1, an inactive pin is a binary 0.
0019 
0020 properties:
0021   compatible:
0022     const: gpio-mux
0023 
0024   mux-gpios:
0025     description:
0026       List of gpios used to control the multiplexer, least significant bit first.
0027 
0028   '#mux-control-cells':
0029     enum: [ 0, 1 ]
0030 
0031   '#mux-state-cells':
0032     enum: [ 1, 2 ]
0033 
0034   idle-state:
0035     default: -1
0036 
0037 required:
0038   - compatible
0039   - mux-gpios
0040 anyOf:
0041   - required:
0042       - "#mux-control-cells"
0043   - required:
0044       - "#mux-state-cells"
0045 
0046 additionalProperties: false
0047 
0048 examples:
0049   - |
0050     #include <dt-bindings/gpio/gpio.h>
0051 
0052     mux: mux-controller {
0053         compatible = "gpio-mux";
0054         #mux-control-cells = <0>;
0055 
0056         mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
0057               <&pioA 1 GPIO_ACTIVE_HIGH>;
0058     };
0059 
0060     adc-mux {
0061         compatible = "io-channel-mux";
0062         io-channels = <&adc 0>;
0063         io-channel-names = "parent";
0064 
0065         mux-controls = <&mux>;
0066 
0067         channels = "sync-1", "in", "out", "sync-2";
0068     };
0069 
0070     i2c-mux {
0071         compatible = "i2c-mux";
0072         i2c-parent = <&i2c1>;
0073 
0074         mux-controls = <&mux>;
0075 
0076         #address-cells = <1>;
0077         #size-cells = <0>;
0078 
0079         i2c@0 {
0080             reg = <0>;
0081             #address-cells = <1>;
0082             #size-cells = <0>;
0083 
0084             ssd1307: oled@3c {
0085                 reg = <0x3c>;
0086             };
0087         };
0088 
0089         i2c@3 {
0090             reg = <3>;
0091             #address-cells = <1>;
0092             #size-cells = <0>;
0093 
0094             pca9555: pca9555@20 {
0095                 reg = <0x20>;
0096             };
0097         };
0098     };
0099 ...