0322-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. From c451203424a277e522ea5227cefa84658615f442 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Fri, 6 May 2016 12:53:16 +0100
  4. Subject: [PATCH 322/381] BCM270X_DT: i2c0-bcm2708 - pin group params
  5. Add parameters to set pin groups as a unit, setting the pin function
  6. appropriately. The parameters are:
  7. pins_0_1
  8. pins_28_29
  9. pins_44_45
  10. pins_46_47
  11. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  12. ---
  13. arch/arm/boot/dts/overlays/README | 11 ++++--
  14. .../arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 43 +++++++++++++++++-----
  15. 2 files changed, 42 insertions(+), 12 deletions(-)
  16. --- a/arch/arm/boot/dts/overlays/README
  17. +++ b/arch/arm/boot/dts/overlays/README
  18. @@ -449,10 +449,15 @@ Params: ds1307 Select t
  19. Name: i2c0-bcm2708
  20. -Info: Enable the i2c_bcm2708 driver for the i2c0 bus
  21. +Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
  22. + are usable on all platforms.
  23. Load: dtoverlay=i2c0-bcm2708,<param>=<val>
  24. -Params: sda0_pin GPIO pin for SDA0 (0, 28 [or 44] - default 0)
  25. - scl0_pin GPIO pin for SCL0 (1, 29 [or 45] - default 1)
  26. +Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*)
  27. + scl0_pin GPIO pin for SCL0 (deprecated - use pins_*)
  28. + pins_0_1 Use pins 0 and 1 (default)
  29. + pins_28_29 Use pins 28 and 29
  30. + pins_44_45 Use pins 44 and 45
  31. + pins_46_47 Use pins 46 and 47
  32. Name: i2c1-bcm2708
  33. --- a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
  34. +++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
  35. @@ -14,23 +14,48 @@
  36. fragment@0 {
  37. target = <&i2c0>;
  38. __overlay__ {
  39. - pinctrl-0 = <&i2c0_pins>;
  40. status = "okay";
  41. };
  42. };
  43. fragment@1 {
  44. - target = <&gpio>;
  45. - __overlay__ {
  46. - i2c0_pins: i2c0 {
  47. - brcm,pins = <0 1>;
  48. - brcm,function = <4>; /* alt0 */
  49. - };
  50. + target = <&i2c0_pins>;
  51. + frag1: __overlay__ {
  52. + brcm,pins = <0 1>;
  53. + brcm,function = <4>; /* alt0 */
  54. + };
  55. + };
  56. +
  57. + fragment@2 {
  58. + target = <&i2c0_pins>;
  59. + __dormant__ {
  60. + brcm,pins = <28 29>;
  61. + brcm,function = <4>; /* alt0 */
  62. + };
  63. + };
  64. +
  65. + fragment@3 {
  66. + target = <&i2c0_pins>;
  67. + __dormant__ {
  68. + brcm,pins = <44 45>;
  69. + brcm,function = <5>; /* alt1 */
  70. + };
  71. + };
  72. +
  73. + fragment@4 {
  74. + target = <&i2c0_pins>;
  75. + __dormant__ {
  76. + brcm,pins = <46 47>;
  77. + brcm,function = <4>; /* alt0 */
  78. };
  79. };
  80. __overrides__ {
  81. - sda0_pin = <&i2c0_pins>,"brcm,pins:0";
  82. - scl0_pin = <&i2c0_pins>,"brcm,pins:4";
  83. + sda0_pin = <&frag1>,"brcm,pins:0";
  84. + scl0_pin = <&frag1>,"brcm,pins:4";
  85. + pins_0_1 = <0>,"+1-2-3-4";
  86. + pins_28_29 = <0>,"-1+2-3-4";
  87. + pins_44_45 = <0>,"-1-2+3-4";
  88. + pins_46_47 = <0>,"-1-2-3+4";
  89. };
  90. };