diff options
author | Simon Wood <simon@mungewell.org> | 2013-11-06 14:30:42 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-11-08 08:12:08 -0500 |
commit | 56930e7ab86f9f453399cfaa4d78525c1e028a8f (patch) | |
tree | 812767ac0fc81dbb71499e29f981be377eed8b06 /drivers/hid/hid-lg4ff.c | |
parent | d2c02da549b468bbb28e67d269bd3c9e10683ff5 (diff) |
HID:hid-lg4ff: ensure ConstantForce is disabled when set to 0
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 <elias.vds@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-lg4ff.c')
-rw-r--r-- | drivers/hid/hid-lg4ff.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 49f6cc0f9919..5d140b7a450a 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
@@ -196,6 +196,21 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e | |||
196 | case FF_CONSTANT: | 196 | case FF_CONSTANT: |
197 | x = effect->u.ramp.start_level + 0x80; /* 0x80 is no force */ | 197 | x = effect->u.ramp.start_level + 0x80; /* 0x80 is no force */ |
198 | CLAMP(x); | 198 | CLAMP(x); |
199 | |||
200 | if (x == 0x80) { | ||
201 | /* De-activate force in slot-1*/ | ||
202 | value[0] = 0x13; | ||
203 | value[1] = 0x00; | ||
204 | value[2] = 0x00; | ||
205 | value[3] = 0x00; | ||
206 | value[4] = 0x00; | ||
207 | value[5] = 0x00; | ||
208 | value[6] = 0x00; | ||
209 | |||
210 | hid_hw_request(hid, report, HID_REQ_SET_REPORT); | ||
211 | return 0; | ||
212 | } | ||
213 | |||
199 | value[0] = 0x11; /* Slot 1 */ | 214 | value[0] = 0x11; /* Slot 1 */ |
200 | value[1] = 0x08; | 215 | value[1] = 0x08; |
201 | value[2] = x; | 216 | value[2] = x; |