• D
    HID: wiimote: use cached battery values on I/O failure · 6b80bb94
    David Herrmann 提交于
    Battery reports are sent along every status report of the Wii Remote.
    So chances are pretty high that we have an up-to-date battery
    cache at any time. Therefore, initialize the battery-cache to 100% and
    then return battery values from the cache if the query fails.
    
    This works around a power_supply limitation in that it requires us to be
    able to query the device during power_supply registration and
    removal. Otherwise, "add" or "remove" udev events are not sent. If
    we answer these requests from our cache instead, we avoid dropping these
    events and no longer cause warnings printed.
    Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
    Signed-off-by: NJiri Kosina <jkosina@suse.cz>
    6b80bb94
hid-wiimote-core.c 37.8 KB