0107-New-overlay-for-PiScreen2r.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. From 2f5387400fcd2aff2120e945dc0b8050c5ae5dbf Mon Sep 17 00:00:00 2001
  2. From: mwilliams03 <mark.mwilliams@gmail.com>
  3. Date: Sun, 18 Oct 2015 17:07:24 -0700
  4. Subject: [PATCH 107/381] New overlay for PiScreen2r
  5. ---
  6. arch/arm/boot/dts/overlays/Makefile | 1 +
  7. arch/arm/boot/dts/overlays/README | 14 +++
  8. arch/arm/boot/dts/overlays/piscreen2r-overlay.dts | 100 ++++++++++++++++++++++
  9. 3 files changed, 115 insertions(+)
  10. create mode 100644 arch/arm/boot/dts/overlays/piscreen2r-overlay.dts
  11. --- a/arch/arm/boot/dts/overlays/Makefile
  12. +++ b/arch/arm/boot/dts/overlays/Makefile
  13. @@ -35,6 +35,7 @@ dtb-$(RPI_DT_OVERLAYS) += mcp2515-can1-o
  14. dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
  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-resistive-overlay.dtb
  19. dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
  20. dtb-$(RPI_DT_OVERLAYS) += pwm-overlay.dtb
  21. --- a/arch/arm/boot/dts/overlays/README
  22. +++ b/arch/arm/boot/dts/overlays/README
  23. @@ -425,6 +425,20 @@ Params: speed Display
  24. xohms Touchpanel sensitivity (X-plate resistance)
  25. +Name: piscreen2r
  26. +Info: PiScreen 2 with resistive TP display by OzzMaker.com
  27. +Load: dtoverlay=piscreen2r,<param>=<val>
  28. +Params: speed Display SPI bus speed
  29. +
  30. + rotate Display rotation {0,90,180,270}
  31. +
  32. + fps Delay between frame updates
  33. +
  34. + debug Debug output level {0-7}
  35. +
  36. + xohms Touchpanel sensitivity (X-plate resistance)
  37. +
  38. +
  39. Name: pitft28-resistive
  40. Info: Adafruit PiTFT 2.8" resistive touch screen
  41. Load: dtoverlay=pitft28-resistive,<param>=<val>
  42. --- /dev/null
  43. +++ b/arch/arm/boot/dts/overlays/piscreen2r-overlay.dts
  44. @@ -0,0 +1,100 @@
  45. + /*
  46. + * Device Tree overlay for PiScreen2 3.5" TFT with resistive touch by Ozzmaker.com
  47. + *
  48. + */
  49. +
  50. +/dts-v1/;
  51. +/plugin/;
  52. +
  53. +/ {
  54. + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
  55. +
  56. + fragment@0 {
  57. + target = <&spi0>;
  58. + __overlay__ {
  59. + status = "okay";
  60. +
  61. + spidev@0{
  62. + status = "disabled";
  63. + };
  64. +
  65. + spidev@1{
  66. + status = "disabled";
  67. + };
  68. + };
  69. + };
  70. +
  71. + fragment@1 {
  72. + target = <&gpio>;
  73. + __overlay__ {
  74. + piscreen2_pins: piscreen2_pins {
  75. + brcm,pins = <17 25 24 22>;
  76. + brcm,function = <0 1 1 1>; /* in out out out */
  77. + };
  78. + };
  79. + };
  80. +
  81. + fragment@2 {
  82. + target = <&spi0>;
  83. + __overlay__ {
  84. + /* needed to avoid dtc warning */
  85. + #address-cells = <1>;
  86. + #size-cells = <0>;
  87. +
  88. + piscreen2: piscreen2@0{
  89. + compatible = "ilitek,ili9486";
  90. + reg = <0>;
  91. + pinctrl-names = "default";
  92. + pinctrl-0 = <&piscreen2_pins>;
  93. + bgr;
  94. + spi-max-frequency = <64000000>;
  95. + rotate = <90>;
  96. + fps = <30>;
  97. + buswidth = <8>;
  98. + regwidth = <16>;
  99. + txbuflen = <32768>;
  100. + reset-gpios = <&gpio 25 0>;
  101. + dc-gpios = <&gpio 24 0>;
  102. + led-gpios = <&gpio 22 1>;
  103. + debug = <0>;
  104. +
  105. + init = <0x10000b0 0x00
  106. + 0x1000011
  107. + 0x20000ff
  108. + 0x100003a 0x55
  109. + 0x1000036 0x28
  110. + 0x10000c0 0x11 0x09
  111. + 0x10000c1 0x41
  112. + 0x10000c5 0x00 0x00 0x00 0x00
  113. + 0x10000b6 0x00 0x02
  114. + 0x10000f7 0xa9 0x51 0x2c 0x2
  115. + 0x10000be 0x00 0x04
  116. + 0x10000e9 0x00
  117. + 0x1000011
  118. + 0x1000029>;
  119. +
  120. + };
  121. +
  122. + piscreen2_ts: piscreen2-ts@1 {
  123. + compatible = "ti,ads7846";
  124. + reg = <1>;
  125. +
  126. + spi-max-frequency = <2000000>;
  127. + interrupts = <17 2>; /* high-to-low edge triggered */
  128. + interrupt-parent = <&gpio>;
  129. + pendown-gpio = <&gpio 17 0>;
  130. + ti,swap-xy;
  131. + ti,x-plate-ohms = /bits/ 16 <100>;
  132. + ti,pressure-max = /bits/ 16 <255>;
  133. + };
  134. + };
  135. + };
  136. + __overrides__ {
  137. + speed = <&piscreen2>,"spi-max-frequency:0";
  138. + rotate = <&piscreen2>,"rotate:0";
  139. + fps = <&piscreen2>,"fps:0";
  140. + debug = <&piscreen2>,"debug:0";
  141. + xohms = <&piscreen2_ts>,"ti,x-plate-ohms;0";
  142. + };
  143. +};
  144. +