aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-waltop.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2010-09-25 15:16:58 -0400
committerJiri Kosina <jkosina@suse.cz>2010-10-01 09:34:05 -0400
commit00e7f9649b3061281fe4b463263da26155dc9be4 (patch)
treee1500275763532b18786f84331369f809b2f5c99 /drivers/hid/hid-waltop.c
parent67168fd7d4044f21c542128529216cfaad23c03e (diff)
HID: waltop: add support for Waltop Slim Tablet 12.1 inch
Add support for Waltop Slim Tablet 12.1 inch by fixing its report descriptor. This mainly fixes button reporting. This tablet is also sold as Genius G-Pen F610. Other possible names of this tablet: VisTablet Original 12", Adesso CyberTablet Z12, Adesso CT-Z12A, PenPower Tooya Pro, Aiptek Slim 12.1 Inch Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-waltop.c')
-rw-r--r--drivers/hid/hid-waltop.c208
1 files changed, 208 insertions, 0 deletions
diff --git a/drivers/hid/hid-waltop.c b/drivers/hid/hid-waltop.c
index 6ef9ed6a57d6..b3a4163f2e67 100644
--- a/drivers/hid/hid-waltop.c
+++ b/drivers/hid/hid-waltop.c
@@ -224,6 +224,206 @@ static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
224}; 224};
225 225
226/* 226/*
227 * Original Slim Tablet 12.1 inch report descriptor.
228 *
229 * The descriptor is similar to the Slim Tablet 5.8 inch descriptor with the
230 * addition of a keyboard report, seemingly unused. It may have get here
231 * from a Media Tablet - probably an unimplemented feature.
232 *
233 * Usage Page (Desktop), ; Generic desktop controls (01h)
234 * Usage (Mouse), ; Mouse (02h, application collection)
235 * Collection (Application),
236 * Report ID (1),
237 * Usage (Pointer), ; Pointer (01h, physical collection)
238 * Collection (Physical),
239 * Usage Page (Button), ; Button (09h)
240 * Usage Minimum (01h),
241 * Usage Maximum (05h),
242 * Logical Minimum (0),
243 * Logical Maximum (1),
244 * Report Size (1),
245 * Report Count (5),
246 * Input (Variable),
247 * Report Size (3),
248 * Report Count (1),
249 * Input (Constant, Variable),
250 * Usage Page (Desktop), ; Generic desktop controls (01h)
251 * Usage (X), ; X (30h, dynamic value)
252 * Usage (Y), ; Y (31h, dynamic value)
253 * Usage (Wheel), ; Wheel (38h, dynamic value)
254 * Logical Minimum (-127),
255 * Logical Maximum (127),
256 * Report Size (8),
257 * Report Count (3),
258 * Input (Variable, Relative),
259 * End Collection,
260 * End Collection,
261 * Usage Page (Digitizer), ; Digitizer (0Dh)
262 * Usage (Pen), ; Pen (02h, application collection)
263 * Collection (Application),
264 * Report ID (2),
265 * Usage (Stylus), ; Stylus (20h, logical collection)
266 * Collection (Physical),
267 * Usage (00h),
268 * Logical Minimum (0),
269 * Logical Maximum (255),
270 * Report Size (8),
271 * Report Count (7),
272 * Input (Variable),
273 * Usage (Azimuth), ; Azimuth (3Fh, dynamic value)
274 * Usage (Altitude), ; Altitude (40h, dynamic value)
275 * Logical Minimum (0),
276 * Logical Maximum (255),
277 * Report Size (8),
278 * Report Count (2),
279 * Feature (Variable),
280 * End Collection,
281 * Report ID (5),
282 * Usage Page (Digitizer), ; Digitizer (0Dh)
283 * Usage (Stylus), ; Stylus (20h, logical collection)
284 * Collection (Physical),
285 * Usage (00h),
286 * Logical Minimum (0),
287 * Logical Maximum (255),
288 * Report Size (8),
289 * Report Count (7),
290 * Input (Variable),
291 * End Collection,
292 * Report ID (10),
293 * Usage Page (Digitizer), ; Digitizer (0Dh)
294 * Usage (Stylus), ; Stylus (20h, logical collection)
295 * Collection (Physical),
296 * Usage (00h),
297 * Logical Minimum (0),
298 * Logical Maximum (255),
299 * Report Size (8),
300 * Report Count (3),
301 * Input (Variable),
302 * End Collection,
303 * Report ID (16),
304 * Usage (Stylus), ; Stylus (20h, logical collection)
305 * Collection (Physical),
306 * Usage (Tip Switch), ; Tip switch (42h, momentary control)
307 * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
308 * Usage (Invert), ; Invert (3Ch, momentary control)
309 * Usage (Eraser), ; Eraser (45h, momentary control)
310 * Usage (In Range), ; In range (32h, momentary control)
311 * Logical Minimum (0),
312 * Logical Maximum (1),
313 * Report Size (1),
314 * Report Count (5),
315 * Input (Variable),
316 * Report Count (3),
317 * Input (Constant, Variable),
318 * Usage Page (Desktop), ; Generic desktop controls (01h)
319 * Usage (X), ; X (30h, dynamic value)
320 * Report Size (16),
321 * Report Count (1),
322 * Push,
323 * Unit Exponent (13),
324 * Unit (Inch^3),
325 * Logical Minimum (0),
326 * Logical Maximum (20000),
327 * Physical Minimum (0),
328 * Physical Maximum (20000),
329 * Input (Variable),
330 * Usage (Y), ; Y (31h, dynamic value)
331 * Logical Maximum (12500),
332 * Physical Maximum (12500),
333 * Input (Variable),
334 * Usage Page (Digitizer), ; Digitizer (0Dh)
335 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
336 * Logical Minimum (0),
337 * Logical Maximum (1023),
338 * Physical Minimum (0),
339 * Physical Maximum (1023),
340 * Input (Variable),
341 * End Collection,
342 * End Collection,
343 * Usage Page (Desktop), ; Generic desktop controls (01h)
344 * Usage (Keyboard), ; Keyboard (06h, application collection)
345 * Collection (Application),
346 * Report ID (13),
347 * Usage Page (Keyboard), ; Keyboard/keypad (07h)
348 * Usage Minimum (KB Leftcontrol), ; Keyboard left control
349 * ; (E0h, dynamic value)
350 * Usage Maximum (KB Right GUI), ; Keyboard right GUI (E7h, dynamic value)
351 * Logical Minimum (0),
352 * Logical Maximum (1),
353 * Report Size (1),
354 * Report Count (8),
355 * Input (Variable),
356 * Report Size (8),
357 * Report Count (1),
358 * Input (Constant),
359 * Usage Page (Keyboard), ; Keyboard/keypad (07h)
360 * Usage Minimum (None), ; No event (00h, selector)
361 * Usage Maximum (KB Application), ; Keyboard Application (65h, selector)
362 * Logical Minimum (0),
363 * Logical Maximum (101),
364 * Report Size (8),
365 * Report Count (5),
366 * Input,
367 * End Collection
368 */
369
370/* Size of the original report descriptor of Slim Tablet 12.1 inch */
371#define SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE 269
372
373/*
374 * Fixed Slim Tablet 12.1 inch descriptor.
375 *
376 * All the reports except the stylus report (ID 16) were removed as unused.
377 * The stylus buttons description was fixed.
378 */
379static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = {
380 0x05, 0x0D, /* Usage Page (Digitizer), */
381 0x09, 0x02, /* Usage (Pen), */
382 0xA1, 0x01, /* Collection (Application), */
383 0x85, 0x10, /* Report ID (16), */
384 0x09, 0x20, /* Usage (Stylus), */
385 0xA0, /* Collection (Physical), */
386 0x09, 0x42, /* Usage (Tip Switch), */
387 0x09, 0x44, /* Usage (Barrel Switch), */
388 0x09, 0x46, /* Usage (Tablet Pick), */
389 0x15, 0x01, /* Logical Minimum (1), */
390 0x25, 0x03, /* Logical Maximum (3), */
391 0x75, 0x04, /* Report Size (4), */
392 0x95, 0x01, /* Report Count (1), */
393 0x80, /* Input, */
394 0x09, 0x32, /* Usage (In Range), */
395 0x14, /* Logical Minimum (0), */
396 0x25, 0x01, /* Logical Maximum (1), */
397 0x75, 0x01, /* Report Size (1), */
398 0x95, 0x01, /* Report Count (1), */
399 0x81, 0x02, /* Input (Variable), */
400 0x95, 0x03, /* Report Count (3), */
401 0x81, 0x03, /* Input (Constant, Variable), */
402 0x75, 0x10, /* Report Size (16), */
403 0x95, 0x01, /* Report Count (1), */
404 0x14, /* Logical Minimum (0), */
405 0xA4, /* Push, */
406 0x05, 0x01, /* Usage Page (Desktop), */
407 0x65, 0x13, /* Unit (Inch), */
408 0x55, 0xFD, /* Unit Exponent (-3), */
409 0x34, /* Physical Minimum (0), */
410 0x09, 0x30, /* Usage (X), */
411 0x46, 0x10, 0x27, /* Physical Maximum (10000), */
412 0x26, 0x20, 0x4E, /* Logical Maximum (20000), */
413 0x81, 0x02, /* Input (Variable), */
414 0x09, 0x31, /* Usage (Y), */
415 0x46, 0x6A, 0x18, /* Physical Maximum (6250), */
416 0x26, 0xD4, 0x30, /* Logical Maximum (12500), */
417 0x81, 0x02, /* Input (Variable), */
418 0xB4, /* Pop, */
419 0x09, 0x30, /* Usage (Tip Pressure), */
420 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
421 0x81, 0x02, /* Input (Variable), */
422 0xC0, /* End Collection, */
423 0xC0 /* End Collection */
424};
425
426/*
227 * Original Media Tablet 10.6 inch report descriptor. 427 * Original Media Tablet 10.6 inch report descriptor.
228 * 428 *
229 * There are at least two versions of this model in the wild. They are 429 * There are at least two versions of this model in the wild. They are
@@ -843,6 +1043,12 @@ static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
843 *rsize = sizeof(slim_tablet_5_8_inch_rdesc_fixed); 1043 *rsize = sizeof(slim_tablet_5_8_inch_rdesc_fixed);
844 } 1044 }
845 break; 1045 break;
1046 case USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH:
1047 if (*rsize == SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE) {
1048 rdesc = slim_tablet_12_1_inch_rdesc_fixed;
1049 *rsize = sizeof(slim_tablet_12_1_inch_rdesc_fixed);
1050 }
1051 break;
846 case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH: 1052 case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH:
847 if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) { 1053 if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) {
848 rdesc = media_tablet_10_6_inch_rdesc_fixed; 1054 rdesc = media_tablet_10_6_inch_rdesc_fixed;
@@ -863,6 +1069,8 @@ static const struct hid_device_id waltop_devices[] = {
863 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 1069 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
864 USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, 1070 USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
865 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 1071 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
1072 USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },
1073 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
866 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, 1074 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
867 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 1075 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
868 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) }, 1076 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },