From a941b75ef2ce8ad154ee8920f284cb0dbd774084 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 31 Jul 2019 09:31:35 +1000 Subject: [PATCH] hidpp10: if the current profile is the factory profile, pretend it's 0 Rather than bail out completely, let's pretend the factory profile is profile 0 and keep going. This gives us a pretend-function mouse, though whether this actually works is questionable. Signed-off-by: Peter Hutterer --- src/hidpp10.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hidpp10.c b/src/hidpp10.c index b0ad53f4..fde515e9 100644 --- a/src/hidpp10.c +++ b/src/hidpp10.c @@ -833,6 +833,15 @@ hidpp10_get_current_profile(struct hidpp10_device *dev, uint8_t *current_profile "unable to find the profile at (%d,%d) in the directory\n", page, offset); break; + case PROFILE_TYPE_FACTORY: + /* Factory profile is selected and profile switching is + * disabled. Let's default to the first profile because what + * else? + */ + *current_profile = 0; + hidpp_log_info(&dev->base, + "current profile is factory profile, pretending it's profile 0\n"); + return 0; default: hidpp_log_error(&dev->base, "Unexpected value: %02x\n",