hid-lg2ff.c (020abf03cd659388f94cb328e1e1df0656e0d7ff) | hid-lg2ff.c (d881427253da011495f4193663d809d0e9dfa215) |
---|---|
1/* 2 * Force feedback support for Logitech RumblePad and Rumblepad 2 3 * 4 * Copyright (c) 2008 Anssi Hannula <anssi.hannula@gmail.com> 5 */ 6 7/* 8 * This program is free software; you can redistribute it and/or modify --- 9 unchanged lines hidden (view full) --- 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 */ 22 23 24#include <linux/input.h> 25#include <linux/slab.h> | 1/* 2 * Force feedback support for Logitech RumblePad and Rumblepad 2 3 * 4 * Copyright (c) 2008 Anssi Hannula <anssi.hannula@gmail.com> 5 */ 6 7/* 8 * This program is free software; you can redistribute it and/or modify --- 9 unchanged lines hidden (view full) --- 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 */ 22 23 24#include <linux/input.h> 25#include <linux/slab.h> |
26#include <linux/usb.h> | |
27#include <linux/hid.h> 28 | 26#include <linux/hid.h> 27 |
29#include "usbhid/usbhid.h" | |
30#include "hid-lg.h" 31 32struct lg2ff_device { 33 struct hid_report *report; 34}; 35 36static int play_effect(struct input_dev *dev, void *data, 37 struct ff_effect *effect) --- 13 unchanged lines hidden (view full) --- 51 lg2ff->report->field[0]->value[2] = weak; 52 lg2ff->report->field[0]->value[4] = strong; 53 } else { 54 lg2ff->report->field[0]->value[0] = 0xf3; 55 lg2ff->report->field[0]->value[2] = 0x00; 56 lg2ff->report->field[0]->value[4] = 0x00; 57 } 58 | 28#include "hid-lg.h" 29 30struct lg2ff_device { 31 struct hid_report *report; 32}; 33 34static int play_effect(struct input_dev *dev, void *data, 35 struct ff_effect *effect) --- 13 unchanged lines hidden (view full) --- 49 lg2ff->report->field[0]->value[2] = weak; 50 lg2ff->report->field[0]->value[4] = strong; 51 } else { 52 lg2ff->report->field[0]->value[0] = 0xf3; 53 lg2ff->report->field[0]->value[2] = 0x00; 54 lg2ff->report->field[0]->value[4] = 0x00; 55 } 56 |
59 usbhid_submit_report(hid, lg2ff->report, USB_DIR_OUT); | 57 hid_hw_request(hid, lg2ff->report, HID_REQ_SET_REPORT); |
60 return 0; 61} 62 63int lg2ff_init(struct hid_device *hid) 64{ 65 struct lg2ff_device *lg2ff; 66 struct hid_report *report; 67 struct hid_input *hidinput = list_entry(hid->inputs.next, --- 35 unchanged lines hidden (view full) --- 103 report->field[0]->value[0] = 0xf3; 104 report->field[0]->value[1] = 0x00; 105 report->field[0]->value[2] = 0x00; 106 report->field[0]->value[3] = 0x00; 107 report->field[0]->value[4] = 0x00; 108 report->field[0]->value[5] = 0x00; 109 report->field[0]->value[6] = 0x00; 110 | 58 return 0; 59} 60 61int lg2ff_init(struct hid_device *hid) 62{ 63 struct lg2ff_device *lg2ff; 64 struct hid_report *report; 65 struct hid_input *hidinput = list_entry(hid->inputs.next, --- 35 unchanged lines hidden (view full) --- 101 report->field[0]->value[0] = 0xf3; 102 report->field[0]->value[1] = 0x00; 103 report->field[0]->value[2] = 0x00; 104 report->field[0]->value[3] = 0x00; 105 report->field[0]->value[4] = 0x00; 106 report->field[0]->value[5] = 0x00; 107 report->field[0]->value[6] = 0x00; 108 |
111 usbhid_submit_report(hid, report, USB_DIR_OUT); | 109 hid_hw_request(hid, report, HID_REQ_SET_REPORT); |
112 113 hid_info(hid, "Force feedback for Logitech RumblePad/Rumblepad 2 by Anssi Hannula <anssi.hannula@gmail.com>\n"); 114 115 return 0; 116} | 110 111 hid_info(hid, "Force feedback for Logitech RumblePad/Rumblepad 2 by Anssi Hannula <anssi.hannula@gmail.com>\n"); 112 113 return 0; 114} |