hid-gaff.c (48a732dfaa77a4dfec803aa8f248373998704f76) | hid-gaff.c (d881427253da011495f4193663d809d0e9dfa215) |
---|---|
1/* 2 * Force feedback support for GreenAsia (Product ID 0x12) based devices 3 * 4 * The devices are distributed under various names and the same USB device ID 5 * can be used in many game controllers. 6 * 7 * 8 * 0e8f:0012 "GreenAsia Inc. USB Joystick " --- 15 unchanged lines hidden (view full) --- 24 * 25 * You should have received a copy of the GNU General Public License 26 * along with this program; if not, write to the Free Software 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 28 */ 29 30#include <linux/input.h> 31#include <linux/slab.h> | 1/* 2 * Force feedback support for GreenAsia (Product ID 0x12) based devices 3 * 4 * The devices are distributed under various names and the same USB device ID 5 * can be used in many game controllers. 6 * 7 * 8 * 0e8f:0012 "GreenAsia Inc. USB Joystick " --- 15 unchanged lines hidden (view full) --- 24 * 25 * You should have received a copy of the GNU General Public License 26 * along with this program; if not, write to the Free Software 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 28 */ 29 30#include <linux/input.h> 31#include <linux/slab.h> |
32#include <linux/usb.h> | |
33#include <linux/hid.h> 34#include <linux/module.h> 35#include "hid-ids.h" 36 37#ifdef CONFIG_GREENASIA_FF | 32#include <linux/hid.h> 33#include <linux/module.h> 34#include "hid-ids.h" 35 36#ifdef CONFIG_GREENASIA_FF |
38#include "usbhid/usbhid.h" | |
39 40struct gaff_device { 41 struct hid_report *report; 42}; 43 44static int hid_gaff_play(struct input_dev *dev, void *data, 45 struct ff_effect *effect) 46{ --- 11 unchanged lines hidden (view full) --- 58 59 gaff->report->field[0]->value[0] = 0x51; 60 gaff->report->field[0]->value[1] = 0x0; 61 gaff->report->field[0]->value[2] = right; 62 gaff->report->field[0]->value[3] = 0; 63 gaff->report->field[0]->value[4] = left; 64 gaff->report->field[0]->value[5] = 0; 65 dbg_hid("running with 0x%02x 0x%02x", left, right); | 37 38struct gaff_device { 39 struct hid_report *report; 40}; 41 42static int hid_gaff_play(struct input_dev *dev, void *data, 43 struct ff_effect *effect) 44{ --- 11 unchanged lines hidden (view full) --- 56 57 gaff->report->field[0]->value[0] = 0x51; 58 gaff->report->field[0]->value[1] = 0x0; 59 gaff->report->field[0]->value[2] = right; 60 gaff->report->field[0]->value[3] = 0; 61 gaff->report->field[0]->value[4] = left; 62 gaff->report->field[0]->value[5] = 0; 63 dbg_hid("running with 0x%02x 0x%02x", left, right); |
66 usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 64 hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
67 68 gaff->report->field[0]->value[0] = 0xfa; 69 gaff->report->field[0]->value[1] = 0xfe; 70 gaff->report->field[0]->value[2] = 0x0; 71 gaff->report->field[0]->value[4] = 0x0; 72 | 65 66 gaff->report->field[0]->value[0] = 0xfa; 67 gaff->report->field[0]->value[1] = 0xfe; 68 gaff->report->field[0]->value[2] = 0x0; 69 gaff->report->field[0]->value[4] = 0x0; 70 |
73 usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 71 hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
74 75 return 0; 76} 77 78static int gaff_init(struct hid_device *hid) 79{ 80 struct gaff_device *gaff; 81 struct hid_report *report; --- 35 unchanged lines hidden (view full) --- 117 return error; 118 } 119 120 gaff->report = report; 121 gaff->report->field[0]->value[0] = 0x51; 122 gaff->report->field[0]->value[1] = 0x00; 123 gaff->report->field[0]->value[2] = 0x00; 124 gaff->report->field[0]->value[3] = 0x00; | 72 73 return 0; 74} 75 76static int gaff_init(struct hid_device *hid) 77{ 78 struct gaff_device *gaff; 79 struct hid_report *report; --- 35 unchanged lines hidden (view full) --- 115 return error; 116 } 117 118 gaff->report = report; 119 gaff->report->field[0]->value[0] = 0x51; 120 gaff->report->field[0]->value[1] = 0x00; 121 gaff->report->field[0]->value[2] = 0x00; 122 gaff->report->field[0]->value[3] = 0x00; |
125 usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 123 hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
126 127 gaff->report->field[0]->value[0] = 0xfa; 128 gaff->report->field[0]->value[1] = 0xfe; 129 | 124 125 gaff->report->field[0]->value[0] = 0xfa; 126 gaff->report->field[0]->value[1] = 0xfe; 127 |
130 usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 128 hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
131 132 hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n"); 133 134 return 0; 135} 136#else 137static inline int gaff_init(struct hid_device *hdev) 138{ --- 43 unchanged lines hidden --- | 129 130 hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n"); 131 132 return 0; 133} 134#else 135static inline int gaff_init(struct hid_device *hdev) 136{ --- 43 unchanged lines hidden --- |