Path: blob/master/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.yaml
26307 views
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/i2c/i2c-demux-pinctrl.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Pinctrl-based I2C Bus Demultiplexer78maintainers:9- Wolfram Sang <wsa+renesas@sang-engineering.com>1011description: |12This binding describes an I2C bus demultiplexer that uses pin multiplexing to13route the I2C signals, and represents the pin multiplexing configuration14using the pinctrl device tree bindings. This may be used to select one I2C15IP core at runtime which may have a better feature set for a given task than16another I2C IP core on the SoC. The most simple example is to fall back to17GPIO bitbanging if your current runtime configuration hits an errata of the18internal IP core.1920+-------------------------------+21| SoC |22| | +-----+ +-----+23| +------------+ | | dev | | dev |24| |I2C IP Core1|--\ | +-----+ +-----+25| +------------+ \-------+ | | |26| |Pinctrl|--|------+--------+27| +------------+ +-------+ |28| |I2C IP Core2|--/ |29| +------------+ |30| |31+-------------------------------+3233allOf:34- $ref: /schemas/i2c/i2c-controller.yaml#3536properties:37compatible:38const: i2c-demux-pinctrl3940i2c-parent:41$ref: /schemas/types.yaml#/definitions/phandle-array42items:43maxItems: 144description:45List of phandles of I2C masters available for selection. The first one46will be used as default.4748i2c-bus-name:49$ref: /schemas/types.yaml#/definitions/string50description:51The name of this bus. Also needed as pinctrl-name for the I2C parents.5253required:54- compatible55- i2c-parent56- i2c-bus-name5758unevaluatedProperties: false5960examples:61- |62#include <dt-bindings/gpio/gpio.h>63#include <dt-bindings/interrupt-controller/irq.h>6465gpioi2c2: i2c-9 {66#address-cells = <1>;67#size-cells = <0>;68compatible = "i2c-gpio";69scl-gpios = <&gpio5 5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;70sda-gpios = <&gpio5 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;71i2c-gpio,delay-us = <5>;7273// The I2C controller must have its status "disabled". The I2C bus74// demultiplexer will enable it at runtime when needed.75status = "disabled";76};7778iic2: i2c@e6520000 {79reg = <0xe6520000 0x425>;80pinctrl-0 = <&iic2_pins>;81// The pinctrl property for the parent I2C controller needs a pinctrl82// state with the same name as i2c-bus-name in the I2C bus demultiplexer83// node, not "default"!84pinctrl-names = "i2c-hdmi";8586clock-frequency = <100000>;8788// The I2C controller must have its status "disabled". The I2C bus89// demultiplexer will enable it at runtime when needed.90status = "disabled";91};9293i2c2: i2c@e6530000 {94reg = <0 0xe6530000 0 0x40>;95pinctrl-0 = <&i2c2_pins>;96// The pinctrl property for the parent I2C controller needs a pinctrl97// state with the same name as i2c-bus-name in the I2C bus demultiplexer98// node, not "default"!99pinctrl-names = "i2c-hdmi";100101clock-frequency = <100000>;102103// The I2C controller must have its status "disabled". The I2C bus104// demultiplexer will enable it at runtime when needed.105status = "disabled";106};107108// Example for a bus to be demuxed. It contains various I2C clients for109// HDMI, so the bus is named "i2c-hdmi":110i2chdmi: i2c-mux3 {111compatible = "i2c-demux-pinctrl";112i2c-parent = <&iic2>, <&i2c2>, <&gpioi2c2>;113i2c-bus-name = "i2c-hdmi";114#address-cells = <1>;115#size-cells = <0>;116117ak4643: codec@12 {118compatible = "asahi-kasei,ak4643";119#sound-dai-cells = <0>;120reg = <0x12>;121};122123composite-in@20 {124compatible = "adi,adv7180";125reg = <0x20>;126127port {128adv7180: endpoint {129bus-width = <8>;130remote-endpoint = <&vin1ep0>;131};132};133};134135hdmi@39 {136compatible = "adi,adv7511w";137reg = <0x39>;138interrupt-parent = <&gpio1>;139interrupts = <15 IRQ_TYPE_LEVEL_LOW>;140clocks = <&cec_clock>;141clock-names = "cec";142143avdd-supply = <&fixedregulator1v8>;144dvdd-supply = <&fixedregulator1v8>;145pvdd-supply = <&fixedregulator1v8>;146dvdd-3v-supply = <&fixedregulator3v3>;147bgvdd-supply = <&fixedregulator1v8>;148149adi,input-depth = <8>;150adi,input-colorspace = "rgb";151adi,input-clock = "1x";152153ports {154#address-cells = <1>;155#size-cells = <0>;156157port@0 {158reg = <0>;159adv7511_in: endpoint {160remote-endpoint = <&lvds0_out>;161};162};163164port@1 {165reg = <1>;166adv7511_out: endpoint {167remote-endpoint = <&hdmi_con_out>;168};169};170};171};172};173174175