Add uw charging profile init

This commit is contained in:
Christoffer Sandberg 2022-11-18 19:45:03 +01:00
parent 32e16b49f3
commit d6f32f7270

View file

@ -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);
}