On Fri, May 25, 2007 at 07:06:32PM +0400, Anton Vorontsov wrote:
> Ok, I've tried original patch* on h5000 and hx4700, and it does not break
> anything (ts_test, Xfbdev using tslib). So, given that patch is sane,
> trivial, and other touchscreen drivers seem doing the same, I voting for
> it.
>
> * Original patch somehow got corrupted on the way, and failed to apply.
> Here is fixed version.
Hi Anton,
I agree that the change should be made. However, I think open coding
report_touchpanel is a better approach. Below is my equivalent
changes to ts-adc.c.
-Kevin
Index: drivers/input/touchscreen/ts-adc.c
===================================================================
RCS file: /cvs/linux/kernel26/drivers/input/touchscreen/ts-adc.c,v
retrieving revision 1.5
diff -u -r1.5 ts-adc.c
--- drivers/input/touchscreen/ts-adc.c 28 Mar 2007 12:40:14 -0000 1.5
+++ drivers/input/touchscreen/ts-adc.c 29 May 2007 16:05:45 -0000
@@ -34,16 +34,6 @@
#define TS_POLL_PERIOD msecs_to_jiffies(10)
-// Send an event to the input layer.
-static inline void
-report_event(struct ts_adc *ts, int pressure, int x, int y)
-{
- input_report_abs(ts->input, ABS_PRESSURE, pressure);
- input_report_abs(ts->input, ABS_X, x);
- input_report_abs(ts->input, ABS_Y, y);
- input_sync(ts->input);
-}
-
// Handle values read from ADC.
static void
handle_adc(struct work_struct *work)
@@ -83,14 +73,19 @@
if (!pendown || Rt < pdata->min_pressure) {
// Pen no longer down.
- if (ts->active == 2)
+ if (ts->active == 2) {
// Send pen up event.
- report_event(ts, 0, 0, 0);
+ input_report_abs(ts->input, ABS_PRESSURE, 0);
+ input_sync(ts->input);
+ }
ts->active = 0;
enable_irq(pdata->pen_irq);
} else {
- // Pen down - arrange for events until pen up again.
- report_event(ts, Rt, x, y);
+ // Pen down - report and arrange for events until pen up.
+ input_report_abs(ts->input, ABS_PRESSURE, Rt);
+ input_report_abs(ts->input, ABS_X, x);
+ input_report_abs(ts->input, ABS_Y, y);
+ input_sync(ts->input);
ts->active = 2;
queue_delayed_work(ts->wq, &ts->work.work, TS_POLL_PERIOD);
}
@@ -161,7 +156,6 @@
// Initialize input device.
input_dev = input_allocate_device();
input_dev->name = pdev->name;
- set_bit(EV_KEY, input_dev->evbit);
set_bit(EV_ABS, input_dev->evbit);
set_bit(ABS_X, input_dev->absbit);
set_bit(ABS_Y, input_dev->absbit);
_______________________________________________
Hx4700-port mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/hx4700-port