Path: blob/main/sys/contrib/device-tree/Bindings/i2c/i2c-demux-pinctrl.txt
48375 views
Pinctrl-based I2C Bus DeMux12This binding describes an I2C bus demultiplexer that uses pin multiplexing to3route the I2C signals, and represents the pin multiplexing configuration using4the pinctrl device tree bindings. This may be used to select one I2C IP core at5runtime which may have a better feature set for a given task than another I2C6IP core on the SoC. The most simple example is to fall back to GPIO bitbanging7if your current runtime configuration hits an errata of the internal IP core.89+-------------------------------+10| SoC |11| | +-----+ +-----+12| +------------+ | | dev | | dev |13| |I2C IP Core1|--\ | +-----+ +-----+14| +------------+ \-------+ | | |15| |Pinctrl|--|------+--------+16| +------------+ +-------+ |17| |I2C IP Core2|--/ |18| +------------+ |19| |20+-------------------------------+2122Required properties:23- compatible: "i2c-demux-pinctrl"24- i2c-parent: List of phandles of I2C masters available for selection. The first25one will be used as default.26- i2c-bus-name: The name of this bus. Also needed as pinctrl-name for the I2C27parents.2829Furthermore, I2C mux properties and child nodes. See i2c-mux.yaml in this30directory.3132Example:3334Here is a snipplet for a bus to be demuxed. It contains various i2c clients for35HDMI, so the bus is named "i2c-hdmi":3637i2chdmi: i2c@8 {3839compatible = "i2c-demux-pinctrl";40i2c-parent = <&gpioi2c>, <&iic2>, <&i2c2>;41i2c-bus-name = "i2c-hdmi";42#address-cells = <1>;43#size-cells = <0>;4445ak4643: sound-codec@12 {46compatible = "asahi-kasei,ak4643";4748#sound-dai-cells = <0>;49reg = <0x12>;50};5152composite-in@20 {53compatible = "adi,adv7180";54reg = <0x20>;55remote = <&vin1>;5657port {58adv7180: endpoint {59bus-width = <8>;60remote-endpoint = <&vin1ep0>;61};62};63};6465hdmi@39 {66compatible = "adi,adv7511w";67reg = <0x39>;68interrupt-parent = <&gpio1>;69interrupts = <15 IRQ_TYPE_LEVEL_LOW>;7071adi,input-depth = <8>;72adi,input-colorspace = "rgb";73adi,input-clock = "1x";74adi,input-style = <1>;75adi,input-justification = "evenly";7677ports {78#address-cells = <1>;79#size-cells = <0>;8081port@0 {82reg = <0>;83adv7511_in: endpoint {84remote-endpoint = <&du_out_lvds0>;85};86};8788port@1 {89reg = <1>;90adv7511_out: endpoint {91remote-endpoint = <&hdmi_con>;92};93};94};95};96};9798And for clarification, here are the snipplets for the i2c-parents:99100gpioi2c: i2c@9 {101#address-cells = <1>;102#size-cells = <0>;103compatible = "i2c-gpio";104gpios = <&gpio5 6 GPIO_ACTIVE_HIGH /* sda */105&gpio5 5 GPIO_ACTIVE_HIGH /* scl */106>;107i2c-gpio,delay-us = <5>;108};109110...111112&i2c2 {113pinctrl-0 = <&i2c2_pins>;114pinctrl-names = "i2c-hdmi";115116clock-frequency = <100000>;117};118119...120121&iic2 {122pinctrl-0 = <&iic2_pins>;123pinctrl-names = "i2c-hdmi";124125clock-frequency = <100000>;126};127128Please note:129130- pinctrl properties for the parent I2C controllers need a pinctrl state131with the same name as i2c-bus-name, not "default"!132133- the i2c masters must have their status "disabled". This driver will134enable them at runtime when needed.135136137