Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/i2c/i2c-mux-gpmux.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: General Purpose I2C Bus Mux
0008 
0009 maintainers:
0010   - Peter Rosin <peda@axentia.se>
0011 
0012 description: |+
0013   This binding describes an I2C bus multiplexer that uses a mux controller
0014   from the mux subsystem to route the I2C signals.
0015 
0016                                     .-----.  .-----.
0017                                     | dev |  | dev |
0018       .------------.                '-----'  '-----'
0019       | SoC        |                   |        |
0020       |            |          .--------+--------'
0021       |   .------. |  .------+    child bus A, on MUX value set to 0
0022       |   | I2C  |-|--| Mux  |
0023       |   '------' |  '--+---+    child bus B, on MUX value set to 1
0024       |   .------. |     |    '----------+--------+--------.
0025       |   | MUX- | |     |               |        |        |
0026       |   | Ctrl |-|-----+            .-----.  .-----.  .-----.
0027       |   '------' |                  | dev |  | dev |  | dev |
0028       '------------'                  '-----'  '-----'  '-----'
0029 
0030 
0031 allOf:
0032   - $ref: /schemas/i2c/i2c-mux.yaml#
0033 
0034 properties:
0035   compatible:
0036     const: i2c-mux
0037 
0038   i2c-parent:
0039     $ref: /schemas/types.yaml#/definitions/phandle
0040     description:
0041       The phandle of the I2C bus that this multiplexer's master-side port is
0042       connected to.
0043 
0044   mux-controls:
0045     maxItems: 1
0046     description:
0047       The mux-controller states are the I2C sub-bus numbers.
0048 
0049   mux-locked:
0050     type: boolean
0051     description: |
0052       Explicitly allow unrelated I2C transactions on the parent I2C adapter at
0053       these times:
0054        - during setup of the multiplexer
0055        - between setup of the multiplexer and the child bus I2C transaction
0056        - between the child bus I2C transaction and releasing of the multiplexer
0057        - during releasing of the multiplexer
0058 
0059       However, I2C transactions to devices behind all I2C multiplexers connected
0060       to the same parent adapter that this multiplexer is connected to are blocked
0061       for the full duration of the complete multiplexed I2C transaction (i.e.
0062       including the times covered by the above list).
0063       If mux-locked is not present, the multiplexer is assumed to be parent-locked.
0064       This means that no unrelated I2C transactions are allowed on the parent I2C
0065       adapter for the complete multiplexed I2C transaction.
0066       The properties of mux-locked and parent-locked multiplexers are discussed
0067       in more detail in Documentation/i2c/i2c-topology.rst.
0068 
0069 required:
0070   - compatible
0071   - i2c-parent
0072   - mux-controls
0073 
0074 unevaluatedProperties: false
0075 
0076 examples:
0077   - |
0078     #include <dt-bindings/gpio/gpio.h>
0079     mux: mux-controller {
0080         compatible = "gpio-mux";
0081         #mux-control-cells = <0>;
0082 
0083         mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
0084                     <&pioA 1 GPIO_ACTIVE_HIGH>;
0085     };
0086 
0087     i2c-mux {
0088         compatible = "i2c-mux";
0089         mux-locked;
0090         i2c-parent = <&i2c1>;
0091 
0092         mux-controls = <&mux>;
0093 
0094         #address-cells = <1>;
0095         #size-cells = <0>;
0096 
0097         i2c@1 {
0098             reg = <1>;
0099             #address-cells = <1>;
0100             #size-cells = <0>;
0101 
0102             gpio@20 {
0103                 compatible = "nxp,pca9555";
0104                 gpio-controller;
0105                 #gpio-cells = <2>;
0106                 reg = <0x20>;
0107             };
0108         };
0109 
0110         i2c@3 {
0111             reg = <3>;
0112             #address-cells = <1>;
0113             #size-cells = <0>;
0114 
0115             gpio@20 {
0116                 compatible = "nxp,pca9555";
0117                 gpio-controller;
0118                 #gpio-cells = <2>;
0119                 reg = <0x20>;
0120             };
0121         };
0122     };
0123 ...