hid-axff.c (48a732dfaa77a4dfec803aa8f248373998704f76) hid-axff.c (d881427253da011495f4193663d809d0e9dfa215)
1/*
2 * Force feedback support for ACRUX game controllers
3 *
4 * From what I have gathered, these devices are mass produced in China
5 * by several vendors. They often share the same design as the original
6 * Xbox 360 controller.
7 *
8 * 1a34:0802 "ACRUX USB GAMEPAD 8116"

--- 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 ACRUX game controllers
3 *
4 * From what I have gathered, these devices are mass produced in China
5 * by several vendors. They often share the same design as the original
6 * Xbox 360 controller.
7 *
8 * 1a34:0802 "ACRUX USB GAMEPAD 8116"

--- 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_HID_ACRUX_FF
32#include <linux/hid.h>
33#include <linux/module.h>
34
35#include "hid-ids.h"
36
37#ifdef CONFIG_HID_ACRUX_FF
39#include "usbhid/usbhid.h"
40
41struct axff_device {
42 struct hid_report *report;
43};
44
45static int axff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
46{
47 struct hid_device *hid = input_get_drvdata(dev);

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

63 for (j = 0; j < report->field[i]->report_count; j++) {
64 report->field[i]->value[j] =
65 field_count % 2 ? right : left;
66 field_count++;
67 }
68 }
69
70 dbg_hid("running with 0x%02x 0x%02x", left, right);
38
39struct axff_device {
40 struct hid_report *report;
41};
42
43static int axff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
44{
45 struct hid_device *hid = input_get_drvdata(dev);

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

61 for (j = 0; j < report->field[i]->report_count; j++) {
62 report->field[i]->value[j] =
63 field_count % 2 ? right : left;
64 field_count++;
65 }
66 }
67
68 dbg_hid("running with 0x%02x 0x%02x", left, right);
71 usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
69 hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT);
72
73 return 0;
74}
75
76static int axff_init(struct hid_device *hid)
77{
78 struct axff_device *axff;
79 struct hid_report *report;

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

109
110 set_bit(FF_RUMBLE, dev->ffbit);
111
112 error = input_ff_create_memless(dev, axff, axff_play);
113 if (error)
114 goto err_free_mem;
115
116 axff->report = report;
70
71 return 0;
72}
73
74static int axff_init(struct hid_device *hid)
75{
76 struct axff_device *axff;
77 struct hid_report *report;

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

107
108 set_bit(FF_RUMBLE, dev->ffbit);
109
110 error = input_ff_create_memless(dev, axff, axff_play);
111 if (error)
112 goto err_free_mem;
113
114 axff->report = report;
117 usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
115 hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT);
118
119 hid_info(hid, "Force Feedback for ACRUX game controllers by Sergei Kolzun <x0r@dv-life.ru>\n");
120
121 return 0;
122
123err_free_mem:
124 kfree(axff);
125 return error;

--- 74 unchanged lines hidden ---
116
117 hid_info(hid, "Force Feedback for ACRUX game controllers by Sergei Kolzun <x0r@dv-life.ru>\n");
118
119 return 0;
120
121err_free_mem:
122 kfree(axff);
123 return error;

--- 74 unchanged lines hidden ---