Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 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 | |
| 7 | title: NXP PCA954x I2C and compatible bus switches |
| 8 | |
| 9 | maintainers: |
| 10 | - Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
| 11 | |
| 12 | description: |
| 13 | The NXP PCA954x and compatible devices are I2C bus |
| 14 | multiplexer/switches that share the same functionality |
| 15 | and register layout. |
| 16 | The devices usually have 4 or 8 child buses, which are |
| 17 | attached to the parent bus by using the SMBus "Send Byte" |
| 18 | command. |
| 19 | |
| 20 | properties: |
| 21 | compatible: |
| 22 | oneOf: |
| 23 | - enum: |
| 24 | - maxim,max7356 |
| 25 | - maxim,max7357 |
| 26 | - maxim,max7358 |
| 27 | - maxim,max7367 |
| 28 | - maxim,max7368 |
| 29 | - maxim,max7369 |
| 30 | - nxp,pca9540 |
| 31 | - nxp,pca9542 |
| 32 | - nxp,pca9543 |
| 33 | - nxp,pca9544 |
| 34 | - nxp,pca9545 |
| 35 | - nxp,pca9546 |
| 36 | - nxp,pca9547 |
| 37 | - nxp,pca9548 |
| 38 | - nxp,pca9846 |
| 39 | - nxp,pca9847 |
| 40 | - nxp,pca9848 |
| 41 | - nxp,pca9849 |
| 42 | - items: |
| 43 | - const: nxp,pca9646 |
| 44 | - const: nxp,pca9546 |
| 45 | |
| 46 | reg: |
| 47 | maxItems: 1 |
| 48 | |
| 49 | interrupts: |
| 50 | maxItems: 1 |
| 51 | |
| 52 | "#interrupt-cells": |
| 53 | const: 2 |
| 54 | |
| 55 | interrupt-controller: true |
| 56 | |
| 57 | reset-gpios: |
| 58 | maxItems: 1 |
| 59 | |
| 60 | i2c-mux-idle-disconnect: |
| 61 | type: boolean |
| 62 | description: Forces mux to disconnect all children in idle state. This is |
| 63 | necessary for example, if there are several multiplexers on the bus and |
| 64 | the devices behind them use same I2C addresses. |
| 65 | |
| 66 | idle-state: |
| 67 | description: if present, overrides i2c-mux-idle-disconnect |
| 68 | $ref: /schemas/mux/mux-controller.yaml#/properties/idle-state |
| 69 | |
| 70 | vdd-supply: |
| 71 | description: A voltage regulator supplying power to the chip. On PCA9846 |
| 72 | the regulator supplies power to VDD2 (core logic) and optionally to VDD1. |
| 73 | |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame^] | 74 | maxim,isolate-stuck-channel: |
| 75 | type: boolean |
| 76 | description: Allows to use non faulty channels while a stuck channel is |
| 77 | isolated from the upstream bus. If not set all channels are isolated from |
| 78 | the upstream bus until the fault is cleared. |
| 79 | |
| 80 | maxim,send-flush-out-sequence: |
| 81 | type: boolean |
| 82 | description: Send a flush-out sequence to stuck auxiliary buses |
| 83 | automatically after a stuck channel is being detected. |
| 84 | |
| 85 | maxim,preconnection-wiggle-test-enable: |
| 86 | type: boolean |
| 87 | description: Send a STOP condition to the auxiliary buses when the switch |
| 88 | register activates a channel to detect a stuck high fault. On fault the |
| 89 | channel is isolated from the upstream bus. |
| 90 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 91 | required: |
| 92 | - compatible |
| 93 | - reg |
| 94 | |
| 95 | allOf: |
| 96 | - $ref: /schemas/i2c/i2c-mux.yaml# |
| 97 | - if: |
| 98 | not: |
| 99 | properties: |
| 100 | compatible: |
| 101 | contains: |
| 102 | enum: |
| 103 | - maxim,max7367 |
| 104 | - maxim,max7369 |
| 105 | - nxp,pca9542 |
| 106 | - nxp,pca9543 |
| 107 | - nxp,pca9544 |
| 108 | - nxp,pca9545 |
| 109 | then: |
| 110 | properties: |
| 111 | interrupts: false |
| 112 | "#interrupt-cells": false |
| 113 | interrupt-controller: false |
| 114 | |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame^] | 115 | - if: |
| 116 | not: |
| 117 | properties: |
| 118 | compatible: |
| 119 | contains: |
| 120 | enum: |
| 121 | - maxim,max7357 |
| 122 | then: |
| 123 | properties: |
| 124 | maxim,isolate-stuck-channel: false |
| 125 | maxim,send-flush-out-sequence: false |
| 126 | maxim,preconnection-wiggle-test-enable: false |
| 127 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 128 | unevaluatedProperties: false |
| 129 | |
| 130 | examples: |
| 131 | - | |
| 132 | #include <dt-bindings/interrupt-controller/irq.h> |
| 133 | |
| 134 | i2c { |
| 135 | #address-cells = <1>; |
| 136 | #size-cells = <0>; |
| 137 | |
| 138 | i2c-mux@74 { |
| 139 | compatible = "nxp,pca9545"; |
| 140 | #address-cells = <1>; |
| 141 | #size-cells = <0>; |
| 142 | reg = <0x74>; |
| 143 | |
| 144 | vdd-supply = <&p3v3>; |
| 145 | |
| 146 | interrupt-parent = <&ipic>; |
| 147 | interrupts = <17 IRQ_TYPE_LEVEL_LOW>; |
| 148 | interrupt-controller; |
| 149 | #interrupt-cells = <2>; |
| 150 | |
| 151 | i2c@2 { |
| 152 | #address-cells = <1>; |
| 153 | #size-cells = <0>; |
| 154 | reg = <2>; |
| 155 | |
| 156 | eeprom@54 { |
| 157 | compatible = "atmel,24c08"; |
| 158 | reg = <0x54>; |
| 159 | }; |
| 160 | }; |
| 161 | |
| 162 | i2c@4 { |
| 163 | #address-cells = <1>; |
| 164 | #size-cells = <0>; |
| 165 | reg = <4>; |
| 166 | |
| 167 | rtc@51 { |
| 168 | compatible = "nxp,pcf8563"; |
| 169 | reg = <0x51>; |
| 170 | }; |
| 171 | }; |
| 172 | }; |
| 173 | }; |
| 174 | ... |