aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/bcm5974.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/bcm5974.c')
-rw-r--r--drivers/input/mouse/bcm5974.c70
1 files changed, 65 insertions, 5 deletions
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index b95231763911..3126983c004a 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -55,6 +55,18 @@
55#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236 55#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236
56#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237 56#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237
57#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 57#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238
58/* MacbookAir3,2 (unibody), aka wellspring5 */
59#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI 0x023f
60#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO 0x0240
61#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS 0x0241
62/* MacbookAir3,1 (unibody), aka wellspring4 */
63#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI 0x0242
64#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO 0x0243
65#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS 0x0244
66/* Macbook8 (unibody, March 2011) */
67#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245
68#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246
69#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247
58 70
59#define BCM5974_DEVICE(prod) { \ 71#define BCM5974_DEVICE(prod) { \
60 .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ 72 .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
@@ -80,6 +92,18 @@ static const struct usb_device_id bcm5974_table[] = {
80 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI), 92 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI),
81 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ISO), 93 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ISO),
82 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), 94 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_JIS),
95 /* MacbookAir3,2 */
96 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI),
97 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4_ISO),
98 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4_JIS),
99 /* MacbookAir3,1 */
100 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI),
101 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO),
102 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS),
103 /* MacbookPro8 */
104 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI),
105 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ISO),
106 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_JIS),
83 /* Terminating entry */ 107 /* Terminating entry */
84 {} 108 {}
85}; 109};
@@ -234,6 +258,42 @@ static const struct bcm5974_config bcm5974_config_table[] = {
234 { DIM_X, DIM_X / SN_COORD, -4460, 5166 }, 258 { DIM_X, DIM_X / SN_COORD, -4460, 5166 },
235 { DIM_Y, DIM_Y / SN_COORD, -75, 6700 } 259 { DIM_Y, DIM_Y / SN_COORD, -75, 6700 }
236 }, 260 },
261 {
262 USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI,
263 USB_DEVICE_ID_APPLE_WELLSPRING4_ISO,
264 USB_DEVICE_ID_APPLE_WELLSPRING4_JIS,
265 HAS_INTEGRATED_BUTTON,
266 0x84, sizeof(struct bt_data),
267 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
268 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
269 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
270 { DIM_X, DIM_X / SN_COORD, -4620, 5140 },
271 { DIM_Y, DIM_Y / SN_COORD, -150, 6600 }
272 },
273 {
274 USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI,
275 USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO,
276 USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS,
277 HAS_INTEGRATED_BUTTON,
278 0x84, sizeof(struct bt_data),
279 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
280 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
281 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
282 { DIM_X, DIM_X / SN_COORD, -4616, 5112 },
283 { DIM_Y, DIM_Y / SN_COORD, -142, 5234 }
284 },
285 {
286 USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI,
287 USB_DEVICE_ID_APPLE_WELLSPRING5_ISO,
288 USB_DEVICE_ID_APPLE_WELLSPRING5_JIS,
289 HAS_INTEGRATED_BUTTON,
290 0x84, sizeof(struct bt_data),
291 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
292 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
293 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
294 { DIM_X, DIM_X / SN_COORD, -4415, 5050 },
295 { DIM_Y, DIM_Y / SN_COORD, -55, 6680 }
296 },
237 {} 297 {}
238}; 298};
239 299
@@ -390,10 +450,6 @@ static int report_tp_state(struct bcm5974 *dev, int size)
390 ptest = int2bound(&c->p, raw_p); 450 ptest = int2bound(&c->p, raw_p);
391 origin = raw2int(f->origin); 451 origin = raw2int(f->origin);
392 452
393 /* set the integrated button if applicable */
394 if (c->tp_type == TYPE2)
395 ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
396
397 /* while tracking finger still valid, count all fingers */ 453 /* while tracking finger still valid, count all fingers */
398 if (ptest > PRESSURE_LOW && origin) { 454 if (ptest > PRESSURE_LOW && origin) {
399 abs_p = ptest; 455 abs_p = ptest;
@@ -412,6 +468,10 @@ static int report_tp_state(struct bcm5974 *dev, int size)
412 } 468 }
413 } 469 }
414 470
471 /* set the integrated button if applicable */
472 if (c->tp_type == TYPE2)
473 ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
474
415 if (dev->fingers < nmin) 475 if (dev->fingers < nmin)
416 dev->fingers = nmin; 476 dev->fingers = nmin;
417 if (dev->fingers > nmax) 477 if (dev->fingers > nmax)
@@ -579,7 +639,7 @@ exit:
579 * device, resulting in trackpad malfunction under certain 639 * device, resulting in trackpad malfunction under certain
580 * circumstances. To get around this problem, there is at least one 640 * circumstances. To get around this problem, there is at least one
581 * example that utilizes the USB_QUIRK_RESET_RESUME quirk in order to 641 * example that utilizes the USB_QUIRK_RESET_RESUME quirk in order to
582 * recieve a reset_resume request rather than the normal resume. 642 * receive a reset_resume request rather than the normal resume.
583 * Since the implementation of reset_resume is equal to mode switch 643 * Since the implementation of reset_resume is equal to mode switch
584 * plus start_traffic, it seems easier to always do the switch when 644 * plus start_traffic, it seems easier to always do the switch when
585 * starting traffic on the device. 645 * starting traffic on the device.