touchpad: move the hysteresis into its own substruct

Prep work for the wobbling detection patch

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
This commit is contained in:
Peter Hutterer 2018-02-23 11:21:04 +10:00
parent 223c914847
commit e43bd4ae3a
2 changed files with 8 additions and 6 deletions

View file

@ -162,16 +162,16 @@ tp_motion_hysteresis(struct tp_dispatch *tp,
return;
if (t->history.count == 0) {
t->hysteresis_center = t->point;
t->hysteresis.center = t->point;
} else {
x = evdev_hysteresis(x,
t->hysteresis_center.x,
t->hysteresis.center.x,
tp->hysteresis.margin.x);
y = evdev_hysteresis(y,
t->hysteresis_center.y,
t->hysteresis.center.y,
tp->hysteresis.margin.y);
t->hysteresis_center.x = x;
t->hysteresis_center.y = y;
t->hysteresis.center.x = x;
t->hysteresis.center.y = y;
t->point.x = x;
t->point.y = y;
}

View file

@ -175,7 +175,9 @@ struct tp_touch {
unsigned int count;
} history;
struct device_coords hysteresis_center;
struct {
struct device_coords center;
} hysteresis;
/* A pinned touchpoint is the one that pressed the physical button
* on a clickpad. After the release, it won't move until the center