[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220210190437.50152-8-jose.exposito89@gmail.com>
Date: Thu, 10 Feb 2022 20:04:37 +0100
From: José Expósito <jose.exposito89@...il.com>
To: jikos@...nel.org
Cc: benjamin.tissoires@...hat.com, spbnick@...il.com,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
José Expósito <jose.exposito89@...il.com>
Subject: [PATCH 7/7] HID: uclogic: Handle virtual frame reports
From: Nikolai Kondrashov <spbnick@...il.com>
Explicitly change report ID to virtual ID and handle virtual frame
reports as real for consistency.
Signed-off-by: Nikolai Kondrashov <spbnick@...il.com>
Signed-off-by: José Expósito <jose.exposito89@...il.com>
---
drivers/hid/hid-uclogic-core.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index 8aac3f7a9cda..73d79d149869 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -365,6 +365,7 @@ static int uclogic_raw_event(struct hid_device *hdev,
struct hid_report *report,
u8 *data, int size)
{
+ unsigned int report_id = report->id;
struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
struct uclogic_params *params = &drvdata->params;
@@ -374,20 +375,20 @@ static int uclogic_raw_event(struct hid_device *hdev,
/* Tweak pen reports, if necessary */
if (!params->pen_unused &&
- (report->id == params->pen.id) &&
+ (report_id == params->pen.id) &&
(size >= 2)) {
/* If it's the "virtual" frame controls report */
if (params->frame.id != 0 &&
data[1] & params->pen_frame_flag) {
/* Change to virtual frame controls report ID */
- data[0] = params->frame.id;
- return 0;
+ report_id = data[0] = params->frame.id;
+ } else {
+ return uclogic_raw_event_pen(drvdata, data, size);
}
- return uclogic_raw_event_pen(drvdata, data, size);
}
/* Tweak frame control reports, if necessary */
- if (report->id == params->frame.id)
+ if (report_id == params->frame.id)
return uclogic_raw_event_frame(drvdata, data, size);
return 0;
--
2.25.1
Powered by blists - more mailing lists