Commit 505f394f authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Jiri Kosina

HID: hid-input: fix stylus battery reporting

With commit 4f388217 hid-input started clearing of "ignored" usages
to avoid using garbage that might have been left in them. However
"battery strength" usages should not be ignored, as we do want to
use them.

Fixes: 4f388217 ("HID: hid-input: clear unmapped usages")
Reported-by: default avatarKenneth Albanowski <kenalba@google.com>
Tested-by: default avatarKenneth Albanowski <kenalba@google.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent d9216d75
...@@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x3b: /* Battery Strength */ case 0x3b: /* Battery Strength */
hidinput_setup_battery(device, HID_INPUT_REPORT, field); hidinput_setup_battery(device, HID_INPUT_REPORT, field);
usage->type = EV_PWR; usage->type = EV_PWR;
goto ignore; return;
case 0x3c: /* Invert */ case 0x3c: /* Invert */
map_key_clear(BTN_TOOL_RUBBER); map_key_clear(BTN_TOOL_RUBBER);
...@@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case HID_DC_BATTERYSTRENGTH: case HID_DC_BATTERYSTRENGTH:
hidinput_setup_battery(device, HID_INPUT_REPORT, field); hidinput_setup_battery(device, HID_INPUT_REPORT, field);
usage->type = EV_PWR; usage->type = EV_PWR;
goto ignore; return;
} }
goto unknown; goto unknown;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment