View | Details | Raw Unified | Return to bug 60181 | Differences between
and this patch

Collapse All | Expand All

(-)a/drivers/input/mouse/bcm5974.c (-3 / +34 lines)
Lines 88-93 Link Here
88
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI	0x0259
88
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI	0x0259
89
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO	0x025a
89
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO	0x025a
90
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS	0x025b
90
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS	0x025b
91
/* MacbookAir6,2 (unibody, June 2013) */
92
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI	0x0291
93
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO	0x0292
94
#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS	0x0293
91
95
92
#define BCM5974_DEVICE(prod) {					\
96
#define BCM5974_DEVICE(prod) {					\
93
	.match_flags = (USB_DEVICE_ID_MATCH_DEVICE |		\
97
	.match_flags = (USB_DEVICE_ID_MATCH_DEVICE |		\
Lines 145-150 static const struct usb_device_id bcm5974_table[] = { Link Here
145
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI),
149
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI),
146
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO),
150
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO),
147
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS),
151
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS),
152
	/* MacbookAir6,2 */
153
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI),
154
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_ISO),
155
	BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_JIS),
148
	/* Terminating entry */
156
	/* Terminating entry */
149
	{}
157
	{}
150
};
158
};
Lines 172-186 struct bt_data { Link Here
172
/* trackpad header types */
180
/* trackpad header types */
173
enum tp_type {
181
enum tp_type {
174
	TYPE1,			/* plain trackpad */
182
	TYPE1,			/* plain trackpad */
175
	TYPE2			/* button integrated in trackpad */
183
	TYPE2,			/* button integrated in trackpad */
184
	TYPE3			/* additional header fields since June 2013 */
176
};
185
};
177
186
178
/* trackpad finger data offsets, le16-aligned */
187
/* trackpad finger data offsets, le16-aligned */
179
#define FINGER_TYPE1		(13 * sizeof(__le16))
188
#define FINGER_TYPE1		(13 * sizeof(__le16))
180
#define FINGER_TYPE2		(15 * sizeof(__le16))
189
#define FINGER_TYPE2		(15 * sizeof(__le16))
190
#define FINGER_TYPE3		(19 * sizeof(__le16))
181
191
182
/* trackpad button data offsets */
192
/* trackpad button data offsets */
183
#define BUTTON_TYPE2		15
193
#define BUTTON_TYPE2		15
194
#define BUTTON_TYPE3		23
184
195
185
/* list of device capability bits */
196
/* list of device capability bits */
186
#define HAS_INTEGRATED_BUTTON	1
197
#define HAS_INTEGRATED_BUTTON	1
Lines 400-405 static const struct bcm5974_config bcm5974_config_table[] = { Link Here
400
		{ SN_COORD, -150, 6730 },
411
		{ SN_COORD, -150, 6730 },
401
		{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
412
		{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
402
	},
413
	},
414
	{
415
		USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI,
416
		USB_DEVICE_ID_APPLE_WELLSPRING8_ISO,
417
		USB_DEVICE_ID_APPLE_WELLSPRING8_JIS,
418
		HAS_INTEGRATED_BUTTON,
419
		0, sizeof(struct bt_data),
420
		0x83, TYPE3, FINGER_TYPE3, FINGER_TYPE3 + SIZEOF_ALL_FINGERS,
421
		{ SN_PRESSURE, 0, 300 },
422
		{ SN_WIDTH, 0, 2048 },
423
		{ SN_COORD, -4620, 5140 },
424
		{ SN_COORD, -150, 6600 },
425
		{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
426
	},
403
	{}
427
	{}
404
};
428
};
405
429
Lines 557-562 static int report_tp_state(struct bcm5974 *dev, int size) Link Here
557
		input_report_key(input, BTN_LEFT, ibt);
581
		input_report_key(input, BTN_LEFT, ibt);
558
	}
582
	}
559
583
584
	if (c->tp_type == TYPE3)
585
		input_report_key(input, BTN_LEFT, dev->tp_data[BUTTON_TYPE3]);
586
560
	input_sync(input);
587
	input_sync(input);
561
588
562
	return 0;
589
	return 0;
Lines 572-580 static int report_tp_state(struct bcm5974 *dev, int size) Link Here
572
599
573
static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
600
static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
574
{
601
{
575
	char *data = kmalloc(8, GFP_KERNEL);
576
	int retval = 0, size;
602
	int retval = 0, size;
603
	char *data;
604
605
	/* Type 3 does not require a mode switch */
606
	if (dev->cfg.tp_type == TYPE3)
607
		return 0;
577
608
609
	data = kmalloc(8, GFP_KERNEL);
578
	if (!data) {
610
	if (!data) {
579
		dev_err(&dev->intf->dev, "out of memory\n");
611
		dev_err(&dev->intf->dev, "out of memory\n");
580
		retval = -ENOMEM;
612
		retval = -ENOMEM;
581
- 

Return to bug 60181