mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-16 11:38:11 +00:00
Input: s3c24xx_ts - report touch only when stylus is down
Currently driver reports touches when it gets (1 << ts.shift) samples, even if stylus is up, which is incorrect. We should only report coordinates and touch condition when stylus is down. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
2f09586557
commit
23c239be22
1 changed files with 20 additions and 18 deletions
|
@ -128,6 +128,7 @@ static void touch_timer_fire(unsigned long data)
|
||||||
|
|
||||||
down = get_down(data0, data1);
|
down = get_down(data0, data1);
|
||||||
|
|
||||||
|
if (down) {
|
||||||
if (ts.count == (1 << ts.shift)) {
|
if (ts.count == (1 << ts.shift)) {
|
||||||
ts.xp >>= ts.shift;
|
ts.xp >>= ts.shift;
|
||||||
ts.yp >>= ts.shift;
|
ts.yp >>= ts.shift;
|
||||||
|
@ -146,9 +147,10 @@ static void touch_timer_fire(unsigned long data)
|
||||||
ts.count = 0;
|
ts.count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (down) {
|
|
||||||
s3c_adc_start(ts.client, 0, 1 << ts.shift);
|
s3c_adc_start(ts.client, 0, 1 << ts.shift);
|
||||||
} else {
|
} else {
|
||||||
|
ts.xp = 0;
|
||||||
|
ts.yp = 0;
|
||||||
ts.count = 0;
|
ts.count = 0;
|
||||||
|
|
||||||
input_report_key(ts.input, BTN_TOUCH, 0);
|
input_report_key(ts.input, BTN_TOUCH, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue