0304-dts-add-overlay-for-pitft22.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. From 9a5679751907b45b2470c02322dff8e87980464a Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter@technux.se>
  3. Date: Fri, 8 Jan 2016 09:02:44 +0100
  4. Subject: [PATCH] dts: add overlay for pitft22
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Add the pitft22 overlay from adafruit Adafruit-Pi-Kernel-o-Matic repo:
  9. https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic
  10. Signed-off-by: Petter Mabäcker <petter@technux.se>
  11. Signed-off-by: Andrei Gherzan <andrei@resin.io>
  12. ---
  13. arch/arm/boot/dts/overlays/Makefile | 1 +
  14. arch/arm/boot/dts/overlays/README | 12 +++++
  15. arch/arm/boot/dts/overlays/pitft22-overlay.dts | 69 ++++++++++++++++++++++++++
  16. 3 files changed, 82 insertions(+)
  17. create mode 100644 arch/arm/boot/dts/overlays/pitft22-overlay.dts
  18. --- a/arch/arm/boot/dts/overlays/Makefile
  19. +++ b/arch/arm/boot/dts/overlays/Makefile
  20. @@ -51,6 +51,7 @@ dtbo-$(RPI_DT_OVERLAYS) += pi3-disable-b
  21. dtbo-$(RPI_DT_OVERLAYS) += pi3-miniuart-bt.dtbo
  22. dtbo-$(RPI_DT_OVERLAYS) += piscreen.dtbo
  23. dtbo-$(RPI_DT_OVERLAYS) += piscreen2r.dtbo
  24. +dtbo-$(RPI_DT_OVERLAYS) += pitft22.dtbo
  25. dtbo-$(RPI_DT_OVERLAYS) += pitft28-capacitive.dtbo
  26. dtbo-$(RPI_DT_OVERLAYS) += pitft28-resistive.dtbo
  27. dtbo-$(RPI_DT_OVERLAYS) += pps-gpio.dtbo
  28. --- a/arch/arm/boot/dts/overlays/README
  29. +++ b/arch/arm/boot/dts/overlays/README
  30. @@ -644,6 +644,18 @@ Params: speed Display
  31. xohms Touchpanel sensitivity (X-plate resistance)
  32. +Name: pitft22
  33. +Info: Adafruit PiTFT 2.2" screen
  34. +Load: dtoverlay=pitft22,<param>=<val>
  35. +Params: speed Display SPI bus speed
  36. +
  37. + rotate Display rotation {0,90,180,270}
  38. +
  39. + fps Delay between frame updates
  40. +
  41. + debug Debug output level {0-7}
  42. +
  43. +
  44. Name: pitft28-capacitive
  45. Info: Adafruit PiTFT 2.8" capacitive touch screen
  46. Load: dtoverlay=pitft28-capacitive,<param>=<val>
  47. --- /dev/null
  48. +++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts
  49. @@ -0,0 +1,69 @@
  50. +/*
  51. + * Device Tree overlay for pitft by Adafruit
  52. + *
  53. + */
  54. +
  55. +/dts-v1/;
  56. +/plugin/;
  57. +
  58. +/ {
  59. + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
  60. +
  61. + fragment@0 {
  62. + target = <&spi0>;
  63. + __overlay__ {
  64. + status = "okay";
  65. +
  66. + spidev@0{
  67. + status = "disabled";
  68. + };
  69. +
  70. + spidev@1{
  71. + status = "disabled";
  72. + };
  73. + };
  74. + };
  75. +
  76. + fragment@1 {
  77. + target = <&gpio>;
  78. + __overlay__ {
  79. + pitft_pins: pitft_pins {
  80. + brcm,pins = <25>;
  81. + brcm,function = <1>; /* out */
  82. + brcm,pull = <0>; /* none */
  83. + };
  84. + };
  85. + };
  86. +
  87. + fragment@2 {
  88. + target = <&spi0>;
  89. + __overlay__ {
  90. + /* needed to avoid dtc warning */
  91. + #address-cells = <1>;
  92. + #size-cells = <0>;
  93. +
  94. + pitft: pitft@0{
  95. + compatible = "ilitek,ili9340";
  96. + reg = <0>;
  97. + pinctrl-names = "default";
  98. + pinctrl-0 = <&pitft_pins>;
  99. +
  100. + spi-max-frequency = <32000000>;
  101. + rotate = <90>;
  102. + fps = <25>;
  103. + bgr;
  104. + buswidth = <8>;
  105. + dc-gpios = <&gpio 25 0>;
  106. + debug = <0>;
  107. + };
  108. +
  109. + };
  110. + };
  111. +
  112. + __overrides__ {
  113. + speed = <&pitft>,"spi-max-frequency:0";
  114. + rotate = <&pitft>,"rotate:0";
  115. + fps = <&pitft>,"fps:0";
  116. + debug = <&pitft>,"debug:0";
  117. + };
  118. +};