@@ -268,6 +268,137 @@ static __u8 easypen_m610x_rdesc_fixed[] = {
268
268
0xC0 /* End Collection */
269
269
};
270
270
271
+
272
+ /* Original PenSketch M912 report descriptor size */
273
+ #define PENSKETCH_M912_RDESC_ORIG_SIZE 482
274
+
275
+ /* Fixed PenSketch M912 report descriptor */
276
+ static __u8 pensketch_m912_rdesc_fixed [] = {
277
+ 0x05 , 0x01 , /* Usage Page (Desktop), */
278
+ 0x08 , /* Usage (00h), */
279
+ 0xA1 , 0x01 , /* Collection (Application), */
280
+ 0x85 , 0x05 , /* Report ID (5), */
281
+ 0x06 , 0x00 , 0xFF , /* Usage Page (FF00h), */
282
+ 0x09 , 0x01 , /* Usage (01h), */
283
+ 0x15 , 0x81 , /* Logical Minimum (-127), */
284
+ 0x25 , 0x7F , /* Logical Maximum (127), */
285
+ 0x75 , 0x08 , /* Report Size (8), */
286
+ 0x95 , 0x07 , /* Report Count (7), */
287
+ 0xB1 , 0x02 , /* Feature (Variable), */
288
+ 0xC0 , /* End Collection, */
289
+ 0x05 , 0x0D , /* Usage Page (Digitizer), */
290
+ 0x09 , 0x02 , /* Usage (Pen), */
291
+ 0xA1 , 0x01 , /* Collection (Application), */
292
+ 0x85 , 0x10 , /* Report ID (16), */
293
+ 0x09 , 0x20 , /* Usage (Stylus), */
294
+ 0xA0 , /* Collection (Physical), */
295
+ 0x09 , 0x42 , /* Usage (Tip Switch), */
296
+ 0x09 , 0x44 , /* Usage (Barrel Switch), */
297
+ 0x09 , 0x46 , /* Usage (Tablet Pick), */
298
+ 0x14 , /* Logical Minimum (0), */
299
+ 0x25 , 0x01 , /* Logical Maximum (1), */
300
+ 0x75 , 0x01 , /* Report Size (1), */
301
+ 0x95 , 0x03 , /* Report Count (3), */
302
+ 0x81 , 0x02 , /* Input (Variable), */
303
+ 0x95 , 0x04 , /* Report Count (4), */
304
+ 0x81 , 0x03 , /* Input (Constant, Variable), */
305
+ 0x09 , 0x32 , /* Usage (In Range), */
306
+ 0x95 , 0x01 , /* Report Count (1), */
307
+ 0x81 , 0x02 , /* Input (Variable), */
308
+ 0x75 , 0x10 , /* Report Size (16), */
309
+ 0x95 , 0x01 , /* Report Count (1), */
310
+ 0xA4 , /* Push, */
311
+ 0x05 , 0x01 , /* Usage Page (Desktop), */
312
+ 0x55 , 0xFD , /* Unit Exponent (-3), */
313
+ 0x65 , 0x13 , /* Unit (Inch), */
314
+ 0x14 , /* Logical Minimum (0), */
315
+ 0x34 , /* Physical Minimum (0), */
316
+ 0x09 , 0x30 , /* Usage (X), */
317
+ 0x27 , 0x00 , 0xF0 , 0x00 , 0x00 , /* Logical Maximum (61440), */
318
+ 0x46 , 0xE0 , 0x2E , /* Physical Maximum (12000), */
319
+ 0x81 , 0x02 , /* Input (Variable), */
320
+ 0x09 , 0x31 , /* Usage (Y), */
321
+ 0x27 , 0x00 , 0xB4 , 0x00 , 0x00 , /* Logical Maximum (46080), */
322
+ 0x46 , 0x28 , 0x23 , /* Physical Maximum (9000), */
323
+ 0x81 , 0x02 , /* Input (Variable), */
324
+ 0xB4 , /* Pop, */
325
+ 0x09 , 0x30 , /* Usage (Tip Pressure), */
326
+ 0x14 , /* Logical Minimum (0), */
327
+ 0x26 , 0xFF , 0x07 , /* Logical Maximum (2047), */
328
+ 0x81 , 0x02 , /* Input (Variable), */
329
+ 0xC0 , /* End Collection, */
330
+ 0xC0 , /* End Collection, */
331
+ 0x05 , 0x0D , /* Usage Page (Digitizer), */
332
+ 0x09 , 0x21 , /* Usage (Puck), */
333
+ 0xA1 , 0x01 , /* Collection (Application), */
334
+ 0x85 , 0x11 , /* Report ID (17), */
335
+ 0x09 , 0x21 , /* Usage (Puck), */
336
+ 0xA0 , /* Collection (Physical), */
337
+ 0x05 , 0x09 , /* Usage Page (Button), */
338
+ 0x75 , 0x01 , /* Report Size (1), */
339
+ 0x19 , 0x01 , /* Usage Minimum (01h), */
340
+ 0x29 , 0x03 , /* Usage Maximum (03h), */
341
+ 0x14 , /* Logical Minimum (0), */
342
+ 0x25 , 0x01 , /* Logical Maximum (1), */
343
+ 0x95 , 0x03 , /* Report Count (3), */
344
+ 0x81 , 0x02 , /* Input (Variable), */
345
+ 0x95 , 0x04 , /* Report Count (4), */
346
+ 0x81 , 0x01 , /* Input (Constant), */
347
+ 0x95 , 0x01 , /* Report Count (1), */
348
+ 0x0B , 0x32 , 0x00 , 0x0D , 0x00 , /* Usage (Digitizer In Range), */
349
+ 0x14 , /* Logical Minimum (0), */
350
+ 0x25 , 0x01 , /* Logical Maximum (1), */
351
+ 0x81 , 0x02 , /* Input (Variable), */
352
+ 0xA4 , /* Push, */
353
+ 0x05 , 0x01 , /* Usage Page (Desktop), */
354
+ 0x75 , 0x10 , /* Report Size (16), */
355
+ 0x95 , 0x01 , /* Report Count (1), */
356
+ 0x55 , 0xFD , /* Unit Exponent (-3), */
357
+ 0x65 , 0x13 , /* Unit (Inch), */
358
+ 0x14 , /* Logical Minimum (0), */
359
+ 0x34 , /* Physical Minimum (0), */
360
+ 0x09 , 0x30 , /* Usage (X), */
361
+ 0x27 , 0x00 , 0xF0 , 0x00 , 0x00 , /* Logical Maximum (61440), */
362
+ 0x46 , 0xE0 , 0x2E , /* Physical Maximum (12000), */
363
+ 0x81 , 0x02 , /* Input (Variable), */
364
+ 0x09 , 0x31 , /* Usage (Y), */
365
+ 0x27 , 0x00 , 0xB4 , 0x00 , 0x00 , /* Logical Maximum (46080), */
366
+ 0x46 , 0x28 , 0x23 , /* Physical Maximum (9000), */
367
+ 0x81 , 0x02 , /* Input (Variable), */
368
+ 0x09 , 0x38 , /* Usage (Wheel), */
369
+ 0x75 , 0x08 , /* Report Size (8), */
370
+ 0x95 , 0x01 , /* Report Count (1), */
371
+ 0x15 , 0xFF , /* Logical Minimum (-1), */
372
+ 0x25 , 0x01 , /* Logical Maximum (1), */
373
+ 0x34 , /* Physical Minimum (0), */
374
+ 0x44 , /* Physical Maximum (0), */
375
+ 0x81 , 0x06 , /* Input (Variable, Relative), */
376
+ 0xB4 , /* Pop, */
377
+ 0xC0 , /* End Collection, */
378
+ 0xC0 , /* End Collection, */
379
+ 0x05 , 0x0C , /* Usage Page (Consumer), */
380
+ 0x09 , 0x01 , /* Usage (Consumer Control), */
381
+ 0xA1 , 0x01 , /* Collection (Application), */
382
+ 0x85 , 0x12 , /* Report ID (18), */
383
+ 0x14 , /* Logical Minimum (0), */
384
+ 0x25 , 0x01 , /* Logical Maximum (1), */
385
+ 0x75 , 0x01 , /* Report Size (1), */
386
+ 0x95 , 0x08 , /* Report Count (8), */
387
+ 0x05 , 0x0C , /* Usage Page (Consumer), */
388
+ 0x0A , 0x6A , 0x02 , /* Usage (AC Delete), */
389
+ 0x0A , 0x1A , 0x02 , /* Usage (AC Undo), */
390
+ 0x0A , 0x01 , 0x02 , /* Usage (AC New), */
391
+ 0x0A , 0x2F , 0x02 , /* Usage (AC Zoom), */
392
+ 0x0A , 0x25 , 0x02 , /* Usage (AC Forward), */
393
+ 0x0A , 0x24 , 0x02 , /* Usage (AC Back), */
394
+ 0x0A , 0x2D , 0x02 , /* Usage (AC Zoom In), */
395
+ 0x0A , 0x2E , 0x02 , /* Usage (AC Zoom Out), */
396
+ 0x81 , 0x02 , /* Input (Variable), */
397
+ 0x95 , 0x30 , /* Report Count (48), */
398
+ 0x81 , 0x03 , /* Input (Constant, Variable), */
399
+ 0xC0 /* End Collection */
400
+ };
401
+
271
402
static __u8 * kye_consumer_control_fixup (struct hid_device * hdev , __u8 * rdesc ,
272
403
unsigned int * rsize , int offset , const char * device_name ) {
273
404
/*
@@ -335,6 +466,12 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
335
466
* rsize = sizeof (easypen_m610x_rdesc_fixed );
336
467
}
337
468
break ;
469
+ case USB_DEVICE_ID_KYE_PENSKETCH_M912 :
470
+ if (* rsize == PENSKETCH_M912_RDESC_ORIG_SIZE ) {
471
+ rdesc = pensketch_m912_rdesc_fixed ;
472
+ * rsize = sizeof (pensketch_m912_rdesc_fixed );
473
+ }
474
+ break ;
338
475
case USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE :
339
476
rdesc = kye_consumer_control_fixup (hdev , rdesc , rsize , 104 ,
340
477
"Genius Gila Gaming Mouse" );
@@ -418,6 +555,7 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
418
555
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X :
419
556
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2 :
420
557
case USB_DEVICE_ID_KYE_EASYPEN_M610X :
558
+ case USB_DEVICE_ID_KYE_PENSKETCH_M912 :
421
559
ret = kye_tablet_enable (hdev );
422
560
if (ret ) {
423
561
hid_err (hdev , "tablet enabling failed\n" );
@@ -457,6 +595,8 @@ static const struct hid_device_id kye_devices[] = {
457
595
USB_DEVICE_ID_GENIUS_GX_IMPERATOR ) },
458
596
{ HID_USB_DEVICE (USB_VENDOR_ID_KYE ,
459
597
USB_DEVICE_ID_GENIUS_MANTICORE ) },
598
+ { HID_USB_DEVICE (USB_VENDOR_ID_KYE ,
599
+ USB_DEVICE_ID_KYE_PENSKETCH_M912 ) },
460
600
{ }
461
601
};
462
602
MODULE_DEVICE_TABLE (hid , kye_devices );
0 commit comments