hid-waltop.c 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. /*
  2. * HID driver for Waltop devices not fully compliant with HID standard
  3. *
  4. * Copyright (c) 2010 Nikolai Kondrashov
  5. */
  6. /*
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. */
  12. #include <linux/device.h>
  13. #include <linux/hid.h>
  14. #include <linux/module.h>
  15. #include "hid-ids.h"
  16. /*
  17. * Original Slim Tablet 5.8 inch report descriptor.
  18. *
  19. * All the reports except the report with ID 16 (the stylus) are unused,
  20. * possibly because the tablet is not configured to, or because they were
  21. * just copied from a more capable model. The purpose of features described
  22. * for report ID 2 is unknown.
  23. *
  24. * The stylus buttons are described as three bit fields, whereas actually
  25. * it's an "array", i.e. they're reported as button numbers (1, 2 and 3).
  26. * The "eraser" field is not used. There is also a "push" without a "pop" in
  27. * the stylus description.
  28. *
  29. * Usage Page (Desktop), ; Generic desktop controls (01h)
  30. * Usage (Mouse), ; Mouse (02h, application collection)
  31. * Collection (Application),
  32. * Report ID (1),
  33. * Usage (Pointer), ; Pointer (01h, physical collection)
  34. * Collection (Physical),
  35. * Usage Page (Button), ; Button (09h)
  36. * Usage Minimum (01h),
  37. * Usage Maximum (05h),
  38. * Logical Minimum (0),
  39. * Logical Maximum (1),
  40. * Report Size (1),
  41. * Report Count (5),
  42. * Input (Variable),
  43. * Report Size (3),
  44. * Report Count (1),
  45. * Input (Constant, Variable),
  46. * Usage Page (Desktop), ; Generic desktop controls (01h)
  47. * Usage (X), ; X (30h, dynamic value)
  48. * Usage (Y), ; Y (31h, dynamic value)
  49. * Usage (Wheel), ; Wheel (38h, dynamic value)
  50. * Logical Minimum (-127),
  51. * Logical Maximum (127),
  52. * Report Size (8),
  53. * Report Count (3),
  54. * Input (Variable, Relative),
  55. * End Collection,
  56. * End Collection,
  57. * Usage Page (Digitizer), ; Digitizer (0Dh)
  58. * Usage (Pen), ; Pen (02h, application collection)
  59. * Collection (Application),
  60. * Report ID (2),
  61. * Usage (Stylus), ; Stylus (20h, logical collection)
  62. * Collection (Physical),
  63. * Usage (00h),
  64. * Logical Minimum (0),
  65. * Logical Maximum (255),
  66. * Report Size (8),
  67. * Report Count (7),
  68. * Input (Variable),
  69. * Usage (Azimuth), ; Azimuth (3Fh, dynamic value)
  70. * Usage (Altitude), ; Altitude (40h, dynamic value)
  71. * Logical Minimum (0),
  72. * Logical Maximum (255),
  73. * Report Size (8),
  74. * Report Count (2),
  75. * Feature (Variable),
  76. * End Collection,
  77. * Report ID (5),
  78. * Usage Page (Digitizer), ; Digitizer (0Dh)
  79. * Usage (Stylus), ; Stylus (20h, logical collection)
  80. * Collection (Physical),
  81. * Usage (00h),
  82. * Logical Minimum (0),
  83. * Logical Maximum (255),
  84. * Report Size (8),
  85. * Report Count (7),
  86. * Input (Variable),
  87. * End Collection,
  88. * Report ID (10),
  89. * Usage Page (Digitizer), ; Digitizer (0Dh)
  90. * Usage (Stylus), ; Stylus (20h, logical collection)
  91. * Collection (Physical),
  92. * Usage (00h),
  93. * Logical Minimum (0),
  94. * Logical Maximum (255),
  95. * Report Size (8),
  96. * Report Count (3),
  97. * Input (Variable),
  98. * End Collection,
  99. * Report ID (16),
  100. * Usage (Stylus), ; Stylus (20h, logical collection)
  101. * Collection (Physical),
  102. * Usage (Tip Switch), ; Tip switch (42h, momentary control)
  103. * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
  104. * Usage (Invert), ; Invert (3Ch, momentary control)
  105. * Usage (Eraser), ; Eraser (45h, momentary control)
  106. * Usage (In Range), ; In range (32h, momentary control)
  107. * Logical Minimum (0),
  108. * Logical Maximum (1),
  109. * Report Size (1),
  110. * Report Count (5),
  111. * Input (Variable),
  112. * Report Count (3),
  113. * Input (Constant, Variable),
  114. * Usage Page (Desktop), ; Generic desktop controls (01h)
  115. * Usage (X), ; X (30h, dynamic value)
  116. * Report Size (16),
  117. * Report Count (1),
  118. * Push,
  119. * Unit Exponent (13),
  120. * Unit (Inch^3),
  121. * Logical Minimum (0),
  122. * Logical Maximum (10000),
  123. * Physical Minimum (0),
  124. * Physical Maximum (10000),
  125. * Input (Variable),
  126. * Usage (Y), ; Y (31h, dynamic value)
  127. * Logical Maximum (6000),
  128. * Physical Maximum (6000),
  129. * Input (Variable),
  130. * Usage Page (Digitizer), ; Digitizer (0Dh)
  131. * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
  132. * Logical Minimum (0),
  133. * Logical Maximum (1023),
  134. * Physical Minimum (0),
  135. * Physical Maximum (1023),
  136. * Input (Variable),
  137. * End Collection,
  138. * End Collection
  139. */
  140. /* Size of the original report descriptor of Slim Tablet 5.8 inch */
  141. #define SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE 222
  142. /*
  143. * Fixed Slim Tablet 5.8 inch descriptor.
  144. *
  145. * All the reports except the stylus report (ID 16) were removed as unused.
  146. * The stylus buttons description was fixed.
  147. */
  148. static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
  149. 0x05, 0x0D, /* Usage Page (Digitizer), */
  150. 0x09, 0x02, /* Usage (Pen), */
  151. 0xA1, 0x01, /* Collection (Application), */
  152. 0x85, 0x10, /* Report ID (16), */
  153. 0x09, 0x20, /* Usage (Stylus), */
  154. 0xA0, /* Collection (Physical), */
  155. 0x09, 0x42, /* Usage (Tip Switch), */
  156. 0x09, 0x44, /* Usage (Barrel Switch), */
  157. 0x09, 0x46, /* Usage (Tablet Pick), */
  158. 0x15, 0x01, /* Logical Minimum (1), */
  159. 0x25, 0x03, /* Logical Maximum (3), */
  160. 0x75, 0x04, /* Report Size (4), */
  161. 0x95, 0x01, /* Report Count (1), */
  162. 0x80, /* Input, */
  163. 0x09, 0x32, /* Usage (In Range), */
  164. 0x14, /* Logical Minimum (0), */
  165. 0x25, 0x01, /* Logical Maximum (1), */
  166. 0x75, 0x01, /* Report Size (1), */
  167. 0x95, 0x01, /* Report Count (1), */
  168. 0x81, 0x02, /* Input (Variable), */
  169. 0x95, 0x03, /* Report Count (3), */
  170. 0x81, 0x03, /* Input (Constant, Variable), */
  171. 0x75, 0x10, /* Report Size (16), */
  172. 0x95, 0x01, /* Report Count (1), */
  173. 0x14, /* Logical Minimum (0), */
  174. 0xA4, /* Push, */
  175. 0x05, 0x01, /* Usage Page (Desktop), */
  176. 0x65, 0x13, /* Unit (Inch), */
  177. 0x55, 0xFD, /* Unit Exponent (-3), */
  178. 0x34, /* Physical Minimum (0), */
  179. 0x09, 0x30, /* Usage (X), */
  180. 0x46, 0x88, 0x13, /* Physical Maximum (5000), */
  181. 0x26, 0x10, 0x27, /* Logical Maximum (10000), */
  182. 0x81, 0x02, /* Input (Variable), */
  183. 0x09, 0x31, /* Usage (Y), */
  184. 0x46, 0xB8, 0x0B, /* Physical Maximum (3000), */
  185. 0x26, 0x70, 0x17, /* Logical Maximum (6000), */
  186. 0x81, 0x02, /* Input (Variable), */
  187. 0xB4, /* Pop, */
  188. 0x09, 0x30, /* Usage (Tip Pressure), */
  189. 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
  190. 0x81, 0x02, /* Input (Variable), */
  191. 0xC0, /* End Collection, */
  192. 0xC0 /* End Collection */
  193. };
  194. /*
  195. * Original Media Tablet 10.6 inch report descriptor.
  196. *
  197. * There are at least two versions of this model in the wild. They are
  198. * represented by Genius G-Pen M609 (older version) and Genius G-Pen M609X
  199. * (newer version).
  200. *
  201. * Both versions have the usual pen with two barrel buttons and two
  202. * identical wheels with center buttons in the top corners of the tablet
  203. * base. They also have buttons on the top, between the wheels, for
  204. * selecting the wheels' functions and wide/standard mode. In the wide mode
  205. * the whole working surface is sensed, in the standard mode a narrower area
  206. * is sensed, but the logical report extents remain the same. These modes
  207. * correspond roughly to 16:9 and 4:3 aspect ratios respectively.
  208. *
  209. * The older version has three wheel function buttons ("scroll", "zoom" and
  210. * "volume") and two separate buttons for wide and standard mode. The newer
  211. * version has four wheel function buttons (plus "brush") and only one
  212. * button is used for selecting wide/standard mode. So, the total number of
  213. * buttons remains the same, but one of the mode buttons is repurposed as a
  214. * wheels' function button in the newer version.
  215. *
  216. * The wheel functions are:
  217. * scroll - the wheels act as scroll wheels, the center buttons switch
  218. * between vertical and horizontal scrolling;
  219. * zoom - the wheels zoom in/out, the buttons supposedly reset to 100%;
  220. * volume - the wheels control the sound volume, the buttons mute;
  221. * brush - the wheels are supposed to control brush width in a graphics
  222. * editor, the buttons do nothing.
  223. *
  224. * Below is the newer version's report descriptor. It may very well be that
  225. * the older version's descriptor is different and thus it won't be
  226. * supported.
  227. *
  228. * The mouse report (ID 1) only uses the wheel field for reporting the tablet
  229. * wheels' scroll mode. The keyboard report (ID 13) is used to report the
  230. * wheels' zoom and brush control functions as key presses. The report ID 12
  231. * is used to report the wheels' volume control functions. The stylus report
  232. * (ID 16) has the same problems as the Slim Tablet 5.8 inch report has.
  233. *
  234. * The rest of the reports are unused, at least in the default configuration.
  235. * The purpose of the features is unknown.
  236. *
  237. * Usage Page (Desktop),
  238. * Usage (Mouse),
  239. * Collection (Application),
  240. * Report ID (1),
  241. * Usage (Pointer),
  242. * Collection (Physical),
  243. * Usage Page (Button),
  244. * Usage Minimum (01h),
  245. * Usage Maximum (05h),
  246. * Logical Minimum (0),
  247. * Logical Maximum (1),
  248. * Report Size (1),
  249. * Report Count (5),
  250. * Input (Variable),
  251. * Report Size (3),
  252. * Report Count (1),
  253. * Input (Constant, Variable),
  254. * Usage Page (Desktop),
  255. * Usage (X),
  256. * Usage (Y),
  257. * Usage (Wheel),
  258. * Logical Minimum (-127),
  259. * Logical Maximum (127),
  260. * Report Size (8),
  261. * Report Count (3),
  262. * Input (Variable, Relative),
  263. * End Collection,
  264. * End Collection,
  265. * Usage Page (Digitizer),
  266. * Usage (Pen),
  267. * Collection (Application),
  268. * Report ID (2),
  269. * Usage (Stylus),
  270. * Collection (Physical),
  271. * Usage (00h),
  272. * Logical Minimum (0),
  273. * Logical Maximum (255),
  274. * Report Size (8),
  275. * Report Count (7),
  276. * Input (Variable),
  277. * Usage (Azimuth),
  278. * Usage (Altitude),
  279. * Logical Minimum (0),
  280. * Logical Maximum (255),
  281. * Report Size (8),
  282. * Report Count (2),
  283. * Feature (Variable),
  284. * End Collection,
  285. * Report ID (5),
  286. * Usage Page (Digitizer),
  287. * Usage (Stylus),
  288. * Collection (Physical),
  289. * Usage (00h),
  290. * Logical Minimum (0),
  291. * Logical Maximum (255),
  292. * Report Size (8),
  293. * Report Count (7),
  294. * Input (Variable),
  295. * End Collection,
  296. * Report ID (10),
  297. * Usage Page (Digitizer),
  298. * Usage (Stylus),
  299. * Collection (Physical),
  300. * Usage (00h),
  301. * Logical Minimum (0),
  302. * Logical Maximum (255),
  303. * Report Size (8),
  304. * Report Count (7),
  305. * Input (Variable),
  306. * End Collection,
  307. * Report ID (16),
  308. * Usage (Stylus),
  309. * Collection (Physical),
  310. * Usage (Tip Switch),
  311. * Usage (Barrel Switch),
  312. * Usage (Invert),
  313. * Usage (Eraser),
  314. * Usage (In Range),
  315. * Logical Minimum (0),
  316. * Logical Maximum (1),
  317. * Report Size (1),
  318. * Report Count (5),
  319. * Input (Variable),
  320. * Report Count (3),
  321. * Input (Constant, Variable),
  322. * Usage Page (Desktop),
  323. * Usage (X),
  324. * Report Size (16),
  325. * Report Count (1),
  326. * Push,
  327. * Unit Exponent (13),
  328. * Unit (Inch^3),
  329. * Logical Minimum (0),
  330. * Logical Maximum (18000),
  331. * Physical Minimum (0),
  332. * Physical Maximum (18000),
  333. * Input (Variable),
  334. * Usage (Y),
  335. * Logical Maximum (11000),
  336. * Physical Maximum (11000),
  337. * Input (Variable),
  338. * Usage Page (Digitizer),
  339. * Usage (Tip Pressure),
  340. * Logical Minimum (0),
  341. * Logical Maximum (1023),
  342. * Physical Minimum (0),
  343. * Physical Maximum (1023),
  344. * Input (Variable),
  345. * End Collection,
  346. * End Collection,
  347. * Usage Page (Desktop),
  348. * Usage (Keyboard),
  349. * Collection (Application),
  350. * Report ID (13),
  351. * Usage Page (Keyboard),
  352. * Usage Minimum (KB Leftcontrol),
  353. * Usage Maximum (KB Right GUI),
  354. * Logical Minimum (0),
  355. * Logical Maximum (1),
  356. * Report Size (1),
  357. * Report Count (8),
  358. * Input (Variable),
  359. * Report Size (8),
  360. * Report Count (1),
  361. * Input (Constant),
  362. * Usage Page (Keyboard),
  363. * Usage Minimum (None),
  364. * Usage Maximum (KB Application),
  365. * Logical Minimum (0),
  366. * Logical Maximum (101),
  367. * Report Size (8),
  368. * Report Count (5),
  369. * Input,
  370. * End Collection,
  371. * Usage Page (Consumer),
  372. * Usage (Consumer Control),
  373. * Collection (Application),
  374. * Report ID (12),
  375. * Usage (Volume Inc),
  376. * Usage (Volume Dec),
  377. * Usage (Mute),
  378. * Logical Minimum (0),
  379. * Logical Maximum (1),
  380. * Report Size (1),
  381. * Report Count (3),
  382. * Input (Variable, Relative),
  383. * Report Size (5),
  384. * Report Count (1),
  385. * Input (Constant, Variable, Relative),
  386. * End Collection
  387. */
  388. /* Size of the original report descriptor of Media Tablet 10.6 inch */
  389. #define MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE 300
  390. /*
  391. * Fixed Media Tablet 10.6 inch descriptor.
  392. *
  393. * The descriptions of reports unused in the default configuration are
  394. * removed. The stylus report (ID 16) is fixed similarly to Slim Tablet 5.8
  395. * inch. The unused mouse report (ID 1) fields are replaced with constant
  396. * padding.
  397. *
  398. * The keyboard report (ID 13) is hacked to instead have an "array" field
  399. * reporting consumer page controls, and all the unused bits are masked out
  400. * with constant padding. The "brush" wheels' function is represented as "Scan
  401. * Previous/Next Track" controls due to the lack of brush controls in the
  402. * usage tables specification.
  403. */
  404. static __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
  405. 0x05, 0x0D, /* Usage Page (Digitizer), */
  406. 0x09, 0x02, /* Usage (Pen), */
  407. 0xA1, 0x01, /* Collection (Application), */
  408. 0x85, 0x10, /* Report ID (16), */
  409. 0x09, 0x20, /* Usage (Stylus), */
  410. 0xA0, /* Collection (Physical), */
  411. 0x09, 0x42, /* Usage (Tip Switch), */
  412. 0x09, 0x44, /* Usage (Barrel Switch), */
  413. 0x09, 0x46, /* Usage (Tablet Pick), */
  414. 0x15, 0x01, /* Logical Minimum (1), */
  415. 0x25, 0x03, /* Logical Maximum (3), */
  416. 0x75, 0x04, /* Report Size (4), */
  417. 0x95, 0x01, /* Report Count (1), */
  418. 0x80, /* Input, */
  419. 0x75, 0x01, /* Report Size (1), */
  420. 0x09, 0x32, /* Usage (In Range), */
  421. 0x14, /* Logical Minimum (0), */
  422. 0x25, 0x01, /* Logical Maximum (1), */
  423. 0x95, 0x01, /* Report Count (1), */
  424. 0x81, 0x02, /* Input (Variable), */
  425. 0x95, 0x03, /* Report Count (3), */
  426. 0x81, 0x03, /* Input (Constant, Variable), */
  427. 0x75, 0x10, /* Report Size (16), */
  428. 0x95, 0x01, /* Report Count (1), */
  429. 0x14, /* Logical Minimum (0), */
  430. 0xA4, /* Push, */
  431. 0x05, 0x01, /* Usage Page (Desktop), */
  432. 0x65, 0x13, /* Unit (Inch), */
  433. 0x55, 0xFD, /* Unit Exponent (-3), */
  434. 0x34, /* Physical Minimum (0), */
  435. 0x09, 0x30, /* Usage (X), */
  436. 0x46, 0x28, 0x23, /* Physical Maximum (9000), */
  437. 0x26, 0x50, 0x46, /* Logical Maximum (18000), */
  438. 0x81, 0x02, /* Input (Variable), */
  439. 0x09, 0x31, /* Usage (Y), */
  440. 0x46, 0x7C, 0x15, /* Physical Maximum (5500), */
  441. 0x26, 0xF8, 0x2A, /* Logical Maximum (11000), */
  442. 0x81, 0x02, /* Input (Variable), */
  443. 0xB4, /* Pop, */
  444. 0x09, 0x30, /* Usage (Tip Pressure), */
  445. 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
  446. 0x81, 0x02, /* Input (Variable), */
  447. 0xC0, /* End Collection, */
  448. 0xC0, /* End Collection, */
  449. 0x05, 0x01, /* Usage Page (Desktop), */
  450. 0x09, 0x02, /* Usage (Mouse), */
  451. 0xA1, 0x01, /* Collection (Application), */
  452. 0x85, 0x01, /* Report ID (1), */
  453. 0x09, 0x01, /* Usage (Pointer), */
  454. 0xA0, /* Collection (Physical), */
  455. 0x75, 0x08, /* Report Size (8), */
  456. 0x95, 0x03, /* Report Count (3), */
  457. 0x81, 0x03, /* Input (Constant, Variable), */
  458. 0x95, 0x02, /* Report Count (2), */
  459. 0x15, 0xFF, /* Logical Minimum (-1), */
  460. 0x25, 0x01, /* Logical Maximum (1), */
  461. 0x09, 0x38, /* Usage (Wheel), */
  462. 0x0B, 0x38, 0x02, /* Usage (Consumer AC Pan), */
  463. 0x0C, 0x00,
  464. 0x81, 0x06, /* Input (Variable, Relative), */
  465. 0x95, 0x02, /* Report Count (2), */
  466. 0x81, 0x03, /* Input (Constant, Variable), */
  467. 0xC0, /* End Collection, */
  468. 0xC0, /* End Collection, */
  469. 0x05, 0x0C, /* Usage Page (Consumer), */
  470. 0x09, 0x01, /* Usage (Consumer Control), */
  471. 0xA1, 0x01, /* Collection (Application), */
  472. 0x85, 0x0D, /* Report ID (13), */
  473. 0x95, 0x01, /* Report Count (1), */
  474. 0x75, 0x10, /* Report Size (16), */
  475. 0x81, 0x03, /* Input (Constant, Variable), */
  476. 0x0A, 0x2F, 0x02, /* Usage (AC Zoom), */
  477. 0x0A, 0x2E, 0x02, /* Usage (AC Zoom Out), */
  478. 0x0A, 0x2D, 0x02, /* Usage (AC Zoom In), */
  479. 0x09, 0xB6, /* Usage (Scan Previous Track), */
  480. 0x09, 0xB5, /* Usage (Scan Next Track), */
  481. 0x15, 0x2C, /* Logical Minimum (44), */
  482. 0x25, 0x30, /* Logical Maximum (48), */
  483. 0x75, 0x08, /* Report Size (8), */
  484. 0x80, /* Input, */
  485. 0x75, 0x20, /* Report Size (32), */
  486. 0x81, 0x03, /* Input (Constant, Variable), */
  487. 0xC0, /* End Collection, */
  488. 0x09, 0x01, /* Usage (Consumer Control), */
  489. 0xA1, 0x01, /* Collection (Application), */
  490. 0x85, 0x0C, /* Report ID (12), */
  491. 0x75, 0x01, /* Report Size (1), */
  492. 0x09, 0xE9, /* Usage (Volume Inc), */
  493. 0x09, 0xEA, /* Usage (Volume Dec), */
  494. 0x09, 0xE2, /* Usage (Mute), */
  495. 0x14, /* Logical Minimum (0), */
  496. 0x25, 0x01, /* Logical Maximum (1), */
  497. 0x95, 0x03, /* Report Count (3), */
  498. 0x81, 0x06, /* Input (Variable, Relative), */
  499. 0x95, 0x35, /* Report Count (53), */
  500. 0x81, 0x03, /* Input (Constant, Variable), */
  501. 0xC0 /* End Collection */
  502. };
  503. static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  504. unsigned int *rsize)
  505. {
  506. switch (hdev->product) {
  507. case USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH:
  508. if (*rsize == SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE) {
  509. rdesc = slim_tablet_5_8_inch_rdesc_fixed;
  510. *rsize = sizeof(slim_tablet_5_8_inch_rdesc_fixed);
  511. }
  512. break;
  513. case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH:
  514. if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) {
  515. rdesc = media_tablet_10_6_inch_rdesc_fixed;
  516. *rsize = sizeof(media_tablet_10_6_inch_rdesc_fixed);
  517. }
  518. break;
  519. }
  520. return rdesc;
  521. }
  522. static const struct hid_device_id waltop_devices[] = {
  523. { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
  524. USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
  525. { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
  526. USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
  527. { }
  528. };
  529. MODULE_DEVICE_TABLE(hid, waltop_devices);
  530. static struct hid_driver waltop_driver = {
  531. .name = "waltop",
  532. .id_table = waltop_devices,
  533. .report_fixup = waltop_report_fixup,
  534. };
  535. static int __init waltop_init(void)
  536. {
  537. return hid_register_driver(&waltop_driver);
  538. }
  539. static void __exit waltop_exit(void)
  540. {
  541. hid_unregister_driver(&waltop_driver);
  542. }
  543. module_init(waltop_init);
  544. module_exit(waltop_exit);
  545. MODULE_LICENSE("GPL");