mirror of
https://github.com/wessel-novacustom/clevo-keyboard.git
synced 2024-11-15 03:34:01 +01:00
Add charging prio init
This commit is contained in:
parent
0ba6d70c06
commit
acc12d579f
|
@ -765,6 +765,8 @@ static int uw_lightbar_remove(struct platform_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool uw_charging_prio_loaded = false;
|
||||
|
||||
/*
|
||||
* charging_prio values
|
||||
* 0 => charging priority
|
||||
|
@ -1026,11 +1028,16 @@ static int uniwill_keyboard_probe(struct platform_device *dev)
|
|||
status = uw_lightbar_init(dev);
|
||||
uw_lightbar_loaded = (status >= 0);
|
||||
|
||||
if (uw_feats->uniwill_has_charging_prio)
|
||||
uw_charging_prio_loaded = sysfs_create_group(&dev->dev.kobj, &uw_charging_prio_attr_group) == 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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 (uniwill_kbd_bl_type_rgb_single_color) {
|
||||
sysfs_remove_group(&dev->dev.kobj, &uw_kbd_bl_color_attr_group);
|
||||
|
|
Loading…
Reference in a new issue