Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) Pinctrl-based I2C Bus Mux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) This binding describes an I2C bus multiplexer that uses pin multiplexing to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) route the I2C signals, and represents the pin multiplexing configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) using the pinctrl device tree bindings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)                                  +-----+  +-----+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)                                  | dev |  | dev |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)     +------------------------+   +-----+  +-----+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)     | SoC                    |      |        |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)     |                   /----|------+--------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)     |   +---+   +------+     | child bus A, on first set of pins
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)     |   |I2C|---|Pinmux|     |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)     |   +---+   +------+     | child bus B, on second set of pins
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)     |                   \----|------+--------+--------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)     |                        |      |        |        |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)     +------------------------+  +-----+  +-----+  +-----+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)                                 | dev |  | dev |  | dev |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)                                 +-----+  +-----+  +-----+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) Required properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) - compatible: i2c-mux-pinctrl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) - i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)   port is connected to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) Also required are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * Standard pinctrl properties that specify the pin mux state for each child
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)   bus. See ../pinctrl/pinctrl-bindings.txt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * Standard I2C mux properties. See i2c-mux.txt in this directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * I2C child bus nodes. See i2c-mux.txt in this directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) For each named state defined in the pinctrl-names property, an I2C child bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) will be created. I2C child bus numbers are assigned based on the index into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) the pinctrl-names property.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) The only exception is that no bus will be created for a state named "idle". If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) such a state is defined, it must be the last entry in pinctrl-names. For
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	pinctrl-names = "ddc", "pta", "idle"  ->  ddc = bus 0, pta = bus 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	pinctrl-names = "ddc", "idle", "pta"  ->  Invalid ("idle" not last)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	pinctrl-names = "idle", "ddc", "pta"  ->  Invalid ("idle" not last)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) Whenever an access is made to a device on a child bus, the relevant pinctrl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) state will be programmed into hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) If an idle state is defined, whenever an access is not being made to a device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) on a child bus, the idle pinctrl state will be programmed into hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) If an idle state is not defined, the most recently used pinctrl state will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) left programmed into hardware whenever no access is being made of a device on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) a child bus.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	i2cmux {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 		compatible = "i2c-mux-pinctrl";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 		#address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 		#size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 		i2c-parent = <&i2c1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 		pinctrl-names = "ddc", "pta", "idle";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 		pinctrl-0 = <&state_i2cmux_ddc>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 		pinctrl-1 = <&state_i2cmux_pta>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 		pinctrl-2 = <&state_i2cmux_idle>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) 		i2c@0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 			reg = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 			#address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) 			#size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) 			eeprom {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) 				compatible = "eeprom";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) 				reg = <0x50>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) 		i2c@1 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) 			reg = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) 			#address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) 			#size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) 			eeprom {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) 				compatible = "eeprom";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) 				reg = <0x50>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)