12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238 |
- // SPDX-License-Identifier: GPL-2.0+
- /*
- * HID driver for UC-Logic devices not fully compliant with HID standard
- * - original and fixed report descriptors
- *
- * Copyright (c) 2010-2017 Nikolai Kondrashov
- * Copyright (c) 2013 Martin Rusko
- */
- /*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- */
- #include "hid-uclogic-rdesc.h"
- #include <linux/slab.h>
- #include <asm/unaligned.h>
- /* Fixed WP4030U report descriptor */
- __u8 uclogic_rdesc_wp4030u_fixed_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x09, /* Report ID (9), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0x14, /* Logical Minimum (0), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x46, 0xA0, 0x0F, /* Physical Maximum (4000), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x46, 0xB8, 0x0B, /* Physical Maximum (3000), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_wp4030u_fixed_size =
- sizeof(uclogic_rdesc_wp4030u_fixed_arr);
- /* Fixed WP5540U report descriptor */
- __u8 uclogic_rdesc_wp5540u_fixed_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x09, /* Report ID (9), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0x14, /* Logical Minimum (0), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x46, 0x7C, 0x15, /* Physical Maximum (5500), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x46, 0xA0, 0x0F, /* Physical Maximum (4000), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0, /* End Collection, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x02, /* Usage (Mouse), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x08, /* Report ID (8), */
- 0x09, 0x01, /* Usage (Pointer), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x03, /* Usage Maximum (03h), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x75, 0x08, /* Report Size (8), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x15, 0x81, /* Logical Minimum (-127), */
- 0x25, 0x7F, /* Logical Maximum (127), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x15, 0xFF, /* Logical Minimum (-1), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_wp5540u_fixed_size =
- sizeof(uclogic_rdesc_wp5540u_fixed_arr);
- /* Fixed WP8060U report descriptor */
- __u8 uclogic_rdesc_wp8060u_fixed_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x09, /* Report ID (9), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0x14, /* Logical Minimum (0), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x46, 0x40, 0x1F, /* Physical Maximum (8000), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x46, 0x70, 0x17, /* Physical Maximum (6000), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0, /* End Collection, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x02, /* Usage (Mouse), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x08, /* Report ID (8), */
- 0x09, 0x01, /* Usage (Pointer), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x03, /* Usage Maximum (03h), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x75, 0x08, /* Report Size (8), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x15, 0x81, /* Logical Minimum (-127), */
- 0x25, 0x7F, /* Logical Maximum (127), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x15, 0xFF, /* Logical Minimum (-1), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_wp8060u_fixed_size =
- sizeof(uclogic_rdesc_wp8060u_fixed_arr);
- /* Fixed WP1062 report descriptor */
- __u8 uclogic_rdesc_wp1062_fixed_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x09, /* Report ID (9), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x04, /* Report Count (4), */
- 0x81, 0x01, /* Input (Constant), */
- 0x09, 0x32, /* Usage (In Range), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0x14, /* Logical Minimum (0), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x46, 0x10, 0x27, /* Physical Maximum (10000), */
- 0x26, 0x20, 0x4E, /* Logical Maximum (20000), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x46, 0xB7, 0x19, /* Physical Maximum (6583), */
- 0x26, 0x6E, 0x33, /* Logical Maximum (13166), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_wp1062_fixed_size =
- sizeof(uclogic_rdesc_wp1062_fixed_arr);
- /* Fixed PF1209 report descriptor */
- __u8 uclogic_rdesc_pf1209_fixed_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x09, /* Report ID (9), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0x14, /* Logical Minimum (0), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x46, 0xE0, 0x2E, /* Physical Maximum (12000), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x46, 0x28, 0x23, /* Physical Maximum (9000), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0, /* End Collection, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x02, /* Usage (Mouse), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x08, /* Report ID (8), */
- 0x09, 0x01, /* Usage (Pointer), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x03, /* Usage Maximum (03h), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x75, 0x08, /* Report Size (8), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x15, 0x81, /* Logical Minimum (-127), */
- 0x25, 0x7F, /* Logical Maximum (127), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x15, 0xFF, /* Logical Minimum (-1), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_pf1209_fixed_size =
- sizeof(uclogic_rdesc_pf1209_fixed_arr);
- /* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */
- __u8 uclogic_rdesc_twhl850_fixed0_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x09, /* Report ID (9), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x81, 0x02, /* Input (Variable), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x95, 0x01, /* Report Count (1), */
- 0x09, 0x32, /* Usage (In Range), */
- 0x81, 0x02, /* Input (Variable), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x75, 0x10, /* Report Size (16), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x46, 0x40, 0x1F, /* Physical Maximum (8000), */
- 0x26, 0x00, 0x7D, /* Logical Maximum (32000), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x46, 0x88, 0x13, /* Physical Maximum (5000), */
- 0x26, 0x20, 0x4E, /* Logical Maximum (20000), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_twhl850_fixed0_size =
- sizeof(uclogic_rdesc_twhl850_fixed0_arr);
- /* Fixed PID 0522 tablet report descriptor, interface 1 (mouse) */
- __u8 uclogic_rdesc_twhl850_fixed1_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x02, /* Usage (Mouse), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x01, /* Report ID (1), */
- 0x09, 0x01, /* Usage (Pointer), */
- 0xA0, /* Collection (Physical), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x03, /* Usage Maximum (03h), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x16, 0x00, 0x80, /* Logical Minimum (-32768), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x15, 0xFF, /* Logical Minimum (-1), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x01, /* Report Count (1), */
- 0x75, 0x08, /* Report Size (8), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_twhl850_fixed1_size =
- sizeof(uclogic_rdesc_twhl850_fixed1_arr);
- /* Fixed PID 0522 tablet report descriptor, interface 2 (frame buttons) */
- __u8 uclogic_rdesc_twhl850_fixed2_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x06, /* Usage (Keyboard), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x03, /* Report ID (3), */
- 0x05, 0x07, /* Usage Page (Keyboard), */
- 0x14, /* Logical Minimum (0), */
- 0x19, 0xE0, /* Usage Minimum (KB Leftcontrol), */
- 0x29, 0xE7, /* Usage Maximum (KB Right GUI), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x08, /* Report Count (8), */
- 0x81, 0x02, /* Input (Variable), */
- 0x18, /* Usage Minimum (None), */
- 0x29, 0xFF, /* Usage Maximum (FFh), */
- 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x06, /* Report Count (6), */
- 0x80, /* Input, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_twhl850_fixed2_size =
- sizeof(uclogic_rdesc_twhl850_fixed2_arr);
- /* Fixed TWHA60 report descriptor, interface 0 (stylus) */
- __u8 uclogic_rdesc_twha60_fixed0_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x09, /* Report ID (9), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x04, /* Report Count (4), */
- 0x81, 0x01, /* Input (Constant), */
- 0x09, 0x32, /* Usage (In Range), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0x14, /* Logical Minimum (0), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x46, 0x10, 0x27, /* Physical Maximum (10000), */
- 0x27, 0x3F, 0x9C,
- 0x00, 0x00, /* Logical Maximum (39999), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x46, 0x6A, 0x18, /* Physical Maximum (6250), */
- 0x26, 0xA7, 0x61, /* Logical Maximum (24999), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_twha60_fixed0_size =
- sizeof(uclogic_rdesc_twha60_fixed0_arr);
- /* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */
- __u8 uclogic_rdesc_twha60_fixed1_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x06, /* Usage (Keyboard), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x05, /* Report ID (5), */
- 0x05, 0x07, /* Usage Page (Keyboard), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x08, /* Report Count (8), */
- 0x81, 0x01, /* Input (Constant), */
- 0x95, 0x0C, /* Report Count (12), */
- 0x19, 0x3A, /* Usage Minimum (KB F1), */
- 0x29, 0x45, /* Usage Maximum (KB F12), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x0C, /* Report Count (12), */
- 0x19, 0x68, /* Usage Minimum (KB F13), */
- 0x29, 0x73, /* Usage Maximum (KB F24), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x08, /* Report Count (8), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_twha60_fixed1_size =
- sizeof(uclogic_rdesc_twha60_fixed1_arr);
- /* Fixed report descriptor template for (tweaked) v1 pen reports */
- const __u8 uclogic_rdesc_v1_pen_template_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x07, /* Report ID (7), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x09, 0x32, /* Usage (In Range), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x27, UCLOGIC_RDESC_PEN_PH(X_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x47, UCLOGIC_RDESC_PEN_PH(X_PM),
- /* Physical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x27, UCLOGIC_RDESC_PEN_PH(Y_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x47, UCLOGIC_RDESC_PEN_PH(Y_PM),
- /* Physical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x27, UCLOGIC_RDESC_PEN_PH(PRESSURE_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_v1_pen_template_size =
- sizeof(uclogic_rdesc_v1_pen_template_arr);
- /* Fixed report descriptor template for (tweaked) v2 pen reports */
- const __u8 uclogic_rdesc_v2_pen_template_arr[] = {
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x08, /* Report ID (8), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xA0, /* Collection (Physical), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x09, 0x32, /* Usage (In Range), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x95, 0x01, /* Report Count (1), */
- 0xA4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x55, 0xFD, /* Unit Exponent (-3), */
- 0x75, 0x18, /* Report Size (24), */
- 0x34, /* Physical Minimum (0), */
- 0x09, 0x30, /* Usage (X), */
- 0x27, UCLOGIC_RDESC_PEN_PH(X_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x47, UCLOGIC_RDESC_PEN_PH(X_PM),
- /* Physical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x27, UCLOGIC_RDESC_PEN_PH(Y_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x47, UCLOGIC_RDESC_PEN_PH(Y_PM),
- /* Physical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0xB4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x75, 0x10, /* Report Size (16), */
- 0x27, UCLOGIC_RDESC_PEN_PH(PRESSURE_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0x54, /* Unit Exponent (0), */
- 0x65, 0x14, /* Unit (Degrees), */
- 0x35, 0xC4, /* Physical Minimum (-60), */
- 0x45, 0x3C, /* Physical Maximum (60), */
- 0x15, 0xC4, /* Logical Minimum (-60), */
- 0x25, 0x3C, /* Logical Maximum (60), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x02, /* Report Count (2), */
- 0x09, 0x3D, /* Usage (X Tilt), */
- 0x09, 0x3E, /* Usage (Y Tilt), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_v2_pen_template_size =
- sizeof(uclogic_rdesc_v2_pen_template_arr);
- /*
- * Expand to the contents of a generic frame buttons report descriptor.
- *
- * @_id: The report ID to use.
- * @_size: Size of the report to pad to, including report ID, bytes.
- */
- #define UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(_id, _size) \
- 0x05, 0x01, /* Usage Page (Desktop), */ \
- 0x09, 0x07, /* Usage (Keypad), */ \
- 0xA1, 0x01, /* Collection (Application), */ \
- 0x85, (_id), /* Report ID (_id), */ \
- 0x14, /* Logical Minimum (0), */ \
- 0x25, 0x01, /* Logical Maximum (1), */ \
- 0x75, 0x01, /* Report Size (1), */ \
- 0x05, 0x0D, /* Usage Page (Digitizer), */ \
- 0x09, 0x39, /* Usage (Tablet Function Keys), */ \
- 0xA0, /* Collection (Physical), */ \
- 0x09, 0x44, /* Usage (Barrel Switch), */ \
- 0x95, 0x01, /* Report Count (1), */ \
- 0x81, 0x02, /* Input (Variable), */ \
- 0x05, 0x01, /* Usage Page (Desktop), */ \
- 0x09, 0x30, /* Usage (X), */ \
- 0x09, 0x31, /* Usage (Y), */ \
- 0x95, 0x02, /* Report Count (2), */ \
- 0x81, 0x02, /* Input (Variable), */ \
- 0x95, 0x15, /* Report Count (21), */ \
- 0x81, 0x01, /* Input (Constant), */ \
- 0x05, 0x09, /* Usage Page (Button), */ \
- 0x19, 0x01, /* Usage Minimum (01h), */ \
- 0x29, 0x0A, /* Usage Maximum (0Ah), */ \
- 0x95, 0x0A, /* Report Count (10), */ \
- 0x81, 0x02, /* Input (Variable), */ \
- 0xC0, /* End Collection, */ \
- 0x05, 0x01, /* Usage Page (Desktop), */ \
- 0x09, 0x05, /* Usage (Gamepad), */ \
- 0xA0, /* Collection (Physical), */ \
- 0x05, 0x09, /* Usage Page (Button), */ \
- 0x19, 0x01, /* Usage Minimum (01h), */ \
- 0x29, 0x03, /* Usage Maximum (03h), */ \
- 0x95, 0x03, /* Report Count (3), */ \
- 0x81, 0x02, /* Input (Variable), */ \
- 0x95, ((_size) * 8 - 45), \
- /* Report Count (padding), */ \
- 0x81, 0x01, /* Input (Constant), */ \
- 0xC0, /* End Collection, */ \
- 0xC0 /* End Collection */
- /* Fixed report descriptor for (tweaked) v1 frame reports */
- const __u8 uclogic_rdesc_v1_frame_arr[] = {
- UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V1_FRAME_ID, 8)
- };
- const size_t uclogic_rdesc_v1_frame_size =
- sizeof(uclogic_rdesc_v1_frame_arr);
- /* Fixed report descriptor for (tweaked) v2 frame button reports */
- const __u8 uclogic_rdesc_v2_frame_buttons_arr[] = {
- UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID,
- 12)
- };
- const size_t uclogic_rdesc_v2_frame_buttons_size =
- sizeof(uclogic_rdesc_v2_frame_buttons_arr);
- /* Fixed report descriptor for (tweaked) v2 frame touch ring reports */
- const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, UCLOGIC_RDESC_V2_FRAME_TOUCH_ID,
- /* Report ID (TOUCH_ID), */
- 0x14, /* Logical Minimum (0), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x09, 0x01, /* Usage (01h), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x07, /* Report Count (7), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x0A, 0xFF, 0xFF, /* Usage (FFFFh), */
- 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x95, 0x01, /* Report Count (1), */
- 0x15, 0x00, /* Logical Minimum (0), */
- 0x25, 0x0B, /* Logical Maximum (11), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x2E, /* Report Count (46), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_v2_frame_touch_ring_size =
- sizeof(uclogic_rdesc_v2_frame_touch_ring_arr);
- /* Fixed report descriptor for (tweaked) v2 frame touch strip reports */
- const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, UCLOGIC_RDESC_V2_FRAME_TOUCH_ID,
- /* Report ID (TOUCH_ID), */
- 0x14, /* Logical Minimum (0), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x09, 0x01, /* Usage (01h), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x07, /* Report Count (7), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x0A, 0xFF, 0xFF, /* Usage (FFFFh), */
- 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x95, 0x01, /* Report Count (1), */
- 0x15, 0x00, /* Logical Minimum (0), */
- 0x25, 0x07, /* Logical Maximum (7), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x2E, /* Report Count (46), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_v2_frame_touch_strip_size =
- sizeof(uclogic_rdesc_v2_frame_touch_strip_arr);
- /* Fixed report descriptor for (tweaked) v2 frame dial reports */
- const __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, UCLOGIC_RDESC_V2_FRAME_DIAL_ID,
- /* Report ID (DIAL_ID), */
- 0x14, /* Logical Minimum (0), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x09, 0x01, /* Usage (01h), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x06, /* Report Count (6), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x0A, 0xFF, 0xFF, /* Usage (FFFFh), */
- 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x95, 0x01, /* Report Count (1), */
- 0x15, 0xFF, /* Logical Minimum (-1), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x2E, /* Report Count (46), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_v2_frame_dial_size =
- sizeof(uclogic_rdesc_v2_frame_dial_arr);
- /* Fixed report descriptor template for UGEE v2 pen reports */
- const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
- 0x05, 0x0d, /* Usage Page (Digitizers), */
- 0x09, 0x01, /* Usage (Digitizer), */
- 0xa1, 0x01, /* Collection (Application), */
- 0x85, 0x02, /* Report ID (2), */
- 0x09, 0x20, /* Usage (Stylus), */
- 0xa1, 0x00, /* Collection (Physical), */
- 0x09, 0x42, /* Usage (Tip Switch), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x09, 0x46, /* Usage (Tablet Pick), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x09, 0x32, /* Usage (In Range), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x01, /* Report Count (1), */
- 0x35, 0x00, /* Physical Minimum (0), */
- 0xa4, /* Push, */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x30, /* Usage (X), */
- 0x65, 0x13, /* Unit (Inch), */
- 0x55, 0x0d, /* Unit Exponent (-3), */
- 0x27, UCLOGIC_RDESC_PEN_PH(X_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x47, UCLOGIC_RDESC_PEN_PH(X_PM),
- /* Physical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x31, /* Usage (Y), */
- 0x27, UCLOGIC_RDESC_PEN_PH(Y_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x47, UCLOGIC_RDESC_PEN_PH(Y_PM),
- /* Physical Maximum (PLACEHOLDER), */
- 0x81, 0x02, /* Input (Variable), */
- 0xb4, /* Pop, */
- 0x09, 0x30, /* Usage (Tip Pressure), */
- 0x45, 0x00, /* Physical Maximum (0), */
- 0x27, UCLOGIC_RDESC_PEN_PH(PRESSURE_LM),
- /* Logical Maximum (PLACEHOLDER), */
- 0x75, 0x0D, /* Report Size (13), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x01, /* Input (Constant), */
- 0x09, 0x3d, /* Usage (X Tilt), */
- 0x35, 0xC3, /* Physical Minimum (-61), */
- 0x45, 0x3C, /* Physical Maximum (60), */
- 0x15, 0xC3, /* Logical Minimum (-61), */
- 0x25, 0x3C, /* Logical Maximum (60), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x09, 0x3e, /* Usage (Y Tilt), */
- 0x35, 0xC3, /* Physical Minimum (-61), */
- 0x45, 0x3C, /* Physical Maximum (60), */
- 0x15, 0xC3, /* Logical Minimum (-61), */
- 0x25, 0x3C, /* Logical Maximum (60), */
- 0x81, 0x02, /* Input (Variable), */
- 0xc0, /* End Collection, */
- 0xc0, /* End Collection */
- };
- const size_t uclogic_rdesc_ugee_v2_pen_template_size =
- sizeof(uclogic_rdesc_ugee_v2_pen_template_arr);
- /* Fixed report descriptor template for UGEE v2 frame reports (buttons only) */
- const __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, UCLOGIC_RDESC_V1_FRAME_ID,
- /* Report ID, */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x08, /* Report Count (8), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- UCLOGIC_RDESC_FRAME_PH_BTN,
- /* Usage Maximum (PLACEHOLDER), */
- 0x95, 0x0A, /* Report Count (10), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x46, /* Report Count (70), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_ugee_v2_frame_btn_template_size =
- sizeof(uclogic_rdesc_ugee_v2_frame_btn_template_arr);
- /* Fixed report descriptor template for UGEE v2 frame reports (dial) */
- const __u8 uclogic_rdesc_ugee_v2_frame_dial_template_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, UCLOGIC_RDESC_V1_FRAME_ID,
- /* Report ID, */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x08, /* Report Count (8), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- UCLOGIC_RDESC_FRAME_PH_BTN,
- /* Usage Maximum (PLACEHOLDER), */
- 0x95, 0x0A, /* Report Count (10), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x06, /* Report Count (6), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x95, 0x01, /* Report Count (1), */
- 0x15, 0xFF, /* Logical Minimum (-1), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_ugee_v2_frame_dial_template_size =
- sizeof(uclogic_rdesc_ugee_v2_frame_dial_template_arr);
- /* Fixed report descriptor template for UGEE v2 frame reports (mouse) */
- const __u8 uclogic_rdesc_ugee_v2_frame_mouse_template_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x02, /* Usage (Mouse), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x01, /* Report ID (1), */
- 0x05, 0x01, /* Usage Page (Pointer), */
- 0xA0, /* Collection (Physical), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x02, /* Report Count (2), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x02, /* Usage Maximum (02h), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x06, /* Report Count (6), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x01, /* Usage Page (Generic Desktop), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x75, 0x10, /* Report Size (16), */
- 0x95, 0x02, /* Report Count (2), */
- 0x16, 0x00, 0x80, /* Logical Minimum (-32768), */
- 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_ugee_v2_frame_mouse_template_size =
- sizeof(uclogic_rdesc_ugee_v2_frame_mouse_template_arr);
- /* Fixed report descriptor template for UGEE v2 battery reports */
- const __u8 uclogic_rdesc_ugee_v2_battery_template_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, UCLOGIC_RDESC_UGEE_V2_BATTERY_ID,
- /* Report ID, */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x84, /* Usage Page (Power Device), */
- 0x05, 0x85, /* Usage Page (Battery System), */
- 0x09, 0x65, /* Usage Page (AbsoluteStateOfCharge), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x01, /* Report Count (1), */
- 0x15, 0x00, /* Logical Minimum (0), */
- 0x26, 0xff, 0x00, /* Logical Maximum (255), */
- 0x81, 0x02, /* Input (Variable), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x01, /* Report Count (1), */
- 0x15, 0x00, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x09, 0x44, /* Usage Page (Charging), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x07, /* Report Count (7), */
- 0x81, 0x01, /* Input (Constant), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x07, /* Report Count (7), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_ugee_v2_battery_template_size =
- sizeof(uclogic_rdesc_ugee_v2_battery_template_arr);
- /* Fixed report descriptor for Ugee EX07 frame */
- const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x06, /* Report ID (6), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x75, 0x01, /* Report Size (1), */
- 0x19, 0x03, /* Usage Minimum (03h), */
- 0x29, 0x06, /* Usage Maximum (06h), */
- 0x95, 0x04, /* Report Count (4), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x1A, /* Report Count (26), */
- 0x81, 0x03, /* Input (Constant, Variable), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x02, /* Usage Maximum (02h), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x02, /* Input (Variable), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_ugee_ex07_frame_size =
- sizeof(uclogic_rdesc_ugee_ex07_frame_arr);
- /* Fixed report descriptor for Ugee G5 frame controls */
- const __u8 uclogic_rdesc_ugee_g5_frame_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x06, /* Report ID (6), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x05, /* Usage Maximum (05h), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x05, /* Report Count (5), */
- 0x81, 0x02, /* Input (Variable), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x03, /* Report Count (3), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x0A, 0xFF, 0xFF, /* Usage (FFFFh), */
- 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
- 0x75, 0x08, /* Report Size (8), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x02, /* Input (Variable), */
- 0x75, 0x01, /* Report Size (1), */
- 0x95, 0x0B, /* Report Count (11), */
- 0x81, 0x01, /* Input (Constant), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x38, /* Usage (Wheel), */
- 0x15, 0xFF, /* Logical Minimum (-1), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x02, /* Report Size (2), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x06, /* Input (Variable, Relative), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_ugee_g5_frame_size =
- sizeof(uclogic_rdesc_ugee_g5_frame_arr);
- /* Fixed report descriptor for XP-Pen Deco 01 frame controls */
- const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x07, /* Usage (Keypad), */
- 0xA1, 0x01, /* Collection (Application), */
- 0x85, 0x06, /* Report ID (6), */
- 0x14, /* Logical Minimum (0), */
- 0x25, 0x01, /* Logical Maximum (1), */
- 0x75, 0x01, /* Report Size (1), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x39, /* Usage (Tablet Function Keys), */
- 0xA0, /* Collection (Physical), */
- 0x05, 0x09, /* Usage Page (Button), */
- 0x19, 0x01, /* Usage Minimum (01h), */
- 0x29, 0x08, /* Usage Maximum (08h), */
- 0x95, 0x08, /* Report Count (8), */
- 0x81, 0x02, /* Input (Variable), */
- 0x05, 0x0D, /* Usage Page (Digitizer), */
- 0x09, 0x44, /* Usage (Barrel Switch), */
- 0x95, 0x01, /* Report Count (1), */
- 0x81, 0x02, /* Input (Variable), */
- 0x05, 0x01, /* Usage Page (Desktop), */
- 0x09, 0x30, /* Usage (X), */
- 0x09, 0x31, /* Usage (Y), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x02, /* Input (Variable), */
- 0x95, 0x15, /* Report Count (21), */
- 0x81, 0x01, /* Input (Constant), */
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- const size_t uclogic_rdesc_xppen_deco01_frame_size =
- sizeof(uclogic_rdesc_xppen_deco01_frame_arr);
- /**
- * uclogic_rdesc_template_apply() - apply report descriptor parameters to a
- * report descriptor template, creating a report descriptor. Copies the
- * template over to the new report descriptor and replaces every occurrence of
- * the template placeholders, followed by an index byte, with the value from the
- * parameter list at that index.
- *
- * @template_ptr: Pointer to the template buffer.
- * @template_size: Size of the template buffer.
- * @param_list: List of template parameters.
- * @param_num: Number of parameters in the list.
- *
- * Returns:
- * Kmalloc-allocated pointer to the created report descriptor,
- * or NULL if allocation failed.
- */
- __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
- size_t template_size,
- const s32 *param_list,
- size_t param_num)
- {
- static const __u8 btn_head[] = {UCLOGIC_RDESC_FRAME_PH_BTN_HEAD};
- static const __u8 pen_head[] = {UCLOGIC_RDESC_PEN_PH_HEAD};
- __u8 *rdesc_ptr;
- __u8 *p;
- s32 v;
- rdesc_ptr = kmemdup(template_ptr, template_size, GFP_KERNEL);
- if (rdesc_ptr == NULL)
- return NULL;
- for (p = rdesc_ptr; p + sizeof(btn_head) < rdesc_ptr + template_size;) {
- if (p + sizeof(pen_head) < rdesc_ptr + template_size &&
- memcmp(p, pen_head, sizeof(pen_head)) == 0 &&
- p[sizeof(pen_head)] < param_num) {
- v = param_list[p[sizeof(pen_head)]];
- put_unaligned((__force u32)cpu_to_le32(v), (s32 *)p);
- p += sizeof(pen_head) + 1;
- } else if (memcmp(p, btn_head, sizeof(btn_head)) == 0 &&
- p[sizeof(btn_head)] < param_num) {
- v = param_list[p[sizeof(btn_head)]];
- put_unaligned((__u8)0x2A, p); /* Usage Maximum */
- put_unaligned((__force u16)cpu_to_le16(v), (s16 *)(p + 1));
- p += sizeof(btn_head) + 1;
- } else {
- p++;
- }
- }
- return rdesc_ptr;
- }
|