@@ -335,36 +335,20 @@ static int asus_raw_event(struct hid_device *hdev,
335
335
if (drvdata -> quirks & QUIRK_MEDION_E1239T )
336
336
return asus_e1239t_event (drvdata , data , size );
337
337
338
- if (drvdata -> quirks & QUIRK_USE_KBD_BACKLIGHT ) {
338
+ /*
339
+ * Skip these report ID, the device emits a continuous stream associated
340
+ * with the AURA mode it is in which looks like an 'echo'.
341
+ */
342
+ if (report -> id == FEATURE_KBD_LED_REPORT_ID1 || report -> id == FEATURE_KBD_LED_REPORT_ID2 )
343
+ return -1 ;
344
+ if (drvdata -> quirks & QUIRK_ROG_NKEY_KEYBOARD ) {
339
345
/*
340
- * Skip these report ID, the device emits a continuous stream associated
341
- * with the AURA mode it is in which looks like an 'echo' .
346
+ * G713 and G733 send these codes on some keypresses, depending on
347
+ * the key pressed it can trigger a shutdown event if not caught .
342
348
*/
343
- if (report -> id == FEATURE_KBD_LED_REPORT_ID1 ||
344
- report -> id == FEATURE_KBD_LED_REPORT_ID2 ) {
349
+ if (data [0 ] == 0x02 && data [1 ] == 0x30 ) {
345
350
return -1 ;
346
- /* Additional report filtering */
347
- } else if (report -> id == FEATURE_KBD_REPORT_ID ) {
348
- /*
349
- * G14 and G15 send these codes on some keypresses with no
350
- * discernable reason for doing so. We'll filter them out to avoid
351
- * unmapped warning messages later.
352
- */
353
- if (data [1 ] == 0xea || data [1 ] == 0xec || data [1 ] == 0x02 ||
354
- data [1 ] == 0x8a || data [1 ] == 0x9e ) {
355
- return -1 ;
356
- }
357
351
}
358
- if (drvdata -> quirks & QUIRK_ROG_NKEY_KEYBOARD ) {
359
- /*
360
- * G713 and G733 send these codes on some keypresses, depending on
361
- * the key pressed it can trigger a shutdown event if not caught.
362
- */
363
- if (data [0 ] == 0x02 && data [1 ] == 0x30 ) {
364
- return -1 ;
365
- }
366
- }
367
-
368
352
}
369
353
370
354
if (drvdata -> quirks & QUIRK_ROG_CLAYMORE_II_KEYBOARD ) {
@@ -1250,6 +1234,19 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
1250
1234
rdesc [205 ] = 0x01 ;
1251
1235
}
1252
1236
1237
+ /* match many more n-key devices */
1238
+ if (drvdata -> quirks & QUIRK_ROG_NKEY_KEYBOARD ) {
1239
+ for (int i = 0 ; i < * rsize + 1 ; i ++ ) {
1240
+ /* offset to the count from 0x5a report part always 14 */
1241
+ if (rdesc [i ] == 0x85 && rdesc [i + 1 ] == 0x5a &&
1242
+ rdesc [i + 14 ] == 0x95 && rdesc [i + 15 ] == 0x05 ) {
1243
+ hid_info (hdev , "Fixing up Asus N-Key report descriptor\n" );
1244
+ rdesc [i + 15 ] = 0x01 ;
1245
+ break ;
1246
+ }
1247
+ }
1248
+ }
1249
+
1253
1250
return rdesc ;
1254
1251
}
1255
1252
@@ -1319,4 +1316,4 @@ static struct hid_driver asus_driver = {
1319
1316
};
1320
1317
module_hid_driver (asus_driver );
1321
1318
1322
- MODULE_LICENSE ("GPL" );
1319
+ MODULE_LICENSE ("GPL" );
0 commit comments