diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2012-08-12 15:21:59 -0400 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2012-09-19 13:50:21 -0400 |
commit | f17953abc92a7d536f4b9b9ce42cf8e07d8d3489 (patch) | |
tree | 9b7eda102fcc743c7133cfd8c9db3fecedb318bf /drivers/input/mouse | |
parent | 43f482b48d0322df7c0cc6f97d0ec7c77db6777b (diff) |
Input: bcm5974 - Preparatory renames
Rename touch properties to match established nomenclature, and define
the maximum number of fingers.
Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/bcm5974.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 39ac9ff3da8..2de974ce56b 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -183,18 +183,19 @@ struct tp_finger { | |||
183 | __le16 abs_y; /* absolute y coodinate */ | 183 | __le16 abs_y; /* absolute y coodinate */ |
184 | __le16 rel_x; /* relative x coodinate */ | 184 | __le16 rel_x; /* relative x coodinate */ |
185 | __le16 rel_y; /* relative y coodinate */ | 185 | __le16 rel_y; /* relative y coodinate */ |
186 | __le16 size_major; /* finger size, major axis? */ | 186 | __le16 tool_major; /* tool area, major axis */ |
187 | __le16 size_minor; /* finger size, minor axis? */ | 187 | __le16 tool_minor; /* tool area, minor axis */ |
188 | __le16 orientation; /* 16384 when point, else 15 bit angle */ | 188 | __le16 orientation; /* 16384 when point, else 15 bit angle */ |
189 | __le16 force_major; /* trackpad force, major axis? */ | 189 | __le16 touch_major; /* touch area, major axis */ |
190 | __le16 force_minor; /* trackpad force, minor axis? */ | 190 | __le16 touch_minor; /* touch area, minor axis */ |
191 | __le16 unused[3]; /* zeros */ | 191 | __le16 unused[3]; /* zeros */ |
192 | __le16 multi; /* one finger: varies, more fingers: constant */ | 192 | __le16 multi; /* one finger: varies, more fingers: constant */ |
193 | } __attribute__((packed,aligned(2))); | 193 | } __attribute__((packed,aligned(2))); |
194 | 194 | ||
195 | /* trackpad finger data size, empirically at least ten fingers */ | 195 | /* trackpad finger data size, empirically at least ten fingers */ |
196 | #define MAX_FINGERS 16 | ||
196 | #define SIZEOF_FINGER sizeof(struct tp_finger) | 197 | #define SIZEOF_FINGER sizeof(struct tp_finger) |
197 | #define SIZEOF_ALL_FINGERS (16 * SIZEOF_FINGER) | 198 | #define SIZEOF_ALL_FINGERS (MAX_FINGERS * SIZEOF_FINGER) |
198 | #define MAX_FINGER_ORIENTATION 16384 | 199 | #define MAX_FINGER_ORIENTATION 16384 |
199 | 200 | ||
200 | /* device-specific parameters */ | 201 | /* device-specific parameters */ |
@@ -482,13 +483,13 @@ static void report_finger_data(struct input_dev *input, | |||
482 | const struct tp_finger *f) | 483 | const struct tp_finger *f) |
483 | { | 484 | { |
484 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, | 485 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, |
485 | raw2int(f->force_major) << 1); | 486 | raw2int(f->touch_major) << 1); |
486 | input_report_abs(input, ABS_MT_TOUCH_MINOR, | 487 | input_report_abs(input, ABS_MT_TOUCH_MINOR, |
487 | raw2int(f->force_minor) << 1); | 488 | raw2int(f->touch_minor) << 1); |
488 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, | 489 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, |
489 | raw2int(f->size_major) << 1); | 490 | raw2int(f->tool_major) << 1); |
490 | input_report_abs(input, ABS_MT_WIDTH_MINOR, | 491 | input_report_abs(input, ABS_MT_WIDTH_MINOR, |
491 | raw2int(f->size_minor) << 1); | 492 | raw2int(f->tool_minor) << 1); |
492 | input_report_abs(input, ABS_MT_ORIENTATION, | 493 | input_report_abs(input, ABS_MT_ORIENTATION, |
493 | MAX_FINGER_ORIENTATION - raw2int(f->orientation)); | 494 | MAX_FINGER_ORIENTATION - raw2int(f->orientation)); |
494 | input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x)); | 495 | input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x)); |
@@ -521,8 +522,8 @@ static int report_tp_state(struct bcm5974 *dev, int size) | |||
521 | for (i = 0; i < raw_n; i++) | 522 | for (i = 0; i < raw_n; i++) |
522 | report_finger_data(input, c, &f[i]); | 523 | report_finger_data(input, c, &f[i]); |
523 | 524 | ||
524 | raw_p = raw2int(f->force_major); | 525 | raw_p = raw2int(f->touch_major); |
525 | raw_w = raw2int(f->size_major); | 526 | raw_w = raw2int(f->tool_major); |
526 | raw_x = raw2int(f->abs_x); | 527 | raw_x = raw2int(f->abs_x); |
527 | raw_y = raw2int(f->abs_y); | 528 | raw_y = raw2int(f->abs_y); |
528 | 529 | ||
@@ -542,7 +543,7 @@ static int report_tp_state(struct bcm5974 *dev, int size) | |||
542 | abs_y = int2bound(&c->y, c->y.devmax - raw_y); | 543 | abs_y = int2bound(&c->y, c->y.devmax - raw_y); |
543 | while (raw_n--) { | 544 | while (raw_n--) { |
544 | ptest = int2bound(&c->p, | 545 | ptest = int2bound(&c->p, |
545 | raw2int(f->force_major)); | 546 | raw2int(f->touch_major)); |
546 | if (ptest > PRESSURE_LOW) | 547 | if (ptest > PRESSURE_LOW) |
547 | nmax++; | 548 | nmax++; |
548 | if (ptest > PRESSURE_HIGH) | 549 | if (ptest > PRESSURE_HIGH) |