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.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Common i2c bus multiplexer/switch properties.
0008 
0009 maintainers:
0010   - Peter Rosin <peda@axentia.se>
0011 
0012 description: |+
0013   An i2c bus multiplexer/switch will have several child busses that are numbered
0014   uniquely in a device dependent manner.  The nodes for an i2c bus
0015   multiplexer/switch will have one child node for each child bus.
0016 
0017   For i2c multiplexers/switches that have child nodes that are a mixture of both
0018   i2c child busses and other child nodes, the 'i2c-mux' subnode can be used for
0019   populating the i2c child busses.  If an 'i2c-mux' subnode is present, only
0020   subnodes of this will be considered as i2c child busses.
0021 
0022 properties:
0023   $nodename:
0024     pattern: '^(i2c-?)?mux'
0025 
0026   '#address-cells':
0027     const: 1
0028 
0029   '#size-cells':
0030     const: 0
0031 
0032 patternProperties:
0033   '^i2c@[0-9a-f]+$':
0034     $ref: /schemas/i2c/i2c-controller.yaml
0035     unevaluatedProperties: false
0036 
0037     properties:
0038       reg:
0039         description: The mux selector sub-bus number for the child I2C bus.
0040         maxItems: 1
0041 
0042 additionalProperties: true
0043 
0044 examples:
0045   - |
0046     /*
0047      * An NXP pca9548 8 channel I2C multiplexer at address 0x70
0048      * with two NXP pca8574 GPIO expanders attached, one each to
0049      * ports 3 and 4.
0050      */
0051     i2c {
0052         #address-cells = <1>;
0053         #size-cells = <0>;
0054 
0055         i2c-mux@70 {
0056             compatible = "nxp,pca9548";
0057             reg = <0x70>;
0058             #address-cells = <1>;
0059             #size-cells = <0>;
0060 
0061             i2c@3 {
0062                 #address-cells = <1>;
0063                 #size-cells = <0>;
0064                 reg = <3>;
0065 
0066                 gpio@20 {
0067                     compatible = "nxp,pca9555";
0068                     gpio-controller;
0069                     #gpio-cells = <2>;
0070                     reg = <0x20>;
0071                 };
0072             };
0073             i2c@4 {
0074                 #address-cells = <1>;
0075                 #size-cells = <0>;
0076                 reg = <4>;
0077 
0078                 gpio@20 {
0079                     compatible = "nxp,pca9555";
0080                     gpio-controller;
0081                     #gpio-cells = <2>;
0082                     reg = <0x20>;
0083                 };
0084             };
0085         };
0086     };
0087 ...