0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. From 7a08c498e9f5c7ddd27e7f1956fa532cba009cd4 Mon Sep 17 00:00:00 2001
  2. From: Dave Stevenson <6by9@users.noreply.github.com>
  3. Date: Thu, 17 Mar 2016 18:16:16 +0000
  4. Subject: [PATCH] Add configs and overlay for PCA9548 I2C mux
  5. Adds kernel configs for I2C muxes and a dt overlay for PCA9548
  6. that adds the 8 muxed I2C buses and mux device.
  7. ---
  8. arch/arm/boot/dts/overlays/Makefile | 1 +
  9. arch/arm/boot/dts/overlays/README | 6 ++
  10. .../boot/dts/overlays/i2c-mux-pca9548a-overlay.dts | 67 ++++++++++++++++++++++
  11. arch/arm/configs/bcm2709_defconfig | 2 +
  12. arch/arm/configs/bcmrpi_defconfig | 2 +
  13. 5 files changed, 78 insertions(+)
  14. create mode 100644 arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts
  15. --- a/arch/arm/boot/dts/overlays/Makefile
  16. +++ b/arch/arm/boot/dts/overlays/Makefile
  17. @@ -29,6 +29,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo
  18. dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo
  19. dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
  20. dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
  21. +dtbo-$(RPI_DT_OVERLAYS) += i2c-mux-pca9548a.dtbo
  22. dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
  23. dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
  24. dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo
  25. --- a/arch/arm/boot/dts/overlays/README
  26. +++ b/arch/arm/boot/dts/overlays/README
  27. @@ -360,6 +360,12 @@ Params: i2c_gpio_sda GPIO use
  28. (default "2" = ~100kHz)
  29. +Name: i2c-mux-pca9548a
  30. +Info: Adds support for an NXP PCA9548A I2C multiplexer on i2c_arm
  31. +Load: dtoverlay=i2c-mux-pca9548a,<param>=<val>
  32. +Params: addr I2C address of PCA9548A (default 0x70)
  33. +
  34. +
  35. Name: i2c-rtc
  36. Info: Adds support for a number of I2C Real Time Clock devices
  37. Load: dtoverlay=i2c-rtc,<param>=<val>
  38. --- /dev/null
  39. +++ b/arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts
  40. @@ -0,0 +1,67 @@
  41. +// Definitions for NXP PCA9548A I2C mux on ARM I2C bus.
  42. +/dts-v1/;
  43. +/plugin/;
  44. +
  45. +/{
  46. + compatible = "brcm,bcm2708";
  47. +
  48. + fragment@0 {
  49. + target = <&i2c_arm>;
  50. + __overlay__ {
  51. + #address-cells = <1>;
  52. + #size-cells = <0>;
  53. + status = "okay";
  54. +
  55. + i2cmux: mux@70 {
  56. + compatible = "nxp,pca9548";
  57. + reg = <0x70>;
  58. + #address-cells = <1>;
  59. + #size-cells = <0>;
  60. +
  61. + i2c@0 {
  62. + #address-cells = <1>;
  63. + #size-cells = <0>;
  64. + reg = <0>;
  65. + };
  66. + i2c@1 {
  67. + #address-cells = <1>;
  68. + #size-cells = <0>;
  69. + reg = <1>;
  70. + };
  71. + i2c@2 {
  72. + #address-cells = <1>;
  73. + #size-cells = <0>;
  74. + reg = <2>;
  75. + };
  76. + i2c@3 {
  77. + #address-cells = <1>;
  78. + #size-cells = <0>;
  79. + reg = <3>;
  80. + };
  81. + i2c@4 {
  82. + #address-cells = <1>;
  83. + #size-cells = <0>;
  84. + reg = <4>;
  85. + };
  86. + i2c@5 {
  87. + #address-cells = <1>;
  88. + #size-cells = <0>;
  89. + reg = <5>;
  90. + };
  91. + i2c@6 {
  92. + #address-cells = <1>;
  93. + #size-cells = <0>;
  94. + reg = <6>;
  95. + };
  96. + i2c@7 {
  97. + #address-cells = <1>;
  98. + #size-cells = <0>;
  99. + reg = <7>;
  100. + };
  101. + };
  102. + };
  103. + };
  104. + __overrides__ {
  105. + addr = <&i2cmux>,"reg:0";
  106. + };
  107. +};
  108. --- a/arch/arm/configs/bcm2709_defconfig
  109. +++ b/arch/arm/configs/bcm2709_defconfig
  110. @@ -600,6 +600,8 @@ CONFIG_I2C=y
  111. CONFIG_I2C_CHARDEV=m
  112. CONFIG_I2C_BCM2708=m
  113. CONFIG_I2C_GPIO=m
  114. +CONFIG_I2C_MUX=m
  115. +CONFIG_I2C_MUX_PCA954x=m
  116. CONFIG_SPI=y
  117. CONFIG_SPI_BCM2835=m
  118. CONFIG_SPI_BCM2835AUX=m
  119. --- a/arch/arm/configs/bcmrpi_defconfig
  120. +++ b/arch/arm/configs/bcmrpi_defconfig
  121. @@ -593,6 +593,8 @@ CONFIG_I2C=y
  122. CONFIG_I2C_CHARDEV=m
  123. CONFIG_I2C_BCM2708=m
  124. CONFIG_I2C_GPIO=m
  125. +CONFIG_I2C_MUX=m
  126. +CONFIG_I2C_MUX_PCA954x=m
  127. CONFIG_SPI=y
  128. CONFIG_SPI_BCM2835=m
  129. CONFIG_SPI_BCM2835AUX=m