Skip to content

Commit

Permalink
HID:hid-lg4ff: ensure ConstantForce is disabled when set to 0
Browse files Browse the repository at this point in the history
When 'Constant Force' is set to 0 it is not turned off completely,
the wheel feels 'heavy'. This patch issues the '13 00..' command
to ensure that the force in slot 1 (the Constant Force) is
deactivated.

Reported-by: Elias Vanderstuyft <[email protected]>
Signed-off-by: Simon Wood <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
mungewell authored and Jiri Kosina committed Nov 8, 2013
1 parent d2c02da commit 56930e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/hid/hid-lg4ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,21 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e
case FF_CONSTANT:
x = effect->u.ramp.start_level + 0x80; /* 0x80 is no force */
CLAMP(x);

if (x == 0x80) {
/* De-activate force in slot-1*/
value[0] = 0x13;
value[1] = 0x00;
value[2] = 0x00;
value[3] = 0x00;
value[4] = 0x00;
value[5] = 0x00;
value[6] = 0x00;

hid_hw_request(hid, report, HID_REQ_SET_REPORT);
return 0;
}

value[0] = 0x11; /* Slot 1 */
value[1] = 0x08;
value[2] = x;
Expand Down

0 comments on commit 56930e7

Please sign in to comment.