From ec85b6db3e36b355d24bd1381e73842ad0b472bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vuchener?= Date: Thu, 23 Mar 2017 14:23:21 +0100 Subject: [PATCH] hidpp20: Fix changing flags in hidpp20_special_key_mouse_set_control The first bit of each pair set is new state for the flag, the second must be set for the change to be made. --- src/hidpp20.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hidpp20.c b/src/hidpp20.c index e99d219e..83e64806 100644 --- a/src/hidpp20.c +++ b/src/hidpp20.c @@ -785,12 +785,15 @@ hidpp20_special_key_mouse_set_control(struct hidpp20_device *device, return -ENOTSUP; msg.msg.sub_id = feature_index; + msg.msg.parameters[2] |= 0x02; if (control->reporting.divert) - msg.msg.parameters[2] |= 0x03; + msg.msg.parameters[2] |= 0x01; + msg.msg.parameters[2] |= 0x08; if (control->reporting.persist) - msg.msg.parameters[2] |= 0x0c; + msg.msg.parameters[2] |= 0x04; + msg.msg.parameters[2] |= 0x20; if (control->reporting.raw_XY) - msg.msg.parameters[2] |= 0x20; + msg.msg.parameters[2] |= 0x10; return hidpp20_request_command(device, &msg); }