• Roderick Colenbrander's avatar
    HID: sony: Report more accurate DS4 power status. · a76a6c18
    Roderick Colenbrander authored
    This patch moves the power supply status logic to DS3/DS4 parse_report,
    to allow for more accurate DS4 status reporting.
    
    The DS4 power status code was actually incorrect, but reported okay'ish
    data in most cases. There was a different interpretation of the battery_info
    values 0-10 or 0-9 depending on cable state. It added +1 to extend the range
    to 0-10. This is actually incorrect, there is no different range. Values
    higher than 11 actually indicates 'full' and 14/15 'error' for which we
    reported 100% and a valid power state.
    
    Moving the status logic to parse_report avoids having to pass more state
    to the generic sony_battery_get_property and simplifies the code.
    Signed-off-by: default avatarRoderick Colenbrander <roderick.colenbrander@sony.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    a76a6c18
hid-sony.c 91.8 KB