hid-lg4ff.c (f31a2de3fe3680223a0dc93e484c491cc09473d3) hid-lg4ff.c (c1740d13e6ae4f1449e0a85097edf3ece51135ca)
1/*
2 * Force feedback support for Logitech Gaming Wheels
3 *
4 * Including G27, G25, DFP, DFGT, FFEX, Momo, Momo2 &
5 * Speed Force Wireless (WiiWheel)
6 *
7 * Copyright (c) 2010 Simon Wood <simon@mungewell.org>
8 */

--- 555 unchanged lines hidden (view full) ---

564 /* No other wheels have multiple modes */
565 default:
566 return NULL;
567 }
568}
569
570static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s)
571{
1/*
2 * Force feedback support for Logitech Gaming Wheels
3 *
4 * Including G27, G25, DFP, DFGT, FFEX, Momo, Momo2 &
5 * Speed Force Wireless (WiiWheel)
6 *
7 * Copyright (c) 2010 Simon Wood <simon@mungewell.org>
8 */

--- 555 unchanged lines hidden (view full) ---

564 /* No other wheels have multiple modes */
565 default:
566 return NULL;
567 }
568}
569
570static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s)
571{
572 struct usb_device *usbdev = hid_to_usb_dev(hid);
573 struct usbhid_device *usbhid = hid->driver_data;
572 struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
573 struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
574 __s32 *value = report->field[0]->value;
574 u8 i;
575
576 for (i = 0; i < s->cmd_count; i++) {
575 u8 i;
576
577 for (i = 0; i < s->cmd_count; i++) {
577 int xferd, ret;
578 u8 data[7];
578 u8 j;
579
579
580 memcpy(data, s->cmd + (7*i), 7);
581 ret = usb_interrupt_msg(usbdev, usbhid->urbout->pipe, data, 7, &xferd, USB_CTRL_SET_TIMEOUT);
582 if (ret)
583 return ret;
580 for (j = 0; j < 7; j++)
581 value[j] = s->cmd[j + (7*i)];
582
583 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
584 }
584 }
585 hid_hw_wait(hid);
585 return 0;
586}
587
588static ssize_t lg4ff_alternate_modes_show(struct device *dev, struct device_attribute *attr, char *buf)
589{
590 struct hid_device *hid = to_hid_device(dev);
591 struct lg4ff_device_entry *entry;
592 struct lg_drv_data *drv_data;

--- 618 unchanged lines hidden ---
586 return 0;
587}
588
589static ssize_t lg4ff_alternate_modes_show(struct device *dev, struct device_attribute *attr, char *buf)
590{
591 struct hid_device *hid = to_hid_device(dev);
592 struct lg4ff_device_entry *entry;
593 struct lg_drv_data *drv_data;

--- 618 unchanged lines hidden ---