aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@bitmath.org>2015-07-24 17:44:37 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-07-27 18:43:45 -0400
commitefbd34702fb1cb66e08606a623a8a76f86b300f9 (patch)
treec3b2138d0aabb6e468cdf2e8124011a718e32209
parentab80ee3895a76f1beba35847911d89833fbb68ab (diff)
Input: bcm5974 - prepare for a new trackpad generation
With the advent of the Macbook Pro 12, we see a new generation of trackpads, capable of force sensoring and haptic feedback. This patch prepares for the new device by adding configuration data for the code paths that would otherwise look different. Tested-by: John Horan <knasher@gmail.com> Tested-by: Jochen Radmacher <jradmacher@gmx.de> Tested-by: Yang Hongyang <burnef@gmail.com> Tested-by: Yen-Chin, Lee <coldnew.tw@gmail.com> Tested-by: George Hilios <ghilios@gmail.com> Tested-by: Janez Urevc <janez@janezurevc.name> Signed-off-by: Henrik Rydberg <rydberg@bitmath.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/bcm5974.c132
1 files changed, 81 insertions, 51 deletions
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index b10709f04615..a596b9b9d604 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -184,17 +184,37 @@ enum tp_type {
184}; 184};
185 185
186/* trackpad finger data offsets, le16-aligned */ 186/* trackpad finger data offsets, le16-aligned */
187#define FINGER_TYPE1 (13 * sizeof(__le16)) 187#define HEADER_TYPE1 (13 * sizeof(__le16))
188#define FINGER_TYPE2 (15 * sizeof(__le16)) 188#define HEADER_TYPE2 (15 * sizeof(__le16))
189#define FINGER_TYPE3 (19 * sizeof(__le16)) 189#define HEADER_TYPE3 (19 * sizeof(__le16))
190 190
191/* trackpad button data offsets */ 191/* trackpad button data offsets */
192#define BUTTON_TYPE1 0
192#define BUTTON_TYPE2 15 193#define BUTTON_TYPE2 15
193#define BUTTON_TYPE3 23 194#define BUTTON_TYPE3 23
194 195
195/* list of device capability bits */ 196/* list of device capability bits */
196#define HAS_INTEGRATED_BUTTON 1 197#define HAS_INTEGRATED_BUTTON 1
197 198
199/* trackpad finger data block size */
200#define FSIZE_TYPE1 (14 * sizeof(__le16))
201#define FSIZE_TYPE2 (14 * sizeof(__le16))
202#define FSIZE_TYPE3 (14 * sizeof(__le16))
203
204/* offset from header to finger struct */
205#define DELTA_TYPE1 (0 * sizeof(__le16))
206#define DELTA_TYPE2 (0 * sizeof(__le16))
207#define DELTA_TYPE3 (0 * sizeof(__le16))
208
209/* usb control message mode switch data */
210#define USBMSG_TYPE1 8, 0x300, 0, 0, 0x1, 0x8
211#define USBMSG_TYPE2 8, 0x300, 0, 0, 0x1, 0x8
212#define USBMSG_TYPE3 8, 0x300, 0, 0, 0x1, 0x8
213
214/* Wellspring initialization constants */
215#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID 1
216#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID 9
217
198/* trackpad finger structure, le16-aligned */ 218/* trackpad finger structure, le16-aligned */
199struct tp_finger { 219struct tp_finger {
200 __le16 origin; /* zero when switching track finger */ 220 __le16 origin; /* zero when switching track finger */
@@ -213,8 +233,6 @@ struct tp_finger {
213 233
214/* trackpad finger data size, empirically at least ten fingers */ 234/* trackpad finger data size, empirically at least ten fingers */
215#define MAX_FINGERS 16 235#define MAX_FINGERS 16
216#define SIZEOF_FINGER sizeof(struct tp_finger)
217#define SIZEOF_ALL_FINGERS (MAX_FINGERS * SIZEOF_FINGER)
218#define MAX_FINGER_ORIENTATION 16384 236#define MAX_FINGER_ORIENTATION 16384
219 237
220/* device-specific parameters */ 238/* device-specific parameters */
@@ -232,8 +250,17 @@ struct bcm5974_config {
232 int bt_datalen; /* data length of the button interface */ 250 int bt_datalen; /* data length of the button interface */
233 int tp_ep; /* the endpoint of the trackpad interface */ 251 int tp_ep; /* the endpoint of the trackpad interface */
234 enum tp_type tp_type; /* type of trackpad interface */ 252 enum tp_type tp_type; /* type of trackpad interface */
235 int tp_offset; /* offset to trackpad finger data */ 253 int tp_header; /* bytes in header block */
236 int tp_datalen; /* data length of the trackpad interface */ 254 int tp_datalen; /* data length of the trackpad interface */
255 int tp_button; /* offset to button data */
256 int tp_fsize; /* bytes in single finger block */
257 int tp_delta; /* offset from header to finger struct */
258 int um_size; /* usb control message length */
259 int um_req_val; /* usb control message value */
260 int um_req_idx; /* usb control message index */
261 int um_switch_idx; /* usb control message mode switch index */
262 int um_switch_on; /* usb control message mode switch on */
263 int um_switch_off; /* usb control message mode switch off */
237 struct bcm5974_param p; /* finger pressure limits */ 264 struct bcm5974_param p; /* finger pressure limits */
238 struct bcm5974_param w; /* finger width limits */ 265 struct bcm5974_param w; /* finger width limits */
239 struct bcm5974_param x; /* horizontal limits */ 266 struct bcm5974_param x; /* horizontal limits */
@@ -259,6 +286,24 @@ struct bcm5974 {
259 int slots[MAX_FINGERS]; /* slot assignments */ 286 int slots[MAX_FINGERS]; /* slot assignments */
260}; 287};
261 288
289/* trackpad finger block data, le16-aligned */
290static const struct tp_finger *get_tp_finger(const struct bcm5974 *dev, int i)
291{
292 const struct bcm5974_config *c = &dev->cfg;
293 u8 *f_base = dev->tp_data + c->tp_header + c->tp_delta;
294
295 return (const struct tp_finger *)(f_base + i * c->tp_fsize);
296}
297
298#define DATAFORMAT(type) \
299 type, \
300 HEADER_##type, \
301 HEADER_##type + (MAX_FINGERS) * (FSIZE_##type), \
302 BUTTON_##type, \
303 FSIZE_##type, \
304 DELTA_##type, \
305 USBMSG_##type
306
262/* logical signal quality */ 307/* logical signal quality */
263#define SN_PRESSURE 45 /* pressure signal-to-noise ratio */ 308#define SN_PRESSURE 45 /* pressure signal-to-noise ratio */
264#define SN_WIDTH 25 /* width signal-to-noise ratio */ 309#define SN_WIDTH 25 /* width signal-to-noise ratio */
@@ -273,7 +318,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
273 USB_DEVICE_ID_APPLE_WELLSPRING_JIS, 318 USB_DEVICE_ID_APPLE_WELLSPRING_JIS,
274 0, 319 0,
275 0x84, sizeof(struct bt_data), 320 0x84, sizeof(struct bt_data),
276 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS, 321 0x81, DATAFORMAT(TYPE1),
277 { SN_PRESSURE, 0, 256 }, 322 { SN_PRESSURE, 0, 256 },
278 { SN_WIDTH, 0, 2048 }, 323 { SN_WIDTH, 0, 2048 },
279 { SN_COORD, -4824, 5342 }, 324 { SN_COORD, -4824, 5342 },
@@ -286,7 +331,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
286 USB_DEVICE_ID_APPLE_WELLSPRING2_JIS, 331 USB_DEVICE_ID_APPLE_WELLSPRING2_JIS,
287 0, 332 0,
288 0x84, sizeof(struct bt_data), 333 0x84, sizeof(struct bt_data),
289 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS, 334 0x81, DATAFORMAT(TYPE1),
290 { SN_PRESSURE, 0, 256 }, 335 { SN_PRESSURE, 0, 256 },
291 { SN_WIDTH, 0, 2048 }, 336 { SN_WIDTH, 0, 2048 },
292 { SN_COORD, -4824, 4824 }, 337 { SN_COORD, -4824, 4824 },
@@ -299,7 +344,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
299 USB_DEVICE_ID_APPLE_WELLSPRING3_JIS, 344 USB_DEVICE_ID_APPLE_WELLSPRING3_JIS,
300 HAS_INTEGRATED_BUTTON, 345 HAS_INTEGRATED_BUTTON,
301 0x84, sizeof(struct bt_data), 346 0x84, sizeof(struct bt_data),
302 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 347 0x81, DATAFORMAT(TYPE2),
303 { SN_PRESSURE, 0, 300 }, 348 { SN_PRESSURE, 0, 300 },
304 { SN_WIDTH, 0, 2048 }, 349 { SN_WIDTH, 0, 2048 },
305 { SN_COORD, -4460, 5166 }, 350 { SN_COORD, -4460, 5166 },
@@ -312,7 +357,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
312 USB_DEVICE_ID_APPLE_WELLSPRING4_JIS, 357 USB_DEVICE_ID_APPLE_WELLSPRING4_JIS,
313 HAS_INTEGRATED_BUTTON, 358 HAS_INTEGRATED_BUTTON,
314 0x84, sizeof(struct bt_data), 359 0x84, sizeof(struct bt_data),
315 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 360 0x81, DATAFORMAT(TYPE2),
316 { SN_PRESSURE, 0, 300 }, 361 { SN_PRESSURE, 0, 300 },
317 { SN_WIDTH, 0, 2048 }, 362 { SN_WIDTH, 0, 2048 },
318 { SN_COORD, -4620, 5140 }, 363 { SN_COORD, -4620, 5140 },
@@ -325,7 +370,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
325 USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS, 370 USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS,
326 HAS_INTEGRATED_BUTTON, 371 HAS_INTEGRATED_BUTTON,
327 0x84, sizeof(struct bt_data), 372 0x84, sizeof(struct bt_data),
328 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 373 0x81, DATAFORMAT(TYPE2),
329 { SN_PRESSURE, 0, 300 }, 374 { SN_PRESSURE, 0, 300 },
330 { SN_WIDTH, 0, 2048 }, 375 { SN_WIDTH, 0, 2048 },
331 { SN_COORD, -4616, 5112 }, 376 { SN_COORD, -4616, 5112 },
@@ -338,7 +383,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
338 USB_DEVICE_ID_APPLE_WELLSPRING5_JIS, 383 USB_DEVICE_ID_APPLE_WELLSPRING5_JIS,
339 HAS_INTEGRATED_BUTTON, 384 HAS_INTEGRATED_BUTTON,
340 0x84, sizeof(struct bt_data), 385 0x84, sizeof(struct bt_data),
341 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 386 0x81, DATAFORMAT(TYPE2),
342 { SN_PRESSURE, 0, 300 }, 387 { SN_PRESSURE, 0, 300 },
343 { SN_WIDTH, 0, 2048 }, 388 { SN_WIDTH, 0, 2048 },
344 { SN_COORD, -4415, 5050 }, 389 { SN_COORD, -4415, 5050 },
@@ -351,7 +396,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
351 USB_DEVICE_ID_APPLE_WELLSPRING6_JIS, 396 USB_DEVICE_ID_APPLE_WELLSPRING6_JIS,
352 HAS_INTEGRATED_BUTTON, 397 HAS_INTEGRATED_BUTTON,
353 0x84, sizeof(struct bt_data), 398 0x84, sizeof(struct bt_data),
354 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 399 0x81, DATAFORMAT(TYPE2),
355 { SN_PRESSURE, 0, 300 }, 400 { SN_PRESSURE, 0, 300 },
356 { SN_WIDTH, 0, 2048 }, 401 { SN_WIDTH, 0, 2048 },
357 { SN_COORD, -4620, 5140 }, 402 { SN_COORD, -4620, 5140 },
@@ -364,7 +409,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
364 USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS, 409 USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS,
365 HAS_INTEGRATED_BUTTON, 410 HAS_INTEGRATED_BUTTON,
366 0x84, sizeof(struct bt_data), 411 0x84, sizeof(struct bt_data),
367 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 412 0x81, DATAFORMAT(TYPE2),
368 { SN_PRESSURE, 0, 300 }, 413 { SN_PRESSURE, 0, 300 },
369 { SN_WIDTH, 0, 2048 }, 414 { SN_WIDTH, 0, 2048 },
370 { SN_COORD, -4750, 5280 }, 415 { SN_COORD, -4750, 5280 },
@@ -377,7 +422,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
377 USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS, 422 USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS,
378 HAS_INTEGRATED_BUTTON, 423 HAS_INTEGRATED_BUTTON,
379 0x84, sizeof(struct bt_data), 424 0x84, sizeof(struct bt_data),
380 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 425 0x81, DATAFORMAT(TYPE2),
381 { SN_PRESSURE, 0, 300 }, 426 { SN_PRESSURE, 0, 300 },
382 { SN_WIDTH, 0, 2048 }, 427 { SN_WIDTH, 0, 2048 },
383 { SN_COORD, -4620, 5140 }, 428 { SN_COORD, -4620, 5140 },
@@ -390,7 +435,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
390 USB_DEVICE_ID_APPLE_WELLSPRING7_JIS, 435 USB_DEVICE_ID_APPLE_WELLSPRING7_JIS,
391 HAS_INTEGRATED_BUTTON, 436 HAS_INTEGRATED_BUTTON,
392 0x84, sizeof(struct bt_data), 437 0x84, sizeof(struct bt_data),
393 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 438 0x81, DATAFORMAT(TYPE2),
394 { SN_PRESSURE, 0, 300 }, 439 { SN_PRESSURE, 0, 300 },
395 { SN_WIDTH, 0, 2048 }, 440 { SN_WIDTH, 0, 2048 },
396 { SN_COORD, -4750, 5280 }, 441 { SN_COORD, -4750, 5280 },
@@ -403,7 +448,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
403 USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS, 448 USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS,
404 HAS_INTEGRATED_BUTTON, 449 HAS_INTEGRATED_BUTTON,
405 0x84, sizeof(struct bt_data), 450 0x84, sizeof(struct bt_data),
406 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 451 0x81, DATAFORMAT(TYPE2),
407 { SN_PRESSURE, 0, 300 }, 452 { SN_PRESSURE, 0, 300 },
408 { SN_WIDTH, 0, 2048 }, 453 { SN_WIDTH, 0, 2048 },
409 { SN_COORD, -4750, 5280 }, 454 { SN_COORD, -4750, 5280 },
@@ -416,7 +461,7 @@ static const struct bcm5974_config bcm5974_config_table[] = {
416 USB_DEVICE_ID_APPLE_WELLSPRING8_JIS, 461 USB_DEVICE_ID_APPLE_WELLSPRING8_JIS,
417 HAS_INTEGRATED_BUTTON, 462 HAS_INTEGRATED_BUTTON,
418 0, sizeof(struct bt_data), 463 0, sizeof(struct bt_data),
419 0x83, TYPE3, FINGER_TYPE3, FINGER_TYPE3 + SIZEOF_ALL_FINGERS, 464 0x83, DATAFORMAT(TYPE3),
420 { SN_PRESSURE, 0, 300 }, 465 { SN_PRESSURE, 0, 300 },
421 { SN_WIDTH, 0, 2048 }, 466 { SN_WIDTH, 0, 2048 },
422 { SN_COORD, -4620, 5140 }, 467 { SN_COORD, -4620, 5140 },
@@ -549,19 +594,18 @@ static int report_tp_state(struct bcm5974 *dev, int size)
549 struct input_dev *input = dev->input; 594 struct input_dev *input = dev->input;
550 int raw_n, i, n = 0; 595 int raw_n, i, n = 0;
551 596
552 if (size < c->tp_offset || (size - c->tp_offset) % SIZEOF_FINGER != 0) 597 if (size < c->tp_header || (size - c->tp_header) % c->tp_fsize != 0)
553 return -EIO; 598 return -EIO;
554 599
555 /* finger data, le16-aligned */ 600 raw_n = (size - c->tp_header) / c->tp_fsize;
556 f = (const struct tp_finger *)(dev->tp_data + c->tp_offset);
557 raw_n = (size - c->tp_offset) / SIZEOF_FINGER;
558 601
559 for (i = 0; i < raw_n; i++) { 602 for (i = 0; i < raw_n; i++) {
560 if (raw2int(f[i].touch_major) == 0) 603 f = get_tp_finger(dev, i);
604 if (raw2int(f->touch_major) == 0)
561 continue; 605 continue;
562 dev->pos[n].x = raw2int(f[i].abs_x); 606 dev->pos[n].x = raw2int(f->abs_x);
563 dev->pos[n].y = c->y.min + c->y.max - raw2int(f[i].abs_y); 607 dev->pos[n].y = c->y.min + c->y.max - raw2int(f->abs_y);
564 dev->index[n++] = &f[i]; 608 dev->index[n++] = f;
565 } 609 }
566 610
567 input_mt_assign_slots(input, dev->slots, dev->pos, n, 0); 611 input_mt_assign_slots(input, dev->slots, dev->pos, n, 0);
@@ -572,32 +616,22 @@ static int report_tp_state(struct bcm5974 *dev, int size)
572 616
573 input_mt_sync_frame(input); 617 input_mt_sync_frame(input);
574 618
575 report_synaptics_data(input, c, f, raw_n); 619 report_synaptics_data(input, c, get_tp_finger(dev, 0), raw_n);
576 620
577 /* type 2 reports button events via ibt only */ 621 /* later types report button events via integrated button only */
578 if (c->tp_type == TYPE2) { 622 if (c->caps & HAS_INTEGRATED_BUTTON) {
579 int ibt = raw2int(dev->tp_data[BUTTON_TYPE2]); 623 int ibt = raw2int(dev->tp_data[c->tp_button]);
580 input_report_key(input, BTN_LEFT, ibt); 624 input_report_key(input, BTN_LEFT, ibt);
581 } 625 }
582 626
583 if (c->tp_type == TYPE3)
584 input_report_key(input, BTN_LEFT, dev->tp_data[BUTTON_TYPE3]);
585
586 input_sync(input); 627 input_sync(input);
587 628
588 return 0; 629 return 0;
589} 630}
590 631
591/* Wellspring initialization constants */
592#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID 1
593#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID 9
594#define BCM5974_WELLSPRING_MODE_REQUEST_VALUE 0x300
595#define BCM5974_WELLSPRING_MODE_REQUEST_INDEX 0
596#define BCM5974_WELLSPRING_MODE_VENDOR_VALUE 0x01
597#define BCM5974_WELLSPRING_MODE_NORMAL_VALUE 0x08
598
599static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) 632static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
600{ 633{
634 const struct bcm5974_config *c = &dev->cfg;
601 int retval = 0, size; 635 int retval = 0, size;
602 char *data; 636 char *data;
603 637
@@ -605,7 +639,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
605 if (dev->cfg.tp_type == TYPE3) 639 if (dev->cfg.tp_type == TYPE3)
606 return 0; 640 return 0;
607 641
608 data = kmalloc(8, GFP_KERNEL); 642 data = kmalloc(c->um_size, GFP_KERNEL);
609 if (!data) { 643 if (!data) {
610 dev_err(&dev->intf->dev, "out of memory\n"); 644 dev_err(&dev->intf->dev, "out of memory\n");
611 retval = -ENOMEM; 645 retval = -ENOMEM;
@@ -616,28 +650,24 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
616 size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), 650 size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
617 BCM5974_WELLSPRING_MODE_READ_REQUEST_ID, 651 BCM5974_WELLSPRING_MODE_READ_REQUEST_ID,
618 USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 652 USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
619 BCM5974_WELLSPRING_MODE_REQUEST_VALUE, 653 c->um_req_val, c->um_req_idx, data, c->um_size, 5000);
620 BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
621 654
622 if (size != 8) { 655 if (size != c->um_size) {
623 dev_err(&dev->intf->dev, "could not read from device\n"); 656 dev_err(&dev->intf->dev, "could not read from device\n");
624 retval = -EIO; 657 retval = -EIO;
625 goto out; 658 goto out;
626 } 659 }
627 660
628 /* apply the mode switch */ 661 /* apply the mode switch */
629 data[0] = on ? 662 data[c->um_switch_idx] = on ? c->um_switch_on : c->um_switch_off;
630 BCM5974_WELLSPRING_MODE_VENDOR_VALUE :
631 BCM5974_WELLSPRING_MODE_NORMAL_VALUE;
632 663
633 /* write configuration */ 664 /* write configuration */
634 size = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), 665 size = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
635 BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID, 666 BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID,
636 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 667 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
637 BCM5974_WELLSPRING_MODE_REQUEST_VALUE, 668 c->um_req_val, c->um_req_idx, data, c->um_size, 5000);
638 BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
639 669
640 if (size != 8) { 670 if (size != c->um_size) {
641 dev_err(&dev->intf->dev, "could not write to device\n"); 671 dev_err(&dev->intf->dev, "could not write to device\n");
642 retval = -EIO; 672 retval = -EIO;
643 goto out; 673 goto out;