aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-02-18 01:42:11 -0500
committerDmitry Torokhov <dtor@insightbb.com>2007-02-18 01:42:11 -0500
commit00a8691ca689c134eaf5b73d7251df1d6f0318be (patch)
treee13427892468941c2e3895b4bfc6978665f34e42 /drivers/usb/input
parent130b1ab3f3dba350a949ae44a39c9beebddc09b9 (diff)
Input: hid-lgff - treat devices as joysticks unless told otherwise
By default threat devices as joysticks with constant force-feedback effect. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb/input')
-rw-r--r--drivers/usb/input/hid-lgff.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c
index d1a4dffd30f1..e6f3af3e66d1 100644
--- a/drivers/usb/input/hid-lgff.c
+++ b/drivers/usb/input/hid-lgff.c
@@ -55,7 +55,6 @@ static const struct dev_type devices[] = {
55 { 0x046d, 0xc294, ff_joystick }, 55 { 0x046d, 0xc294, ff_joystick },
56 { 0x046d, 0xc295, ff_joystick }, 56 { 0x046d, 0xc295, ff_joystick },
57 { 0x046d, 0xca03, ff_joystick }, 57 { 0x046d, 0xca03, ff_joystick },
58 { 0x0000, 0x0000, ff_joystick }
59}; 58};
60 59
61static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect) 60static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
@@ -107,8 +106,9 @@ int hid_lgff_init(struct hid_device* hid)
107 struct input_dev *dev = hidinput->input; 106 struct input_dev *dev = hidinput->input;
108 struct hid_report *report; 107 struct hid_report *report;
109 struct hid_field *field; 108 struct hid_field *field;
109 const signed short *ff_bits = ff_joystick;
110 int error; 110 int error;
111 int i, j; 111 int i;
112 112
113 /* Find the report to use */ 113 /* Find the report to use */
114 if (list_empty(report_list)) { 114 if (list_empty(report_list)) {
@@ -132,12 +132,14 @@ int hid_lgff_init(struct hid_device* hid)
132 for (i = 0; i < ARRAY_SIZE(devices); i++) { 132 for (i = 0; i < ARRAY_SIZE(devices); i++) {
133 if (dev->id.vendor == devices[i].idVendor && 133 if (dev->id.vendor == devices[i].idVendor &&
134 dev->id.product == devices[i].idProduct) { 134 dev->id.product == devices[i].idProduct) {
135 for (j = 0; devices[i].ff[j] >= 0; j++) 135 ff_bits = devices[i].ff;
136 set_bit(devices[i].ff[j], dev->ffbit);
137 break; 136 break;
138 } 137 }
139 } 138 }
140 139
140 for (i = 0; ff_bits[i] >= 0; i++)
141 set_bit(ff_bits[i], dev->ffbit);
142
141 error = input_ff_create_memless(dev, NULL, hid_lgff_play); 143 error = input_ff_create_memless(dev, NULL, hid_lgff_play);
142 if (error) 144 if (error)
143 return error; 145 return error;