aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@ubuntu.com>2010-09-02 10:51:54 -0400
committerJiri Kosina <jkosina@suse.cz>2010-09-02 10:51:54 -0400
commitc61b7cee672cc7276619ac0edf8f426e2f9e63e9 (patch)
treeb8d827b126d3d39072d227c1ae1103f8a2d1cb00 /drivers/hid
parent0228db70ce6afdcd14164ab8d18137fa319c76e8 (diff)
HID: magicmouse: remove timestamp logic
The timestamps from the device are currently stored in the private data structure. These aren't used, so remove them. I've left a comment detailing the protocol for future reference. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Acked-by: Michael Poole <mdpoole@troilus.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-magicmouse.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index b74abf202e01..945850b42bc1 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -71,11 +71,6 @@ MODULE_PARM_DESC(report_undeciphered, "Report undeciphered multi-touch state fie
71 * struct magicmouse_sc - Tracks Magic Mouse-specific data. 71 * struct magicmouse_sc - Tracks Magic Mouse-specific data.
72 * @input: Input device through which we report events. 72 * @input: Input device through which we report events.
73 * @quirks: Currently unused. 73 * @quirks: Currently unused.
74 * @last_timestamp: Timestamp from most recent (18-bit) touch report
75 * (units of milliseconds over short windows, but seems to
76 * increase faster when there are no touches).
77 * @delta_time: 18-bit difference between the two most recent touch
78 * reports from the mouse.
79 * @ntouches: Number of touches in most recent touch report. 74 * @ntouches: Number of touches in most recent touch report.
80 * @scroll_accel: Number of consecutive scroll motions. 75 * @scroll_accel: Number of consecutive scroll motions.
81 * @scroll_jiffies: Time of last scroll motion. 76 * @scroll_jiffies: Time of last scroll motion.
@@ -86,8 +81,6 @@ struct magicmouse_sc {
86 struct input_dev *input; 81 struct input_dev *input;
87 unsigned long quirks; 82 unsigned long quirks;
88 83
89 int last_timestamp;
90 int delta_time;
91 int ntouches; 84 int ntouches;
92 int scroll_accel; 85 int scroll_accel;
93 unsigned long scroll_jiffies; 86 unsigned long scroll_jiffies;
@@ -247,7 +240,7 @@ static int magicmouse_raw_event(struct hid_device *hdev,
247{ 240{
248 struct magicmouse_sc *msc = hid_get_drvdata(hdev); 241 struct magicmouse_sc *msc = hid_get_drvdata(hdev);
249 struct input_dev *input = msc->input; 242 struct input_dev *input = msc->input;
250 int x, y, ts, ii, clicks, npoints; 243 int x, y, ii, clicks, npoints;
251 244
252 switch (data[0]) { 245 switch (data[0]) {
253 case 0x10: 246 case 0x10:
@@ -261,9 +254,6 @@ static int magicmouse_raw_event(struct hid_device *hdev,
261 /* Expect six bytes of prefix, and N*8 bytes of touch data. */ 254 /* Expect six bytes of prefix, and N*8 bytes of touch data. */
262 if (size < 6 || ((size - 6) % 8) != 0) 255 if (size < 6 || ((size - 6) % 8) != 0)
263 return 0; 256 return 0;
264 ts = data[3] >> 6 | data[4] << 2 | data[5] << 10;
265 msc->delta_time = (ts - msc->last_timestamp) & 0x3ffff;
266 msc->last_timestamp = ts;
267 npoints = (size - 6) / 8; 257 npoints = (size - 6) / 8;
268 msc->ntouches = 0; 258 msc->ntouches = 0;
269 for (ii = 0; ii < npoints; ii++) 259 for (ii = 0; ii < npoints; ii++)
@@ -279,6 +269,12 @@ static int magicmouse_raw_event(struct hid_device *hdev,
279 x = (int)(((data[3] & 0x0c) << 28) | (data[1] << 22)) >> 22; 269 x = (int)(((data[3] & 0x0c) << 28) | (data[1] << 22)) >> 22;
280 y = (int)(((data[3] & 0x30) << 26) | (data[2] << 22)) >> 22; 270 y = (int)(((data[3] & 0x30) << 26) | (data[2] << 22)) >> 22;
281 clicks = data[3]; 271 clicks = data[3];
272
273 /* The following bits provide a device specific timestamp. They
274 * are unused here.
275 *
276 * ts = data[3] >> 6 | data[4] << 2 | data[5] << 10;
277 */
282 break; 278 break;
283 case 0x20: /* Theoretically battery status (0-100), but I have 279 case 0x20: /* Theoretically battery status (0-100), but I have
284 * never seen it -- maybe it is only upon request. 280 * never seen it -- maybe it is only upon request.