hid-dr.c (48a732dfaa77a4dfec803aa8f248373998704f76) hid-dr.c (d881427253da011495f4193663d809d0e9dfa215)
1/*
2 * Force feedback support for DragonRise Inc. game controllers
3 *
4 * From what I have gathered, these devices are mass produced in China and are
5 * distributed under several vendors. They often share the same design as
6 * the original PlayStation DualShock controller.
7 *
8 * 0079:0006 "DragonRise Inc. Generic 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 DragonRise Inc. game controllers
3 *
4 * From what I have gathered, these devices are mass produced in China and are
5 * distributed under several vendors. They often share the same design as
6 * the original PlayStation DualShock controller.
7 *
8 * 0079:0006 "DragonRise Inc. Generic 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
36#include "hid-ids.h"
37
38#ifdef CONFIG_DRAGONRISE_FF
32#include <linux/hid.h>
33#include <linux/module.h>
34
35#include "hid-ids.h"
36
37#ifdef CONFIG_DRAGONRISE_FF
39#include "usbhid/usbhid.h"
40
41struct drff_device {
42 struct hid_report *report;
43};
44
45static int drff_play(struct input_dev *dev, void *data,
46 struct ff_effect *effect)
47{

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

63 at a near maximum speed, so we'll bypass it. */
64 if (weak == 0x0a)
65 weak = 0x0b;
66
67 drff->report->field[0]->value[0] = 0x51;
68 drff->report->field[0]->value[1] = 0x00;
69 drff->report->field[0]->value[2] = weak;
70 drff->report->field[0]->value[4] = strong;
38
39struct drff_device {
40 struct hid_report *report;
41};
42
43static int drff_play(struct input_dev *dev, void *data,
44 struct ff_effect *effect)
45{

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

61 at a near maximum speed, so we'll bypass it. */
62 if (weak == 0x0a)
63 weak = 0x0b;
64
65 drff->report->field[0]->value[0] = 0x51;
66 drff->report->field[0]->value[1] = 0x00;
67 drff->report->field[0]->value[2] = weak;
68 drff->report->field[0]->value[4] = strong;
71 usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
69 hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);
72
73 drff->report->field[0]->value[0] = 0xfa;
74 drff->report->field[0]->value[1] = 0xfe;
75 } else {
76 drff->report->field[0]->value[0] = 0xf3;
77 drff->report->field[0]->value[1] = 0x00;
78 }
79
80 drff->report->field[0]->value[2] = 0x00;
81 drff->report->field[0]->value[4] = 0x00;
82 dbg_hid("running with 0x%02x 0x%02x", strong, weak);
70
71 drff->report->field[0]->value[0] = 0xfa;
72 drff->report->field[0]->value[1] = 0xfe;
73 } else {
74 drff->report->field[0]->value[0] = 0xf3;
75 drff->report->field[0]->value[1] = 0x00;
76 }
77
78 drff->report->field[0]->value[2] = 0x00;
79 drff->report->field[0]->value[4] = 0x00;
80 dbg_hid("running with 0x%02x 0x%02x", strong, weak);
83 usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
81 hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);
84
85 return 0;
86}
87
88static int drff_init(struct hid_device *hid)
89{
90 struct drff_device *drff;
91 struct hid_report *report;

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

127 drff->report = report;
128 drff->report->field[0]->value[0] = 0xf3;
129 drff->report->field[0]->value[1] = 0x00;
130 drff->report->field[0]->value[2] = 0x00;
131 drff->report->field[0]->value[3] = 0x00;
132 drff->report->field[0]->value[4] = 0x00;
133 drff->report->field[0]->value[5] = 0x00;
134 drff->report->field[0]->value[6] = 0x00;
82
83 return 0;
84}
85
86static int drff_init(struct hid_device *hid)
87{
88 struct drff_device *drff;
89 struct hid_report *report;

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

125 drff->report = report;
126 drff->report->field[0]->value[0] = 0xf3;
127 drff->report->field[0]->value[1] = 0x00;
128 drff->report->field[0]->value[2] = 0x00;
129 drff->report->field[0]->value[3] = 0x00;
130 drff->report->field[0]->value[4] = 0x00;
131 drff->report->field[0]->value[5] = 0x00;
132 drff->report->field[0]->value[6] = 0x00;
135 usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
133 hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);
136
137 hid_info(hid, "Force Feedback for DragonRise Inc. "
138 "game controllers by Richard Walmsley <richwalm@gmail.com>\n");
139
140 return 0;
141}
142#else
143static inline int drff_init(struct hid_device *hid)

--- 159 unchanged lines hidden ---
134
135 hid_info(hid, "Force Feedback for DragonRise Inc. "
136 "game controllers by Richard Walmsley <richwalm@gmail.com>\n");
137
138 return 0;
139}
140#else
141static inline int drff_init(struct hid_device *hid)

--- 159 unchanged lines hidden ---