From d6f32f72701cc6993fe780f70216c30390e721b8 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Fri, 18 Nov 2022 19:45:03 +0100 Subject: [PATCH] Add uw charging profile init --- src/uniwill_keyboard.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index e0963c6..ba8b1f7 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -810,6 +810,8 @@ static int uw_has_charging_priority(bool *status) return result; } +static bool uw_charging_profile_loaded = false; + /* * charging_profile values * 0 => high capacity @@ -1130,6 +1132,8 @@ static int uniwill_keyboard_probe(struct platform_device *dev) if (uw_feats->uniwill_has_charging_prio) uw_charging_prio_loaded = sysfs_create_group(&dev->dev.kobj, &uw_charging_prio_attr_group) == 0; + uw_charging_profile_loaded = sysfs_create_group(&dev->dev.kobj, &uw_charging_profile_attr_group) == 0; + return 0; } @@ -1138,6 +1142,9 @@ static int uniwill_keyboard_remove(struct platform_device *dev) if (uw_charging_prio_loaded) sysfs_remove_group(&dev->dev.kobj, &uw_charging_prio_attr_group); + if (uw_charging_profile_loaded) + sysfs_remove_group(&dev->dev.kobj, &uw_charging_profile_attr_group); + if (uniwill_kbd_bl_type_rgb_single_color) { sysfs_remove_group(&dev->dev.kobj, &uw_kbd_bl_color_attr_group); }