i2c-mux-reg.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Register-based I2C Bus Mux
  2. This binding describes an I2C bus multiplexer that uses a single register
  3. to route the I2C signals.
  4. Required properties:
  5. - compatible: i2c-mux-reg
  6. - i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
  7. port is connected to.
  8. * Standard I2C mux properties. See mux.txt in this directory.
  9. * I2C child bus nodes. See mux.txt in this directory.
  10. Optional properties:
  11. - reg: this pair of <offset size> specifies the register to control the mux.
  12. The <offset size> depends on its parent node. It can be any memory-mapped
  13. address. The size must be either 1, 2, or 4 bytes. If reg is omitted, the
  14. resource of this device will be used.
  15. - little-endian: The existence indicates the register is in little endian.
  16. - big-endian: The existence indicates the register is in big endian.
  17. If both little-endian and big-endian are omitted, the endianness of the
  18. CPU will be used.
  19. - write-only: The existence indicates the register is write-only.
  20. - idle-state: value to set the muxer to when idle. When no value is
  21. given, it defaults to the last value used.
  22. Whenever an access is made to a device on a child bus, the value set
  23. in the revelant node's reg property will be output to the register.
  24. If an idle state is defined, using the idle-state (optional) property,
  25. whenever an access is not being made to a device on a child bus, the
  26. register will be set according to the idle value.
  27. If an idle state is not defined, the most recently used value will be
  28. left programmed into the register.
  29. Example of a mux on PCIe card, the host is a powerpc SoC (big endian):
  30. i2c-mux {
  31. /* the <offset size> depends on the address translation
  32. * of the parent device. If omitted, device resource
  33. * will be used instead. The size is to determine
  34. * whether iowrite32, iowrite16, or iowrite8 will be used.
  35. */
  36. reg = <0x6028 0x4>;
  37. little-endian; /* little endian register on PCIe */
  38. compatible = "i2c-mux-reg";
  39. #address-cells = <1>;
  40. #size-cells = <0>;
  41. i2c-parent = <&i2c1>;
  42. i2c@0 {
  43. reg = <0>;
  44. #address-cells = <1>;
  45. #size-cells = <0>;
  46. si5338: clock-generator@70 {
  47. compatible = "silabs,si5338";
  48. reg = <0x70>;
  49. /* other stuff */
  50. };
  51. };
  52. i2c@1 {
  53. /* data is written using iowrite32 */
  54. reg = <1>;
  55. #address-cells = <1>;
  56. #size-cells = <0>;
  57. si5338: clock-generator@70 {
  58. compatible = "silabs,si5338";
  59. reg = <0x70>;
  60. /* other stuff */
  61. };
  62. };
  63. };