Path: blob/master/Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml
26307 views
# SPDX-License-Identifier: GPL-2.0-only1%YAML 1.22---3$id: http://devicetree.org/schemas/i2c/i2c-mux-gpio.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: GPIO-based I2C Bus Mux78maintainers:9- Wolfram Sang <wsa@kernel.org>1011description: |12This binding describes an I2C bus multiplexer that uses GPIOs to route the I2C signals.1314+-----+ +-----+15| dev | | dev |16+------------+ +-----+ +-----+17| SoC | | |18| | /--------+--------+19| +------+ | +------+ child bus A, on GPIO value set to 020| | I2C |-|--| Mux |21| +------+ | +--+---+ child bus B, on GPIO value set to 122| | | \----------+--------+--------+23| +------+ | | | | |24| | GPIO |-|-----+ +-----+ +-----+ +-----+25| +------+ | | dev | | dev | | dev |26+------------+ +-----+ +-----+ +-----+2728For each I2C child node, an I2C child bus will be created. They will be numbered based on their29order in the device tree.3031Whenever an access is made to a device on a child bus, the value set in the relevant node's reg32property will be output using the list of GPIOs, the first in the list holding the least-33significant value.3435If an idle state is defined, using the idle-state (optional) property, whenever an access is not36being made to a device on a child bus, the GPIOs will be set according to the idle value.3738If an idle state is not defined, the most recently used value will be left programmed into39hardware whenever no access is being made to a device on a child bus.4041properties:42compatible:43const: i2c-mux-gpio4445i2c-parent:46description: phandle of the I2C bus that this multiplexer's master-side port is connected to47$ref: /schemas/types.yaml#/definitions/phandle4849mux-gpios:50description: list of GPIOs used to control the muxer51minItems: 152maxItems: 4 # Should be enough5354idle-state:55description: Value to set the muxer to when idle. When no value is given, it defaults to the56last value used.57$ref: /schemas/types.yaml#/definitions/uint325859settle-time-us:60description: Delay to wait before doing any transfer when a new bus gets selected.6162allOf:63- $ref: i2c-mux.yaml6465unevaluatedProperties: false6667required:68- compatible69- i2c-parent70- mux-gpios7172examples:73- |74i2cmux {75compatible = "i2c-mux-gpio";76#address-cells = <1>;77#size-cells = <0>;78mux-gpios = <&gpio1 22 0>, <&gpio1 23 0>;79i2c-parent = <&i2c1>;8081i2c@1 {82reg = <1>;83#address-cells = <1>;84#size-cells = <0>;8586ssd1307: oled@3c {87compatible = "solomon,ssd1307fb-i2c";88reg = <0x3c>;89pwms = <&pwm 4 3000>;90reset-gpios = <&gpio2 7 1>;91};92};9394i2c@3 {95reg = <3>;96#address-cells = <1>;97#size-cells = <0>;9899pca9555: pca9555@20 {100compatible = "nxp,pca9555";101gpio-controller;102#gpio-cells = <2>;103reg = <0x20>;104};105};106};107108109