0001 # SPDX-License-Identifier: GPL-2.0-only
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/i2c/i2c-mux-pinctrl.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Pinctrl-based I2C Bus Mux
0008
0009 maintainers:
0010 - Wolfram Sang <wsa@kernel.org>
0011
0012 description: |
0013 This binding describes an I2C bus multiplexer that uses pin multiplexing to route the I2C
0014 signals, and represents the pin multiplexing configuration using the pinctrl device tree
0015 bindings.
0016
0017 +-----+ +-----+
0018 | dev | | dev |
0019 +------------------------+ +-----+ +-----+
0020 | SoC | | |
0021 | /----|------+--------+
0022 | +---+ +------+ | child bus A, on first set of pins
0023 | |I2C|---|Pinmux| |
0024 | +---+ +------+ | child bus B, on second set of pins
0025 | \----|------+--------+--------+
0026 | | | | |
0027 +------------------------+ +-----+ +-----+ +-----+
0028 | dev | | dev | | dev |
0029 +-----+ +-----+ +-----+
0030
0031 For each named state defined in the pinctrl-names property, an I2C child bus will be created.
0032 I2C child bus numbers are assigned based on the index into the pinctrl-names property.
0033
0034 The only exception is that no bus will be created for a state named "idle". If such a state is
0035 defined, it must be the last entry in pinctrl-names. For example:
0036
0037 pinctrl-names = "ddc", "pta", "idle" -> ddc = bus 0, pta = bus 1
0038 pinctrl-names = "ddc", "idle", "pta" -> Invalid ("idle" not last)
0039 pinctrl-names = "idle", "ddc", "pta" -> Invalid ("idle" not last)
0040
0041 Whenever an access is made to a device on a child bus, the relevant pinctrl state will be
0042 programmed into hardware.
0043
0044 If an idle state is defined, whenever an access is not being made to a device on a child bus,
0045 the idle pinctrl state will be programmed into hardware.
0046
0047 If an idle state is not defined, the most recently used pinctrl state will be left programmed
0048 into hardware whenever no access is being made of a device on a child bus.
0049
0050 properties:
0051 compatible:
0052 const: i2c-mux-pinctrl
0053
0054 i2c-parent:
0055 $ref: /schemas/types.yaml#/definitions/phandle
0056 description: The phandle of the I2C bus that this multiplexer's master-side port is connected
0057 to.
0058
0059 allOf:
0060 - $ref: i2c-mux.yaml
0061
0062 unevaluatedProperties: false
0063
0064 required:
0065 - compatible
0066 - i2c-parent
0067
0068 examples:
0069 - |
0070 i2cmux {
0071 compatible = "i2c-mux-pinctrl";
0072 #address-cells = <1>;
0073 #size-cells = <0>;
0074
0075 i2c-parent = <&i2c1>;
0076
0077 pinctrl-names = "ddc", "pta", "idle";
0078 pinctrl-0 = <&state_i2cmux_ddc>;
0079 pinctrl-1 = <&state_i2cmux_pta>;
0080 pinctrl-2 = <&state_i2cmux_idle>;
0081
0082 i2c@0 {
0083 reg = <0>;
0084 #address-cells = <1>;
0085 #size-cells = <0>;
0086
0087 eeprom@50 {
0088 compatible = "atmel,24c02";
0089 reg = <0x50>;
0090 };
0091 };
0092
0093 i2c@1 {
0094 reg = <1>;
0095 #address-cells = <1>;
0096 #size-cells = <0>;
0097
0098 eeprom@50 {
0099 compatible = "atmel,24c02";
0100 reg = <0x50>;
0101 };
0102 };
0103 };