0341-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. From 76abdcc15b223ab75922f38c1cab6d224510af52 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Wed, 11 May 2016 15:38:04 +0100
  4. Subject: [PATCH] BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux
  5. This overlay supports a range of I2C multiplexers - PCA9542 (2 ports),
  6. PCA9545 (4 ports) and PCA9548 (8 ports).
  7. Also remove the dedicated i2c-mux-9548a overlays since it is no longer
  8. needed.
  9. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  10. ---
  11. arch/arm/boot/dts/overlays/Makefile | 2 +-
  12. arch/arm/boot/dts/overlays/README | 17 ++-
  13. arch/arm/boot/dts/overlays/i2c-mux-overlay.dts | 138 +++++++++++++++++++++
  14. .../boot/dts/overlays/i2c-mux-pca9548a-overlay.dts | 67 ----------
  15. 4 files changed, 152 insertions(+), 72 deletions(-)
  16. create mode 100644 arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
  17. delete mode 100644 arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts
  18. --- a/arch/arm/boot/dts/overlays/Makefile
  19. +++ b/arch/arm/boot/dts/overlays/Makefile
  20. @@ -34,7 +34,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo
  21. dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo
  22. dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
  23. dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
  24. -dtbo-$(RPI_DT_OVERLAYS) += i2c-mux-pca9548a.dtbo
  25. +dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo
  26. dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
  27. dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
  28. dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
  29. --- a/arch/arm/boot/dts/overlays/README
  30. +++ b/arch/arm/boot/dts/overlays/README
  31. @@ -421,10 +421,19 @@ Params: i2c_gpio_sda GPIO use
  32. (default "2" = ~100kHz)
  33. -Name: i2c-mux-pca9548a
  34. -Info: Adds support for an NXP PCA9548A I2C multiplexer on i2c_arm
  35. -Load: dtoverlay=i2c-mux-pca9548a,<param>=<val>
  36. -Params: addr I2C address of PCA9548A (default 0x70)
  37. +Name: i2c-mux
  38. +Info: Adds support for a number of I2C bus multiplexers on i2c_arm
  39. +Load: dtoverlay=i2c-mux,<param>=<val>
  40. +Params: pca9542 Select the NXP PCA9542 device
  41. +
  42. + pca9545 Select the NXP PCA9545 device
  43. +
  44. + pca9548 Select the NXP PCA9548 device
  45. +
  46. + addr Change I2C address of the device (default 0x70)
  47. +
  48. +
  49. +[ The i2c-mux-pca9548a overlay has been deleted. See i2c-mux. ]
  50. Name: i2c-pwm-pca9685a
  51. --- /dev/null
  52. +++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
  53. @@ -0,0 +1,138 @@
  54. +// Umbrella I2C Mux overlay
  55. +
  56. +/dts-v1/;
  57. +/plugin/;
  58. +
  59. +/{
  60. + compatible = "brcm,bcm2708";
  61. +
  62. + fragment@0 {
  63. + target = <&i2c_arm>;
  64. + __dormant__ {
  65. + #address-cells = <1>;
  66. + #size-cells = <0>;
  67. + status = "okay";
  68. +
  69. + pca9542: mux@70 {
  70. + compatible = "nxp,pca9542";
  71. + reg = <0x70>;
  72. + #address-cells = <1>;
  73. + #size-cells = <0>;
  74. +
  75. + i2c@0 {
  76. + #address-cells = <1>;
  77. + #size-cells = <0>;
  78. + reg = <0>;
  79. + };
  80. + i2c@1 {
  81. + #address-cells = <1>;
  82. + #size-cells = <0>;
  83. + reg = <1>;
  84. + };
  85. + };
  86. + };
  87. + };
  88. +
  89. + fragment@1 {
  90. + target = <&i2c_arm>;
  91. + __dormant__ {
  92. + #address-cells = <1>;
  93. + #size-cells = <0>;
  94. + status = "okay";
  95. +
  96. + pca9545: mux@70 {
  97. + compatible = "nxp,pca9545";
  98. + reg = <0x70>;
  99. + #address-cells = <1>;
  100. + #size-cells = <0>;
  101. +
  102. + i2c@0 {
  103. + #address-cells = <1>;
  104. + #size-cells = <0>;
  105. + reg = <0>;
  106. + };
  107. + i2c@1 {
  108. + #address-cells = <1>;
  109. + #size-cells = <0>;
  110. + reg = <1>;
  111. + };
  112. + i2c@2 {
  113. + #address-cells = <1>;
  114. + #size-cells = <0>;
  115. + reg = <2>;
  116. + };
  117. + i2c@3 {
  118. + #address-cells = <1>;
  119. + #size-cells = <0>;
  120. + reg = <3>;
  121. + };
  122. + };
  123. + };
  124. + };
  125. +
  126. + fragment@2 {
  127. + target = <&i2c_arm>;
  128. + __dormant__ {
  129. + #address-cells = <1>;
  130. + #size-cells = <0>;
  131. + status = "okay";
  132. +
  133. + pca9548: mux@70 {
  134. + compatible = "nxp,pca9548";
  135. + reg = <0x70>;
  136. + #address-cells = <1>;
  137. + #size-cells = <0>;
  138. +
  139. + i2c@0 {
  140. + #address-cells = <1>;
  141. + #size-cells = <0>;
  142. + reg = <0>;
  143. + };
  144. + i2c@1 {
  145. + #address-cells = <1>;
  146. + #size-cells = <0>;
  147. + reg = <1>;
  148. + };
  149. + i2c@2 {
  150. + #address-cells = <1>;
  151. + #size-cells = <0>;
  152. + reg = <2>;
  153. + };
  154. + i2c@3 {
  155. + #address-cells = <1>;
  156. + #size-cells = <0>;
  157. + reg = <3>;
  158. + };
  159. + i2c@4 {
  160. + #address-cells = <1>;
  161. + #size-cells = <0>;
  162. + reg = <4>;
  163. + };
  164. + i2c@5 {
  165. + #address-cells = <1>;
  166. + #size-cells = <0>;
  167. + reg = <5>;
  168. + };
  169. + i2c@6 {
  170. + #address-cells = <1>;
  171. + #size-cells = <0>;
  172. + reg = <6>;
  173. + };
  174. + i2c@7 {
  175. + #address-cells = <1>;
  176. + #size-cells = <0>;
  177. + reg = <7>;
  178. + };
  179. + };
  180. + };
  181. + };
  182. +
  183. + __overrides__ {
  184. + pca9542 = <0>, "+0";
  185. + pca9545 = <0>, "+1";
  186. + pca9548 = <0>, "+2";
  187. +
  188. + addr = <&pca9545>,"reg:0",
  189. + <&pca9548>,"reg:0";
  190. + };
  191. +};
  192. --- a/arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts
  193. +++ /dev/null
  194. @@ -1,67 +0,0 @@
  195. -// Definitions for NXP PCA9548A I2C mux on ARM I2C bus.
  196. -/dts-v1/;
  197. -/plugin/;
  198. -
  199. -/{
  200. - compatible = "brcm,bcm2708";
  201. -
  202. - fragment@0 {
  203. - target = <&i2c_arm>;
  204. - __overlay__ {
  205. - #address-cells = <1>;
  206. - #size-cells = <0>;
  207. - status = "okay";
  208. -
  209. - i2cmux: mux@70 {
  210. - compatible = "nxp,pca9548";
  211. - reg = <0x70>;
  212. - #address-cells = <1>;
  213. - #size-cells = <0>;
  214. -
  215. - i2c@0 {
  216. - #address-cells = <1>;
  217. - #size-cells = <0>;
  218. - reg = <0>;
  219. - };
  220. - i2c@1 {
  221. - #address-cells = <1>;
  222. - #size-cells = <0>;
  223. - reg = <1>;
  224. - };
  225. - i2c@2 {
  226. - #address-cells = <1>;
  227. - #size-cells = <0>;
  228. - reg = <2>;
  229. - };
  230. - i2c@3 {
  231. - #address-cells = <1>;
  232. - #size-cells = <0>;
  233. - reg = <3>;
  234. - };
  235. - i2c@4 {
  236. - #address-cells = <1>;
  237. - #size-cells = <0>;
  238. - reg = <4>;
  239. - };
  240. - i2c@5 {
  241. - #address-cells = <1>;
  242. - #size-cells = <0>;
  243. - reg = <5>;
  244. - };
  245. - i2c@6 {
  246. - #address-cells = <1>;
  247. - #size-cells = <0>;
  248. - reg = <6>;
  249. - };
  250. - i2c@7 {
  251. - #address-cells = <1>;
  252. - #size-cells = <0>;
  253. - reg = <7>;
  254. - };
  255. - };
  256. - };
  257. - };
  258. - __overrides__ {
  259. - addr = <&i2cmux>,"reg:0";
  260. - };
  261. -};