1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/i2c/i2c-mux-pca954x.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: NXP PCA954x I2C bus switch
8
9maintainers:
10  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
11
12description:
13  The binding supports NXP PCA954x and PCA984x I2C mux/switch devices.
14
15properties:
16  compatible:
17    oneOf:
18      - enum:
19          - nxp,pca9540
20          - nxp,pca9542
21          - nxp,pca9543
22          - nxp,pca9544
23          - nxp,pca9545
24          - nxp,pca9546
25          - nxp,pca9547
26          - nxp,pca9548
27          - nxp,pca9846
28          - nxp,pca9847
29          - nxp,pca9848
30          - nxp,pca9849
31      - items:
32          - const: nxp,pca9646
33          - const: nxp,pca9546
34
35  reg:
36    maxItems: 1
37
38  interrupts:
39    maxItems: 1
40
41  "#interrupt-cells":
42    const: 2
43
44  interrupt-controller: true
45
46  reset-gpios:
47    maxItems: 1
48
49  i2c-mux-idle-disconnect:
50    type: boolean
51    description: Forces mux to disconnect all children in idle state. This is
52      necessary for example, if there are several multiplexers on the bus and
53      the devices behind them use same I2C addresses.
54
55  idle-state:
56    description: if present, overrides i2c-mux-idle-disconnect
57    $ref: /schemas/mux/mux-controller.yaml#/properties/idle-state
58
59required:
60  - compatible
61  - reg
62
63allOf:
64  - $ref: /schemas/i2c/i2c-mux.yaml#
65  - if:
66      not:
67        properties:
68          compatible:
69            contains:
70              enum:
71                - nxp,pca9542
72                - nxp,pca9543
73                - nxp,pca9544
74                - nxp,pca9545
75    then:
76      properties:
77        interrupts: false
78        "#interrupt-cells": false
79        interrupt-controller: false
80
81unevaluatedProperties: false
82
83examples:
84  - |
85    #include <dt-bindings/interrupt-controller/irq.h>
86
87    i2c {
88        #address-cells = <1>;
89        #size-cells = <0>;
90
91        i2c-mux@74 {
92            compatible = "nxp,pca9545";
93            #address-cells = <1>;
94            #size-cells = <0>;
95            reg = <0x74>;
96
97            interrupt-parent = <&ipic>;
98            interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
99            interrupt-controller;
100            #interrupt-cells = <2>;
101
102            i2c@2 {
103                #address-cells = <1>;
104                #size-cells = <0>;
105                reg = <2>;
106
107                eeprom@54 {
108                    compatible = "atmel,24c08";
109                    reg = <0x54>;
110                };
111            };
112
113            i2c@4 {
114                #address-cells = <1>;
115                #size-cells = <0>;
116                reg = <4>;
117
118                rtc@51 {
119                    compatible = "nxp,pcf8563";
120                    reg = <0x51>;
121                };
122            };
123        };
124    };
125...
126