mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
HID: logitech-hidpp: notify battery on connect
When a device reconnects, there is a high chance its power supply has been changed (for a battery replacement for instance). Just forward the battery state here. Signed-off-by: Benjamin Tissoires <[email protected]> Tested-by: Bastien Nocera <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
a9525b80fe
commit
9b9c519f1f
1 changed files with 7 additions and 0 deletions
|
|
@ -2463,6 +2463,13 @@ static void hidpp_connect_event(struct hidpp_device *hidpp)
|
|||
|
||||
hidpp_initialize_battery(hidpp);
|
||||
|
||||
/* forward current battery state */
|
||||
if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP20_BATTERY) {
|
||||
hidpp20_query_battery_info(hidpp);
|
||||
if (hidpp->battery.ps)
|
||||
power_supply_changed(hidpp->battery.ps);
|
||||
}
|
||||
|
||||
if (!(hidpp->quirks & HIDPP_QUIRK_NO_HIDINPUT) || hidpp->delayed_input)
|
||||
/* if the input nodes are already created, we can stop now */
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue