From a608dc1c06397dc50ab773498433432fb5938f92 Mon Sep 17 00:00:00 2001 From: José Expósito Date: Thu, 24 Nov 2022 18:59:37 +0100 Subject: HID: input: map battery system charging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jiri Kosina --- drivers/hid/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/hid/Kconfig') diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 17cce4c50e8d..1aa7b6614c20 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -1264,6 +1264,7 @@ config HID_MCP2221 config HID_KUNIT_TEST tristate "KUnit tests for HID" if !KUNIT_ALL_TESTS depends on KUNIT=y + depends on HID_BATTERY_STRENGTH depends on HID_UCLOGIC default KUNIT_ALL_TESTS help -- cgit