0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. From b69e933e051a52e91c1b0acf8d0edc132b6de10e Mon Sep 17 00:00:00 2001
  2. From: Ondrej Wisniewski <ondrej.wisniewski@gmail.com>
  3. Date: Fri, 6 Nov 2015 15:01:28 +0100
  4. Subject: [PATCH] dts: Added overlay for Adafruit PiTFT 2.8" capacitive touch
  5. screen
  6. ---
  7. arch/arm/boot/dts/overlays/Makefile | 1 +
  8. arch/arm/boot/dts/overlays/README | 22 ++++++
  9. .../dts/overlays/pitft28-capacitive-overlay.dts | 88 ++++++++++++++++++++++
  10. 3 files changed, 111 insertions(+)
  11. create mode 100644 arch/arm/boot/dts/overlays/pitft28-capacitive-overlay.dts
  12. --- a/arch/arm/boot/dts/overlays/Makefile
  13. +++ b/arch/arm/boot/dts/overlays/Makefile
  14. @@ -36,6 +36,7 @@ dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dt
  15. dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
  16. dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
  17. dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb
  18. +dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb
  19. dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
  20. dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
  21. dtb-$(RPI_DT_OVERLAYS) += pwm-overlay.dtb
  22. --- a/arch/arm/boot/dts/overlays/README
  23. +++ b/arch/arm/boot/dts/overlays/README
  24. @@ -439,6 +439,28 @@ Params: speed Display
  25. xohms Touchpanel sensitivity (X-plate resistance)
  26. +Name: pitft28-capacitive
  27. +Info: Adafruit PiTFT 2.8" capacitive touch screen
  28. +Load: dtoverlay=pitft28-capacitive,<param>=<val>
  29. +Params: speed Display SPI bus speed
  30. +
  31. + rotate Display rotation {0,90,180,270}
  32. +
  33. + fps Delay between frame updates
  34. +
  35. + debug Debug output level {0-7}
  36. +
  37. + touch-sizex Touchscreen size x (default 240)
  38. +
  39. + touch-sizey Touchscreen size y (default 320)
  40. +
  41. + touch-invx Touchscreen inverted x axis
  42. +
  43. + touch-invy Touchscreen inverted y axis
  44. +
  45. + touch-swapxy Touchscreen swapped x y axis
  46. +
  47. +
  48. Name: pitft28-resistive
  49. Info: Adafruit PiTFT 2.8" resistive touch screen
  50. Load: dtoverlay=pitft28-resistive,<param>=<val>
  51. --- /dev/null
  52. +++ b/arch/arm/boot/dts/overlays/pitft28-capacitive-overlay.dts
  53. @@ -0,0 +1,88 @@
  54. +/*
  55. + * Device Tree overlay for Adafruit PiTFT 2.8" capacitive touch screen
  56. + *
  57. + */
  58. +
  59. +/dts-v1/;
  60. +/plugin/;
  61. +
  62. +/ {
  63. + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
  64. +
  65. + fragment@0 {
  66. + target = <&spi0>;
  67. + __overlay__ {
  68. + status = "okay";
  69. +
  70. + spidev@0{
  71. + status = "disabled";
  72. + };
  73. + };
  74. + };
  75. +
  76. + fragment@1 {
  77. + target = <&gpio>;
  78. + __overlay__ {
  79. + pitft_pins: pitft_pins {
  80. + brcm,pins = <24 25>;
  81. + brcm,function = <0 1>; /* in out */
  82. + brcm,pull = <2 0>; /* pullup 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. + fragment@3 {
  112. + target = <&i2c1>;
  113. + __overlay__ {
  114. + /* needed to avoid dtc warning */
  115. + #address-cells = <1>;
  116. + #size-cells = <0>;
  117. +
  118. + ft6236: ft6236@38 {
  119. + compatible = "focaltech,ft6236";
  120. + reg = <0x38>;
  121. +
  122. + interrupt-parent = <&gpio>;
  123. + interrupts = <24 2>;
  124. + touchscreen-size-x = <240>;
  125. + touchscreen-size-y = <320>;
  126. + };
  127. + };
  128. + };
  129. +
  130. + __overrides__ {
  131. + speed = <&pitft>,"spi-max-frequency:0";
  132. + rotate = <&pitft>,"rotate:0";
  133. + fps = <&pitft>,"fps:0";
  134. + debug = <&pitft>,"debug:0";
  135. + touch-sizex = <&ft6236>,"touchscreen-size-x?";
  136. + touch-sizey = <&ft6236>,"touchscreen-size-y?";
  137. + touch-invx = <&ft6236>,"touchscreen-inverted-x?";
  138. + touch-invy = <&ft6236>,"touchscreen-inverted-y?";
  139. + touch-swapxy = <&ft6236>,"touchscreen-swapped-x-y?";
  140. + };
  141. +};