1 Ignores read interrupts after penUP events until a penDOWN interrupt arrives.
2 Some other changes i dont remember exactly. :)
3 Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
4 Index: linux-2.6.16/drivers/input/touchscreen/pcap_ts.c
5 ===================================================================
6 --- linux-2.6.16.orig/drivers/input/touchscreen/pcap_ts.c 2007-03-09 21:26:25.000000000 -0300
7 +++ linux-2.6.16/drivers/input/touchscreen/pcap_ts.c 2007-03-09 21:26:42.000000000 -0300
10 #include "../../misc/ezx/ssp_pcap.h"
14 #define DEBUGP(x, args ...) printk(KERN_DEBUG "%s: " x, __FUNCTION__, ## args)
16 #define DEBUGP(x, args ...)
28 DEBUGP("start xy read in mode %s\n",
29 - pcap_ts->read_state == COORDINATE ? "COORD" : "PRESS");
30 + pcap_ts->read_state == COORDINATE ? "COORD" : (pcap_ts->read_state == PRESSURE ? "PRESS" : "STANDBY"));
32 ret = ezx_pcap_read(SSP_PCAP_ADJ_ADC1_REGISTER, &tmp);
37 DEBUGP("get xy value in mode %s\n",
38 - pcap_ts->read_state == COORDINATE ? "COORD" : "PRESS");
39 + pcap_ts->read_state == COORDINATE ? "COORD" : (pcap_ts->read_state == PRESSURE ? "PRESS" : "STANDBY"));
41 ret = ezx_pcap_read(SSP_PCAP_ADJ_ADC2_REGISTER, &tmp);
44 static irqreturn_t pcap_ts_irq_xy(int irq, void *dev_id, struct pt_regs *regs)
46 struct pcap_ts *pcap_ts = dev_id;
47 +// DEBUGP("read_state: %d\n", pcap_ts->read_state);
50 + * Ignore further read interrupts after we set STANDBY - WM
52 + if (pcap_ts->read_state == STANDBY)
54 + DEBUGP("ignored\n");
57 if (pcap_ts_get_xy_value(pcap_ts) < 0) {
58 printk("pcap_ts: error reading XY value\n");
61 pcap_ts->pressure <= PRESSURE_MIN ) &&
62 pcap_ts->pressure == pcap_ts->pressure_last) {
63 /* pen has been released */
65 input_report_key(pcap_ts->input, BTN_TOUCH, 0);
66 - input_sync(pcap_ts->input);
68 input_report_abs(pcap_ts->input, ABS_PRESSURE, 0);
69 + input_sync(pcap_ts->input);
71 pcap_ts->x = pcap_ts->y = 0;
73 + /* no need for timer, we'll get interrupted with
74 + * next touch down event */
75 + del_timer(&pcap_ts->timer);
77 /* ask PCAP2 to interrupt us if touch event happens
79 - pcap_ts->read_state = PRESSURE;
80 + pcap_ts->read_state = STANDBY;
81 pcap_ts_mode(PCAP_TS_STANDBY_MODE);
82 ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_TSM, 0);
84 - /* no need for timer, we'll get interrupted with
85 - * next touch down event */
86 - del_timer(&pcap_ts->timer);
88 /* pen has been touched down */
91 input_report_key(pcap_ts->input, BTN_TOUCH, 1);
92 /* don't input_sync(), we don't know position yet */
94 if (pcap_ts->pressure == 0)
95 pcap_ts->pressure = pcap_ts->pressure_last;
97 - input_report_abs(pcap_ts->input, ABS_PRESSURE,
100 /* switch state machine into coordinate read mode */
101 pcap_ts->read_state = COORDINATE;
102 pcap_ts_mode(PCAP_TS_POSITION_XY_MEASUREMENT);
103 @@ -196,18 +205,14 @@
104 /* we are in coordinate mode */
105 if (pcap_ts->x <= X_AXIS_MIN || pcap_ts->x >= X_AXIS_MAX ||
106 pcap_ts->y <= Y_AXIS_MIN || pcap_ts->y >= Y_AXIS_MAX) {
107 - DEBUGP("invalid x/y coordinate position: PEN_UP?\n");
109 + DEBUGP("PEN_UP?\n");
110 pcap_ts->pressure = 0;
112 - input_report_key(pcap_ts->input, BTN_TOUCH, 0);
113 - pcap_ts->x = pcap_ts->y = 0;
116 + input_report_abs(pcap_ts->input, ABS_PRESSURE, pcap_ts->pressure);
117 input_report_abs(pcap_ts->input, ABS_X, pcap_ts->x);
118 input_report_abs(pcap_ts->input, ABS_Y, pcap_ts->y);
119 + input_sync(pcap_ts->input);
121 - input_sync(pcap_ts->input);
123 /* switch back to pressure read mode */
124 pcap_ts->read_state = PRESSURE;