lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.9 331/757] HID: hid-input: fix stylus battery reporting
    Date
    From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

    [ Upstream commit 505f394fa239cecb76d916aa858f87ed7ea7fde4 ]

    With commit 4f3882177240 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: 4f3882177240 ("HID: hid-input: clear unmapped usages")
    Reported-by: Kenneth Albanowski <kenalba@google.com>
    Tested-by: Kenneth Albanowski <kenalba@google.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/hid/hid-input.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
    index 88e19996427e6..9770db624bfaf 100644
    --- a/drivers/hid/hid-input.c
    +++ b/drivers/hid/hid-input.c
    @@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
    case 0x3b: /* Battery Strength */
    hidinput_setup_battery(device, HID_INPUT_REPORT, field);
    usage->type = EV_PWR;
    - goto ignore;
    + return;

    case 0x3c: /* Invert */
    map_key_clear(BTN_TOOL_RUBBER);
    @@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
    case HID_DC_BATTERYSTRENGTH:
    hidinput_setup_battery(device, HID_INPUT_REPORT, field);
    usage->type = EV_PWR;
    - goto ignore;
    + return;
    }
    goto unknown;

    --
    2.25.1


    \
     
     \ /
      Last update: 2020-10-27 17:11    [W:4.030 / U:0.312 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site