From 23036eec089d41935fbac6ee3e44355947250add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vuchener?= Date: Tue, 30 Aug 2016 16:30:49 +0200 Subject: [PATCH 1/2] hwdb: Add new version for the G502 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new version is called "G502 Proteus Spectrum", so the older version comment is changed to "G502 Proteus Core" (its complete name) to avoid confusion. Signed-off-by: Clément Vuchener --- hwdb/70-libratbag-mouse.hwdb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hwdb/70-libratbag-mouse.hwdb b/hwdb/70-libratbag-mouse.hwdb index f4362ad4..147dc457 100644 --- a/hwdb/70-libratbag-mouse.hwdb +++ b/hwdb/70-libratbag-mouse.hwdb @@ -108,11 +108,15 @@ mouse:usb:v046dpc24e:name:*: RATBAG_HIDPP10_DPI=0:8200@50 RATBAG_HIDPP10_PROFILE=G500 -# G502 over USB +# G502 Proteus Core over USB mouse:usb:v046dpc07d:name:*: RATBAG_DRIVER=hidpp20 RATBAG_SVG=logitech-g502.svg +# G502 Proteus Spectrum over USB +mouse:usb:v046dpc332:name:*: + RATBAG_DRIVER=hidpp20 + # G700 over USB mouse:usb:v046dpc06b:name:*: RATBAG_DRIVER=hidpp10 From f72c96914b09f408bc6266cb49e6b58698bb13e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vuchener?= Date: Tue, 30 Aug 2016 16:50:18 +0200 Subject: [PATCH 2/2] hidpp20: fix reading has_dpi_shift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comparison was always false because of missing bit shift. Signed-off-by: Clément Vuchener --- src/hidpp20.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hidpp20.c b/src/hidpp20.c index 2b707a2b..9c493d75 100644 --- a/src/hidpp20.c +++ b/src/hidpp20.c @@ -1286,7 +1286,7 @@ hidpp20_onboard_profiles_initialize(struct hidpp20_device *device, profiles->num_buttons = msg.msg.parameters[5] <= 16 ? msg.msg.parameters[5] : 16; profiles->num_modes = HIDPP20_DPI_COUNT; profiles->has_g_shift = (info->mechanical_layout & 0x03) == 2; - profiles->has_dpi_shift = (info->mechanical_layout & 0x0c) == 2; + profiles->has_dpi_shift = ((info->mechanical_layout & 0x0c) >> 2) == 2; switch(info->various_info & 0x07) { case 1: profiles->corded = 1;