From c56c76e07d539d24eb4f5052436f7068d5b69d9b Mon Sep 17 00:00:00 2001 From: Ogier Bouvier Date: Thu, 14 Sep 2017 13:28:22 +0200 Subject: [PATCH] hidpp20: fix resolution count detection fix #343 Signed-off-by: Ogier Bouvier --- src/driver-hidpp20.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 807343d4..564d9c12 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -495,7 +495,12 @@ hidpp20drv_read_resolution_dpi_2201(struct ratbag_device *device) drv_data->sensors[0].dpi_max); drv_data->num_sensors = rc; - drv_data->num_resolutions = drv_data->num_sensors; + + /* if 0x8100 has already been enumerated we already have the supported + * number of resolutions and shouldn't overwrite it + */ + if (!(drv_data->capabilities & HIDPP_CAP_ONBOARD_PROFILES_8100)) + drv_data->num_resolutions = drv_data->num_sensors; return 0; }