charging: Move event catch to appropriate place and tweak setting

- Charging profile prepared but not included (most likely not needed)
- Charging prio kept with slight delay to catch some timing issues

Note: Workaround not perfect but catches most cases where connecting
      barrel plug would make charging prio setting jump to charge battery
This commit is contained in:
Christoffer Sandberg 2023-02-14 16:56:22 +01:00
parent 4f9b49abe7
commit 646abc0426

View file

@ -386,11 +386,16 @@ void uniwill_event_callb(u32 code)
// Refresh keyboard state and charging profile on cable switch event
case UNIWILL_OSD_DC_ADAPTER_CHANGE:
uniwill_write_kbd_bl_state();
uw_charging_profile_write_state();
uw_charging_priority_write_state();
break;
}
}
switch (code) {
case UNIWILL_OSD_DC_ADAPTER_CHANGE:
msleep(50);
uw_charging_priority_write_state();
break;
}
}
static ssize_t uw_brightness_show(struct device *child,