Path: blob/master/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml
53932 views
# SPDX-License-Identifier: GPL-2.01%YAML 1.22---3$id: http://devicetree.org/schemas/i2c/i2c-mux-gpmux.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: General Purpose I2C Bus Mux78maintainers:9- Peter Rosin <peda@axentia.se>1011description: |+12This binding describes an I2C bus multiplexer that uses a mux controller13from the mux subsystem to route the I2C signals.1415.-----. .-----.16| dev | | dev |17.------------. '-----' '-----'18| SoC | | |19| | .--------+--------'20| .------. | .------+ child bus A, on MUX value set to 021| | I2C |-|--| Mux |22| '------' | '--+---+ child bus B, on MUX value set to 123| .------. | | '----------+--------+--------.24| | MUX- | | | | | |25| | Ctrl |-|-----+ .-----. .-----. .-----.26| '------' | | dev | | dev | | dev |27'------------' '-----' '-----' '-----'2829allOf:30- $ref: /schemas/i2c/i2c-mux.yaml#3132properties:33compatible:34const: i2c-mux3536i2c-parent:37$ref: /schemas/types.yaml#/definitions/phandle38description:39The phandle of the I2C bus that this multiplexer's master-side port is40connected to.4142mux-controls:43maxItems: 144description:45The mux-controller states are the I2C sub-bus numbers.4647mux-locked:48type: boolean49description: |50Explicitly allow unrelated I2C transactions on the parent I2C adapter at51these times:52- during setup of the multiplexer53- between setup of the multiplexer and the child bus I2C transaction54- between the child bus I2C transaction and releasing of the multiplexer55- during releasing of the multiplexer5657However, I2C transactions to devices behind all I2C multiplexers connected58to the same parent adapter that this multiplexer is connected to are blocked59for the full duration of the complete multiplexed I2C transaction (i.e.60including the times covered by the above list).61If mux-locked is not present, the multiplexer is assumed to be parent-locked.62This means that no unrelated I2C transactions are allowed on the parent I2C63adapter for the complete multiplexed I2C transaction.64The properties of mux-locked and parent-locked multiplexers are discussed65in more detail in Documentation/i2c/i2c-topology.rst.6667required:68- compatible69- i2c-parent70- mux-controls7172unevaluatedProperties: false7374examples:75- |76#include <dt-bindings/gpio/gpio.h>77mux: mux-controller {78compatible = "gpio-mux";79#mux-control-cells = <0>;8081mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,82<&pioA 1 GPIO_ACTIVE_HIGH>;83};8485i2c-mux {86compatible = "i2c-mux";87mux-locked;88i2c-parent = <&i2c1>;8990mux-controls = <&mux>;9192#address-cells = <1>;93#size-cells = <0>;9495i2c@1 {96reg = <1>;97#address-cells = <1>;98#size-cells = <0>;99100gpio@20 {101compatible = "nxp,pca9555";102gpio-controller;103#gpio-cells = <2>;104reg = <0x20>;105};106};107108i2c@3 {109reg = <3>;110#address-cells = <1>;111#size-cells = <0>;112113gpio@20 {114compatible = "nxp,pca9555";115gpio-controller;116#gpio-cells = <2>;117reg = <0x20>;118};119};120};121...122123124