From b2fb91e2613a6162e4ad43d1926bdf6761cb5e5b Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Mon, 24 Jan 2022 00:09:40 +0300 Subject: [PATCH] sinowealth: use correct bits for report rate Turns out it takes the whole nibble, not just three bits. --- src/driver-sinowealth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver-sinowealth.c b/src/driver-sinowealth.c index 08a80c2b..abf84020 100644 --- a/src/driver-sinowealth.c +++ b/src/driver-sinowealth.c @@ -309,7 +309,7 @@ sinowealth_update_profile_from_config(struct ratbag_profile *profile) struct ratbag_led *led; /* Report rate */ - const uint8_t reported_rate = config->config & 0b111U; + const uint8_t reported_rate = config->config & 0b1111U; unsigned int hz = 0; switch (reported_rate) { case 0x01: @@ -540,7 +540,7 @@ sinowealth_commit(struct ratbag_device *device) profile->hz = 250; reported_rate = 0x02; } - config->config &= ~0b111U; + config->config &= ~0b1111U; config->config |= reported_rate; /* Check if any resolution requires independent XY DPIs */