Skip to content

Commit 00acc9e

Browse files
committed
Revert "HID: logitech: Add function to enable HID++ 1.0 "scrolling acceleration""
This reverts commit 051dc9b. It turns out the current API is not that compatible with some Microsoft mice, so better start again from scratch. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Harry Cutts <hcutts@chromium.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.cz>
1 parent 5372fc3 commit 00acc9e

File tree

1 file changed

+13
-34
lines changed

1 file changed

+13
-34
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -400,53 +400,32 @@ static void hidpp_prefix_name(char **name, int name_length)
400400
#define HIDPP_SET_LONG_REGISTER 0x82
401401
#define HIDPP_GET_LONG_REGISTER 0x83
402402

403-
/**
404-
* hidpp10_set_register_bit() - Sets a single bit in a HID++ 1.0 register.
405-
* @hidpp_dev: the device to set the register on.
406-
* @register_address: the address of the register to modify.
407-
* @byte: the byte of the register to modify. Should be less than 3.
408-
* Return: 0 if successful, otherwise a negative error code.
409-
*/
410-
static int hidpp10_set_register_bit(struct hidpp_device *hidpp_dev,
411-
u8 register_address, u8 byte, u8 bit)
403+
#define HIDPP_REG_GENERAL 0x00
404+
405+
static int hidpp10_enable_battery_reporting(struct hidpp_device *hidpp_dev)
412406
{
413407
struct hidpp_report response;
414408
int ret;
415409
u8 params[3] = { 0 };
416410

417411
ret = hidpp_send_rap_command_sync(hidpp_dev,
418-
REPORT_ID_HIDPP_SHORT,
419-
HIDPP_GET_REGISTER,
420-
register_address,
421-
NULL, 0, &response);
412+
REPORT_ID_HIDPP_SHORT,
413+
HIDPP_GET_REGISTER,
414+
HIDPP_REG_GENERAL,
415+
NULL, 0, &response);
422416
if (ret)
423417
return ret;
424418

425419
memcpy(params, response.rap.params, 3);
426420

427-
params[byte] |= BIT(bit);
421+
/* Set the battery bit */
422+
params[0] |= BIT(4);
428423

429424
return hidpp_send_rap_command_sync(hidpp_dev,
430-
REPORT_ID_HIDPP_SHORT,
431-
HIDPP_SET_REGISTER,
432-
register_address,
433-
params, 3, &response);
434-
}
435-
436-
437-
#define HIDPP_REG_GENERAL 0x00
438-
439-
static int hidpp10_enable_battery_reporting(struct hidpp_device *hidpp_dev)
440-
{
441-
return hidpp10_set_register_bit(hidpp_dev, HIDPP_REG_GENERAL, 0, 4);
442-
}
443-
444-
#define HIDPP_REG_FEATURES 0x01
445-
446-
/* On HID++ 1.0 devices, high-res scroll was called "scrolling acceleration". */
447-
static int hidpp10_enable_scrolling_acceleration(struct hidpp_device *hidpp_dev)
448-
{
449-
return hidpp10_set_register_bit(hidpp_dev, HIDPP_REG_FEATURES, 0, 6);
425+
REPORT_ID_HIDPP_SHORT,
426+
HIDPP_SET_REGISTER,
427+
HIDPP_REG_GENERAL,
428+
params, 3, &response);
450429
}
451430

452431
#define HIDPP_REG_BATTERY_STATUS 0x07

0 commit comments

Comments
 (0)