DNI: hid: jarvis: Fix lost key events
Mithun Maragiri [Wed, 30 Nov 2016 06:54:51 +0000 (22:54 -0800)]
The issue of key events getting lost happens when the HID report
is of the report->id = SENSOR_REPORT_ID_COMBINED.
Sensor report data from the data buffer was handled properly
however the button report part was not handled properly

Bug 200250863

Change-Id: Ib6cd985b472ba927aa854e9c4b7f4e243f5cd22e
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1263496
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-by: Martin Gao <marting@nvidia.com>
Reviewed-by: Siddardha Naraharisetti <siddardhan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

drivers/hid/hid-atv-jarvis.c

index 6c2de41..6aee1bf 100644 (file)
@@ -1663,9 +1663,11 @@ static int atvr_raw_event(struct hid_device *hdev, struct hid_report *report,
                        shdr_dev->snsr_fns && shdr_dev->snsr_fns->recv) {
                shdr_dev->snsr_fns->recv(shdr_dev->st, data, size);
                /* TODO: ret check */
-               if (report->id == SENSOR_REPORT_ID_COMBINED)
+               if (report->id == SENSOR_REPORT_ID_COMBINED) {
+                       data[0] = JAR_BUTTON_REPORT_ID;
                        hid_report_raw_event(hdev, 0, data,
                                             TS_BUTTON_REPORT_SIZE, 0);
+               }
                /* we've handled the event */
                return 1;
        }