hid-pl.c (5f022298aab58ddff9bccdb28b82a59109789da9) | hid-pl.c (795750197f240ca2a3f064c0210c4efd40dbaed3) |
---|---|
1/* 2 * Force feedback support for PantherLord/GreenAsia based devices 3 * 4 * The devices are distributed under various names and the same USB device ID 5 * can be used in both adapters and actual game controllers. 6 * 7 * 0810:0001 "Twin USB Joystick" 8 * - tested with PantherLord USB/PS2 2in1 Adapter --- 76 unchanged lines hidden (view full) --- 85 containing 1 field, which contains 4 ff00.0002 usages and 4 16bit 86 absolute values. 87 88 The input reports also contain a field which contains 89 8 ff00.0001 usages and 8 boolean values. Their meaning is 90 currently unknown. */ 91 92 if (list_empty(report_list)) { | 1/* 2 * Force feedback support for PantherLord/GreenAsia based devices 3 * 4 * The devices are distributed under various names and the same USB device ID 5 * can be used in both adapters and actual game controllers. 6 * 7 * 0810:0001 "Twin USB Joystick" 8 * - tested with PantherLord USB/PS2 2in1 Adapter --- 76 unchanged lines hidden (view full) --- 85 containing 1 field, which contains 4 ff00.0002 usages and 4 16bit 86 absolute values. 87 88 The input reports also contain a field which contains 89 8 ff00.0001 usages and 8 boolean values. Their meaning is 90 currently unknown. */ 91 92 if (list_empty(report_list)) { |
93 printk(KERN_ERR "hid-plff: no output reports found\n"); | 93 dev_err(&hid->dev, "no output reports found\n"); |
94 return -ENODEV; 95 } 96 97 list_for_each_entry(hidinput, &hid->inputs, list) { 98 99 report_ptr = report_ptr->next; 100 101 if (report_ptr == report_list) { | 94 return -ENODEV; 95 } 96 97 list_for_each_entry(hidinput, &hid->inputs, list) { 98 99 report_ptr = report_ptr->next; 100 101 if (report_ptr == report_list) { |
102 printk(KERN_ERR "hid-plff: required output report is missing\n"); | 102 dev_err(&hid->dev, "required output report is " 103 "missing\n"); |
103 return -ENODEV; 104 } 105 106 report = list_entry(report_ptr, struct hid_report, list); 107 if (report->maxfield < 1) { | 104 return -ENODEV; 105 } 106 107 report = list_entry(report_ptr, struct hid_report, list); 108 if (report->maxfield < 1) { |
108 printk(KERN_ERR "hid-plff: no fields in the report\n"); | 109 dev_err(&hid->dev, "no fields in the report\n"); |
109 return -ENODEV; 110 } 111 112 if (report->field[0]->report_count < 4) { | 110 return -ENODEV; 111 } 112 113 if (report->field[0]->report_count < 4) { |
113 printk(KERN_ERR "hid-plff: not enough values in the field\n"); | 114 dev_err(&hid->dev, "not enough values in the field\n"); |
114 return -ENODEV; 115 } 116 117 plff = kzalloc(sizeof(struct plff_device), GFP_KERNEL); 118 if (!plff) 119 return -ENOMEM; 120 121 dev = hidinput->input; --- 9 unchanged lines hidden (view full) --- 131 plff->report = report; 132 plff->report->field[0]->value[0] = 0x00; 133 plff->report->field[0]->value[1] = 0x00; 134 plff->report->field[0]->value[2] = 0x00; 135 plff->report->field[0]->value[3] = 0x00; 136 usbhid_submit_report(hid, plff->report, USB_DIR_OUT); 137 } 138 | 115 return -ENODEV; 116 } 117 118 plff = kzalloc(sizeof(struct plff_device), GFP_KERNEL); 119 if (!plff) 120 return -ENOMEM; 121 122 dev = hidinput->input; --- 9 unchanged lines hidden (view full) --- 132 plff->report = report; 133 plff->report->field[0]->value[0] = 0x00; 134 plff->report->field[0]->value[1] = 0x00; 135 plff->report->field[0]->value[2] = 0x00; 136 plff->report->field[0]->value[3] = 0x00; 137 usbhid_submit_report(hid, plff->report, USB_DIR_OUT); 138 } 139 |
139 printk(KERN_INFO "hid-plff: Force feedback for PantherLord/GreenAsia " | 140 dev_info(&hid->dev, "Force feedback for PantherLord/GreenAsia " |
140 "devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); 141 142 return 0; 143} 144#else 145static inline int plff_init(struct hid_device *hid) 146{ 147 return 0; --- 58 unchanged lines hidden --- | 141 "devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); 142 143 return 0; 144} 145#else 146static inline int plff_init(struct hid_device *hid) 147{ 148 return 0; --- 58 unchanged lines hidden --- |