diff options
Diffstat (limited to 'drivers/hid/hid-lg4ff.c')
-rw-r--r-- | drivers/hid/hid-lg4ff.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 5492809a579f..befe0e336471 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
@@ -234,6 +234,20 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud | |||
234 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); | 234 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); |
235 | __s32 *value = report->field[0]->value; | 235 | __s32 *value = report->field[0]->value; |
236 | __u32 expand_a, expand_b; | 236 | __u32 expand_a, expand_b; |
237 | struct lg4ff_device_entry *entry; | ||
238 | struct lg_drv_data *drv_data; | ||
239 | |||
240 | drv_data = hid_get_drvdata(hid); | ||
241 | if (!drv_data) { | ||
242 | hid_err(hid, "Private driver data not found!\n"); | ||
243 | return; | ||
244 | } | ||
245 | |||
246 | entry = drv_data->device_props; | ||
247 | if (!entry) { | ||
248 | hid_err(hid, "Device properties not found!\n"); | ||
249 | return; | ||
250 | } | ||
237 | 251 | ||
238 | /* De-activate Auto-Center */ | 252 | /* De-activate Auto-Center */ |
239 | if (magnitude == 0) { | 253 | if (magnitude == 0) { |
@@ -257,6 +271,16 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud | |||
257 | expand_b = (0x80 * 0xaaaa) + 0xff * (magnitude - 0xaaaa); | 271 | expand_b = (0x80 * 0xaaaa) + 0xff * (magnitude - 0xaaaa); |
258 | } | 272 | } |
259 | 273 | ||
274 | /* Adjust for non-MOMO wheels */ | ||
275 | switch (entry->product_id) { | ||
276 | case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL: | ||
277 | case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2: | ||
278 | break; | ||
279 | default: | ||
280 | expand_a = expand_a >> 1; | ||
281 | break; | ||
282 | } | ||
283 | |||
260 | value[0] = 0xfe; | 284 | value[0] = 0xfe; |
261 | value[1] = 0x0d; | 285 | value[1] = 0x0d; |
262 | value[2] = expand_a / 0xaaaa; | 286 | value[2] = expand_a / 0xaaaa; |