mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-08 07:33:53 +01:00
hidpp20/data: add the G305
Signed-off-by: Filipe Laíns <lains@archlinux.org>
This commit is contained in:
committed by
Filipe Laíns
parent
edb054c6f8
commit
81c7b42bec
@@ -2611,6 +2611,15 @@ hidpp20_onboard_profiles_initialize(struct hidpp20_device *device,
|
||||
HIDPP20_USER_PROFILES_G402,
|
||||
profiles->sector_size,
|
||||
data);
|
||||
|
||||
if (rc && device->quirk != HIDPP20_QUIRK_G305) {
|
||||
/* The G305 has a bug where it throws an ERR_INVALID_ARGUMENT
|
||||
if the sector has not been written to yet. If this happens
|
||||
we will read the ROM profiles.*/
|
||||
read_userdata = false;
|
||||
goto read_profiles;
|
||||
}
|
||||
|
||||
if (rc < 0)
|
||||
return rc; // ignore_clang_sa_mem_leak
|
||||
|
||||
@@ -2644,6 +2653,7 @@ hidpp20_onboard_profiles_initialize(struct hidpp20_device *device,
|
||||
read_userdata = false;
|
||||
}
|
||||
|
||||
read_profiles:
|
||||
for (i = 0; i < profiles->num_profiles; i++) {
|
||||
if (read_userdata) {
|
||||
hidpp_log_debug(&device->base, "Parsing profile %u\n", i);
|
||||
|
||||
@@ -53,6 +53,7 @@ struct hidpp20_feature {
|
||||
|
||||
enum hidpp20_quirk {
|
||||
HIDPP20_QUIRK_NONE,
|
||||
HIDPP20_QUIRK_G305,
|
||||
};
|
||||
|
||||
struct hidpp20_device {
|
||||
|
||||
@@ -164,7 +164,12 @@ init_data_hidpp20(struct ratbag *ratbag,
|
||||
if (error)
|
||||
g_error_free(error);
|
||||
|
||||
str = g_key_file_get_string(keyfile, group, "Quirk", NULL);
|
||||
data->hidpp20.quirk = HIDPP20_QUIRK_NONE;
|
||||
if (str) {
|
||||
if (streq(str, "G305"))
|
||||
data->hidpp20.quirk = HIDPP20_QUIRK_G305;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user