diff options
| -rw-r--r-- | drivers/hid/hid-lg4ff.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 530fcd19e90e..49f6cc0f9919 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
| @@ -220,6 +220,20 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud | |||
| 220 | __s32 *value = report->field[0]->value; | 220 | __s32 *value = report->field[0]->value; |
| 221 | __u32 expand_a, expand_b; | 221 | __u32 expand_a, expand_b; |
| 222 | 222 | ||
| 223 | /* De-activate Auto-Center */ | ||
| 224 | if (magnitude == 0) { | ||
| 225 | value[0] = 0xf5; | ||
| 226 | value[1] = 0x00; | ||
| 227 | value[2] = 0x00; | ||
| 228 | value[3] = 0x00; | ||
| 229 | value[4] = 0x00; | ||
| 230 | value[5] = 0x00; | ||
| 231 | value[6] = 0x00; | ||
| 232 | |||
| 233 | hid_hw_request(hid, report, HID_REQ_SET_REPORT); | ||
| 234 | return; | ||
| 235 | } | ||
| 236 | |||
| 223 | if (magnitude <= 0xaaaa) { | 237 | if (magnitude <= 0xaaaa) { |
| 224 | expand_a = 0x0c * magnitude; | 238 | expand_a = 0x0c * magnitude; |
| 225 | expand_b = 0x80 * magnitude; | 239 | expand_b = 0x80 * magnitude; |
| @@ -237,6 +251,17 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud | |||
| 237 | value[6] = 0x00; | 251 | value[6] = 0x00; |
| 238 | 252 | ||
| 239 | hid_hw_request(hid, report, HID_REQ_SET_REPORT); | 253 | hid_hw_request(hid, report, HID_REQ_SET_REPORT); |
| 254 | |||
| 255 | /* Activate Auto-Center */ | ||
| 256 | value[0] = 0x14; | ||
| 257 | value[1] = 0x00; | ||
| 258 | value[2] = 0x00; | ||
| 259 | value[3] = 0x00; | ||
| 260 | value[4] = 0x00; | ||
| 261 | value[5] = 0x00; | ||
| 262 | value[6] = 0x00; | ||
| 263 | |||
| 264 | hid_hw_request(hid, report, HID_REQ_SET_REPORT); | ||
| 240 | } | 265 | } |
| 241 | 266 | ||
| 242 | /* Sends autocentering command compatible with Formula Force EX */ | 267 | /* Sends autocentering command compatible with Formula Force EX */ |
