aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-input-test.c
Commit message (Collapse)AuthorAgeFilesLines
* HID: input: rename hidinput_set_battery_charge_status()José Expósito2025-08-201-5/+5
| | | | | | | | | | | | | In preparation for a patch fixing a bug affecting hidinput_set_battery_charge_status(), rename the function to hidinput_update_battery_charge_status() and move it up so it can be used by hidinput_update_battery(). Refactor, no functional changes. Tested-by: 卢国宏 <[email protected]> Signed-off-by: José Expósito <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
* HID: input: map battery system chargingJosé Expósito2022-12-201-0/+80
HID descriptors with Battery System (0x85) Charging (0x44) usage are ignored and POWER_SUPPLY_STATUS_DISCHARGING is always reported to user space, even when the device is charging. Map this usage and when it is reported set the right charging status. In addition, add KUnit tests to make sure that the charging status is correctly set and reported. They can be run with the usual command: $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/hid Signed-off-by: José Expósito <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>