-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkernel-svga.diff
143 lines (139 loc) · 4.32 KB
/
kernel-svga.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
diff --git a/arch/arm/boot/dts/myd_c437x_evm.dts b/arch/arm/boot/dts/myd_c437x_evm.dts
index 9763db9..0d20102 100755
--- a/arch/arm/boot/dts/myd_c437x_evm.dts
+++ b/arch/arm/boot/dts/myd_c437x_evm.dts
@@ -110,15 +110,15 @@
label = "lcd";
panel-timing {
- clock-frequency = <36000000>;
- hactive = <800>;
- vactive = <480>;
- hfront-porch = <210>;
- hback-porch = <1>;
- hsync-len = <43>;
- vback-porch = <1>;
- vfront-porch = <22>;
- vsync-len = <22>;
+ clock-frequency = <65000000>;
+ hactive = <1024>;
+ vactive = <768>;
+ hfront-porch = <19>;
+ hback-porch = <159>;
+ hsync-len = <139>;
+ vback-porch = <31>;
+ vfront-porch = <2>;
+ vsync-len = <2>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
diff --git a/arch/arm/boot/dts/myd_y335x.dts b/arch/arm/boot/dts/myd_y335x.dts
index 24fbc45..8ab8721 100755
--- a/arch/arm/boot/dts/myd_y335x.dts
+++ b/arch/arm/boot/dts/myd_y335x.dts
@@ -154,17 +154,19 @@
display-timings {
800x480p62 {
- clock-frequency = <30000000>;
- hactive = <800>;
- vactive = <480>;
- hfront-porch = <39>;
- hback-porch = <39>;
- hsync-len = <47>;
- vback-porch = <29>;
- vfront-porch = <13>;
+ clock-frequency = <66000000>;
+ hactive = <1024>;
+ vactive = <768>;
+ hfront-porch = <13>;
+ hback-porch = <171>;
+ hsync-len = <137>;
+ vback-porch = <28>;
+ vfront-porch = <2>;
vsync-len = <2>;
- hsync-active = <1>;
- vsync-active = <1>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ de-active = <1>;
+ pixelclk-active = <1>;
};
};
};
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 6c62462..c990b77 100755
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -261,6 +261,10 @@ static void titsc_read_coordinates(struct titsc *ts_dev,
*y = ysum;
*x = xsum;
}
+#define CCREADS 5
+static unsigned int yyvals[CCREADS], xxvals[CCREADS];
+static unsigned int xxsum = 0, yysum = 0;
+static unsigned int ccreads = 0;
static irqreturn_t titsc_irq(int irq, void *dev)
{
@@ -281,6 +285,7 @@ static irqreturn_t titsc_irq(int irq, void *dev)
fsm = titsc_readl(ts_dev, REG_ADCFSM);
if (fsm == ADCFSM_STEPID) {
ts_dev->pen_down = false;
+ ccreads = 0;
input_report_key(input_dev, BTN_TOUCH, 0);
input_report_abs(input_dev, ABS_PRESSURE, 0);
input_sync(input_dev);
@@ -313,14 +318,50 @@ static irqreturn_t titsc_irq(int irq, void *dev)
z /= z2;
z = (z + 2047) >> 12;
- if (z <= MAX_12BIT && z >= 100) {
- input_report_abs(input_dev, ABS_X, x);
- input_report_abs(input_dev, ABS_Y, y);
- input_report_abs(input_dev, ABS_PRESSURE, z);
- input_report_key(input_dev, BTN_TOUCH, 1);
+ if (z <= MAX_12BIT && z > 1) {
+ if((x!= 0) || (y!=0)){
+ yyvals[ccreads] = y;
+ //yyvals[ccreads] &= 0xfff;
+ xxvals[ccreads] = x;
+ //xxvals[ccreads] &= 0xfff;
+ ccreads++;
+ if(ccreads>=CCREADS-1){
+ sort(yyvals, CCREADS, sizeof(unsigned int),
+ titsc_cmp_coord, NULL);
+ sort(xxvals, CCREADS, sizeof(unsigned int),
+ titsc_cmp_coord, NULL);
+
+ // int i=0;
+ // for (i = 3; i < 6; i++) {
+ // yysum += yyvals[i];
+ // xxsum += xxvals[i];
+ // }
+ // yysum /= 3;
+ // xxsum /= 3;
+ // y = yysum;
+ // x = xxsum;
+ y = yyvals[CCREADS/2];
+ x = xxvals[CCREADS/2];
+
+ input_report_abs(input_dev, ABS_X, x);
+ input_report_abs(input_dev, ABS_Y, y);
+ input_report_abs(input_dev, ABS_PRESSURE, z);
+ input_report_key(input_dev, BTN_TOUCH, 1);
+ input_sync(input_dev);
+ ccreads = 0;
+ }
+ }
+ else
+ {
+ //input_report_abs(input_dev, ABS_X, x);
+ //input_report_abs(input_dev, ABS_Y, y);
+ input_report_abs(input_dev, ABS_PRESSURE, 0);
+ input_report_key(input_dev, BTN_TOUCH, 0);
input_sync(input_dev);
- }
+ }
+
}
+ }
irqclr |= IRQENB_FIFO0THRES;
}
if (irqclr) {