162306a36Sopenharmony_ciRegister-based I2C Bus Mux
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThis binding describes an I2C bus multiplexer that uses a single register
462306a36Sopenharmony_cito route the I2C signals.
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciRequired properties:
762306a36Sopenharmony_ci- compatible: i2c-mux-reg
862306a36Sopenharmony_ci- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
962306a36Sopenharmony_ci  port is connected to.
1062306a36Sopenharmony_ci* Standard I2C mux properties. See i2c-mux.yaml in this directory.
1162306a36Sopenharmony_ci* I2C child bus nodes. See i2c-mux.yaml in this directory.
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciOptional properties:
1462306a36Sopenharmony_ci- reg: this pair of <offset size> specifies the register to control the mux.
1562306a36Sopenharmony_ci  The <offset size> depends on its parent node. It can be any memory-mapped
1662306a36Sopenharmony_ci  address. The size must be either 1, 2, or 4 bytes. If reg is omitted, the
1762306a36Sopenharmony_ci  resource of this device will be used.
1862306a36Sopenharmony_ci- little-endian: The existence indicates the register is in little endian.
1962306a36Sopenharmony_ci- big-endian: The existence indicates the register is in big endian.
2062306a36Sopenharmony_ci  If both little-endian and big-endian are omitted, the endianness of the
2162306a36Sopenharmony_ci  CPU will be used.
2262306a36Sopenharmony_ci- write-only: The existence indicates the register is write-only.
2362306a36Sopenharmony_ci- idle-state: value to set the muxer to when idle. When no value is
2462306a36Sopenharmony_ci  given, it defaults to the last value used.
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciWhenever an access is made to a device on a child bus, the value set
2762306a36Sopenharmony_ciin the relevant node's reg property will be output to the register.
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciIf an idle state is defined, using the idle-state (optional) property,
3062306a36Sopenharmony_ciwhenever an access is not being made to a device on a child bus, the
3162306a36Sopenharmony_ciregister will be set according to the idle value.
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ciIf an idle state is not defined, the most recently used value will be
3462306a36Sopenharmony_cileft programmed into the register.
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ciExample of a mux on PCIe card, the host is a powerpc SoC (big endian):
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci	i2c-mux {
3962306a36Sopenharmony_ci		/* the <offset size> depends on the address translation
4062306a36Sopenharmony_ci		 * of the parent device. If omitted, device resource
4162306a36Sopenharmony_ci		 * will be used instead. The size is to determine
4262306a36Sopenharmony_ci		 * whether iowrite32, iowrite16, or iowrite8 will be used.
4362306a36Sopenharmony_ci		 */
4462306a36Sopenharmony_ci		reg = <0x6028 0x4>;
4562306a36Sopenharmony_ci		little-endian;		/* little endian register on PCIe */
4662306a36Sopenharmony_ci		compatible = "i2c-mux-reg";
4762306a36Sopenharmony_ci		#address-cells = <1>;
4862306a36Sopenharmony_ci		#size-cells = <0>;
4962306a36Sopenharmony_ci		i2c-parent = <&i2c1>;
5062306a36Sopenharmony_ci		i2c@0 {
5162306a36Sopenharmony_ci			reg = <0>;
5262306a36Sopenharmony_ci			#address-cells = <1>;
5362306a36Sopenharmony_ci			#size-cells = <0>;
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci			si5338: clock-generator@70 {
5662306a36Sopenharmony_ci				compatible = "silabs,si5338";
5762306a36Sopenharmony_ci				reg = <0x70>;
5862306a36Sopenharmony_ci				/* other stuff */
5962306a36Sopenharmony_ci			};
6062306a36Sopenharmony_ci		};
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci		i2c@1 {
6362306a36Sopenharmony_ci			/* data is written using iowrite32 */
6462306a36Sopenharmony_ci			reg = <1>;
6562306a36Sopenharmony_ci			#address-cells = <1>;
6662306a36Sopenharmony_ci			#size-cells = <0>;
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci			si5338: clock-generator@70 {
6962306a36Sopenharmony_ci				compatible = "silabs,si5338";
7062306a36Sopenharmony_ci				reg = <0x70>;
7162306a36Sopenharmony_ci				/* other stuff */
7262306a36Sopenharmony_ci			};
7362306a36Sopenharmony_ci		};
7462306a36Sopenharmony_ci	};
75