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 bcm597
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 /* something new */ |
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 11 |
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 bcm59
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 556-561
static int report_tp_state(struct bcm597
Link Here
|
556 |
int ibt = raw2int(dev->tp_data[BUTTON_TYPE2]); |
580 |
int ibt = raw2int(dev->tp_data[BUTTON_TYPE2]); |
557 |
input_report_key(input, BTN_LEFT, ibt); |
581 |
input_report_key(input, BTN_LEFT, ibt); |
558 |
} |
582 |
} |
|
|
583 |
/* type 3 encodes the button in field[11] */ |
584 |
else if (c->tp_type == TYPE3) { |
585 |
int ibt; |
586 |
const __le16 *data_array; |
587 |
|
588 |
data_array = (const __le16 *)(dev->tp_data); |
589 |
ibt = !!(raw2int(data_array[BUTTON_TYPE3]) & 0x100); |
590 |
input_report_key(input, BTN_LEFT, ibt); |
591 |
} |
559 |
|
592 |
|
560 |
input_sync(input); |
593 |
input_sync(input); |
561 |
|
594 |
|
Lines 572-580
static int report_tp_state(struct bcm597
Link Here
|
572 |
|
605 |
|
573 |
static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) |
606 |
static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) |
574 |
{ |
607 |
{ |
575 |
char *data = kmalloc(8, GFP_KERNEL); |
|
|
576 |
int retval = 0, size; |
608 |
int retval = 0, size; |
|
|
609 |
char *data; |
610 |
|
611 |
/* Type 3 does not require a mode switch */ |
612 |
if (dev->cfg.tp_type == TYPE3) |
613 |
return 0; |
577 |
|
614 |
|
|
|
615 |
data = kmalloc(8, GFP_KERNEL); |
578 |
if (!data) { |
616 |
if (!data) { |
579 |
dev_err(&dev->intf->dev, "out of memory\n"); |
617 |
dev_err(&dev->intf->dev, "out of memory\n"); |
580 |
retval = -ENOMEM; |
618 |
retval = -ENOMEM; |