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