162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *  HID driver for UC-Logic devices not fully compliant with HID standard
462306a36Sopenharmony_ci *  - original and fixed report descriptors
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci *  Copyright (c) 2010-2017 Nikolai Kondrashov
762306a36Sopenharmony_ci *  Copyright (c) 2013 Martin Rusko
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci/*
1162306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify it
1262306a36Sopenharmony_ci * under the terms of the GNU General Public License as published by the Free
1362306a36Sopenharmony_ci * Software Foundation; either version 2 of the License, or (at your option)
1462306a36Sopenharmony_ci * any later version.
1562306a36Sopenharmony_ci */
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#include "hid-uclogic-rdesc.h"
1862306a36Sopenharmony_ci#include <linux/slab.h>
1962306a36Sopenharmony_ci#include <asm/unaligned.h>
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/* Fixed WP4030U report descriptor */
2262306a36Sopenharmony_ci__u8 uclogic_rdesc_wp4030u_fixed_arr[] = {
2362306a36Sopenharmony_ci	0x05, 0x0D,         /*  Usage Page (Digitizer),             */
2462306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                  */
2562306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
2662306a36Sopenharmony_ci	0x85, 0x09,         /*      Report ID (9),                  */
2762306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                 */
2862306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
2962306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
3062306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),         */
3162306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
3262306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),        */
3362306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
3462306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
3562306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
3662306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
3762306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
3862306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
3962306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
4062306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
4162306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
4262306a36Sopenharmony_ci	0xA4,               /*          Push,                       */
4362306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
4462306a36Sopenharmony_ci	0x55, 0xFD,         /*          Unit Exponent (-3),         */
4562306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                */
4662306a36Sopenharmony_ci	0x34,               /*          Physical Minimum (0),       */
4762306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
4862306a36Sopenharmony_ci	0x46, 0xA0, 0x0F,   /*          Physical Maximum (4000),    */
4962306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
5062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
5162306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
5262306a36Sopenharmony_ci	0x46, 0xB8, 0x0B,   /*          Physical Maximum (3000),    */
5362306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
5462306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
5562306a36Sopenharmony_ci	0xB4,               /*          Pop,                        */
5662306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),       */
5762306a36Sopenharmony_ci	0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
5862306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
5962306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
6062306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
6162306a36Sopenharmony_ci};
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ciconst size_t uclogic_rdesc_wp4030u_fixed_size =
6462306a36Sopenharmony_ci			sizeof(uclogic_rdesc_wp4030u_fixed_arr);
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci/* Fixed WP5540U report descriptor */
6762306a36Sopenharmony_ci__u8 uclogic_rdesc_wp5540u_fixed_arr[] = {
6862306a36Sopenharmony_ci	0x05, 0x0D,         /*  Usage Page (Digitizer),             */
6962306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                  */
7062306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
7162306a36Sopenharmony_ci	0x85, 0x09,         /*      Report ID (9),                  */
7262306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                 */
7362306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
7462306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
7562306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),         */
7662306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
7762306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),        */
7862306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
7962306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
8062306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
8162306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
8262306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
8362306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
8462306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
8562306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
8662306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
8762306a36Sopenharmony_ci	0xA4,               /*          Push,                       */
8862306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
8962306a36Sopenharmony_ci	0x55, 0xFD,         /*          Unit Exponent (-3),         */
9062306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                */
9162306a36Sopenharmony_ci	0x34,               /*          Physical Minimum (0),       */
9262306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
9362306a36Sopenharmony_ci	0x46, 0x7C, 0x15,   /*          Physical Maximum (5500),    */
9462306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
9562306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
9662306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
9762306a36Sopenharmony_ci	0x46, 0xA0, 0x0F,   /*          Physical Maximum (4000),    */
9862306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
9962306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
10062306a36Sopenharmony_ci	0xB4,               /*          Pop,                        */
10162306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),       */
10262306a36Sopenharmony_ci	0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
10362306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
10462306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
10562306a36Sopenharmony_ci	0xC0,               /*  End Collection,                     */
10662306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
10762306a36Sopenharmony_ci	0x09, 0x02,         /*  Usage (Mouse),                      */
10862306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
10962306a36Sopenharmony_ci	0x85, 0x08,         /*      Report ID (8),                  */
11062306a36Sopenharmony_ci	0x09, 0x01,         /*      Usage (Pointer),                */
11162306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
11262306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
11362306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
11462306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),        */
11562306a36Sopenharmony_ci	0x29, 0x03,         /*          Usage Maximum (03h),        */
11662306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
11762306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
11862306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
11962306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
12062306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
12162306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
12262306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
12362306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
12462306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
12562306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
12662306a36Sopenharmony_ci	0x15, 0x81,         /*          Logical Minimum (-127),     */
12762306a36Sopenharmony_ci	0x25, 0x7F,         /*          Logical Maximum (127),      */
12862306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
12962306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
13062306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
13162306a36Sopenharmony_ci	0x15, 0xFF,         /*          Logical Minimum (-1),       */
13262306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
13362306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
13462306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
13562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
13662306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
13762306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
13862306a36Sopenharmony_ci};
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ciconst size_t uclogic_rdesc_wp5540u_fixed_size =
14162306a36Sopenharmony_ci			sizeof(uclogic_rdesc_wp5540u_fixed_arr);
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci/* Fixed WP8060U report descriptor */
14462306a36Sopenharmony_ci__u8 uclogic_rdesc_wp8060u_fixed_arr[] = {
14562306a36Sopenharmony_ci	0x05, 0x0D,         /*  Usage Page (Digitizer),             */
14662306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                  */
14762306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
14862306a36Sopenharmony_ci	0x85, 0x09,         /*      Report ID (9),                  */
14962306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                 */
15062306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
15162306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
15262306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),         */
15362306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
15462306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),        */
15562306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
15662306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
15762306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
15862306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
15962306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
16062306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
16162306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
16262306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
16362306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
16462306a36Sopenharmony_ci	0xA4,               /*          Push,                       */
16562306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
16662306a36Sopenharmony_ci	0x55, 0xFD,         /*          Unit Exponent (-3),         */
16762306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                */
16862306a36Sopenharmony_ci	0x34,               /*          Physical Minimum (0),       */
16962306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
17062306a36Sopenharmony_ci	0x46, 0x40, 0x1F,   /*          Physical Maximum (8000),    */
17162306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
17262306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
17362306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
17462306a36Sopenharmony_ci	0x46, 0x70, 0x17,   /*          Physical Maximum (6000),    */
17562306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
17662306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
17762306a36Sopenharmony_ci	0xB4,               /*          Pop,                        */
17862306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),       */
17962306a36Sopenharmony_ci	0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
18062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
18162306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
18262306a36Sopenharmony_ci	0xC0,               /*  End Collection,                     */
18362306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
18462306a36Sopenharmony_ci	0x09, 0x02,         /*  Usage (Mouse),                      */
18562306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
18662306a36Sopenharmony_ci	0x85, 0x08,         /*      Report ID (8),                  */
18762306a36Sopenharmony_ci	0x09, 0x01,         /*      Usage (Pointer),                */
18862306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
18962306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
19062306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
19162306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),        */
19262306a36Sopenharmony_ci	0x29, 0x03,         /*          Usage Maximum (03h),        */
19362306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
19462306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
19562306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
19662306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
19762306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
19862306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
19962306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
20062306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
20162306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
20262306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
20362306a36Sopenharmony_ci	0x15, 0x81,         /*          Logical Minimum (-127),     */
20462306a36Sopenharmony_ci	0x25, 0x7F,         /*          Logical Maximum (127),      */
20562306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
20662306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
20762306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
20862306a36Sopenharmony_ci	0x15, 0xFF,         /*          Logical Minimum (-1),       */
20962306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
21062306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
21162306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
21262306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
21362306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
21462306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
21562306a36Sopenharmony_ci};
21662306a36Sopenharmony_ci
21762306a36Sopenharmony_ciconst size_t uclogic_rdesc_wp8060u_fixed_size =
21862306a36Sopenharmony_ci			sizeof(uclogic_rdesc_wp8060u_fixed_arr);
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ci/* Fixed WP1062 report descriptor */
22162306a36Sopenharmony_ci__u8 uclogic_rdesc_wp1062_fixed_arr[] = {
22262306a36Sopenharmony_ci	0x05, 0x0D,         /*  Usage Page (Digitizer),             */
22362306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                  */
22462306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
22562306a36Sopenharmony_ci	0x85, 0x09,         /*      Report ID (9),                  */
22662306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                 */
22762306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
22862306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
22962306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),         */
23062306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
23162306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),        */
23262306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
23362306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
23462306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
23562306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
23662306a36Sopenharmony_ci	0x95, 0x04,         /*          Report Count (4),           */
23762306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
23862306a36Sopenharmony_ci	0x09, 0x32,         /*          Usage (In Range),           */
23962306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
24062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
24162306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
24262306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
24362306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
24462306a36Sopenharmony_ci	0xA4,               /*          Push,                       */
24562306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
24662306a36Sopenharmony_ci	0x55, 0xFD,         /*          Unit Exponent (-3),         */
24762306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                */
24862306a36Sopenharmony_ci	0x34,               /*          Physical Minimum (0),       */
24962306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
25062306a36Sopenharmony_ci	0x46, 0x10, 0x27,   /*          Physical Maximum (10000),   */
25162306a36Sopenharmony_ci	0x26, 0x20, 0x4E,   /*          Logical Maximum (20000),    */
25262306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
25362306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
25462306a36Sopenharmony_ci	0x46, 0xB7, 0x19,   /*          Physical Maximum (6583),    */
25562306a36Sopenharmony_ci	0x26, 0x6E, 0x33,   /*          Logical Maximum (13166),    */
25662306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
25762306a36Sopenharmony_ci	0xB4,               /*          Pop,                        */
25862306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),       */
25962306a36Sopenharmony_ci	0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
26062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
26162306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
26262306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
26362306a36Sopenharmony_ci};
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ciconst size_t uclogic_rdesc_wp1062_fixed_size =
26662306a36Sopenharmony_ci			sizeof(uclogic_rdesc_wp1062_fixed_arr);
26762306a36Sopenharmony_ci
26862306a36Sopenharmony_ci/* Fixed PF1209 report descriptor */
26962306a36Sopenharmony_ci__u8 uclogic_rdesc_pf1209_fixed_arr[] = {
27062306a36Sopenharmony_ci	0x05, 0x0D,         /*  Usage Page (Digitizer),             */
27162306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                  */
27262306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
27362306a36Sopenharmony_ci	0x85, 0x09,         /*      Report ID (9),                  */
27462306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                 */
27562306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
27662306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
27762306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),         */
27862306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
27962306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),        */
28062306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
28162306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
28262306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
28362306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
28462306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
28562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
28662306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
28762306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
28862306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
28962306a36Sopenharmony_ci	0xA4,               /*          Push,                       */
29062306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
29162306a36Sopenharmony_ci	0x55, 0xFD,         /*          Unit Exponent (-3),         */
29262306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                */
29362306a36Sopenharmony_ci	0x34,               /*          Physical Minimum (0),       */
29462306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
29562306a36Sopenharmony_ci	0x46, 0xE0, 0x2E,   /*          Physical Maximum (12000),   */
29662306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
29762306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
29862306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
29962306a36Sopenharmony_ci	0x46, 0x28, 0x23,   /*          Physical Maximum (9000),    */
30062306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
30162306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
30262306a36Sopenharmony_ci	0xB4,               /*          Pop,                        */
30362306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),       */
30462306a36Sopenharmony_ci	0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
30562306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
30662306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
30762306a36Sopenharmony_ci	0xC0,               /*  End Collection,                     */
30862306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
30962306a36Sopenharmony_ci	0x09, 0x02,         /*  Usage (Mouse),                      */
31062306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
31162306a36Sopenharmony_ci	0x85, 0x08,         /*      Report ID (8),                  */
31262306a36Sopenharmony_ci	0x09, 0x01,         /*      Usage (Pointer),                */
31362306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
31462306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
31562306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
31662306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),        */
31762306a36Sopenharmony_ci	0x29, 0x03,         /*          Usage Maximum (03h),        */
31862306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
31962306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
32062306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
32162306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
32262306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
32362306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
32462306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
32562306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
32662306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
32762306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
32862306a36Sopenharmony_ci	0x15, 0x81,         /*          Logical Minimum (-127),     */
32962306a36Sopenharmony_ci	0x25, 0x7F,         /*          Logical Maximum (127),      */
33062306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
33162306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
33262306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
33362306a36Sopenharmony_ci	0x15, 0xFF,         /*          Logical Minimum (-1),       */
33462306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
33562306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
33662306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
33762306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
33862306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
33962306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
34062306a36Sopenharmony_ci};
34162306a36Sopenharmony_ci
34262306a36Sopenharmony_ciconst size_t uclogic_rdesc_pf1209_fixed_size =
34362306a36Sopenharmony_ci			sizeof(uclogic_rdesc_pf1209_fixed_arr);
34462306a36Sopenharmony_ci
34562306a36Sopenharmony_ci/* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */
34662306a36Sopenharmony_ci__u8 uclogic_rdesc_twhl850_fixed0_arr[] = {
34762306a36Sopenharmony_ci	0x05, 0x0D,         /*  Usage Page (Digitizer),             */
34862306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                  */
34962306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
35062306a36Sopenharmony_ci	0x85, 0x09,         /*      Report ID (9),                  */
35162306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                 */
35262306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
35362306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
35462306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
35562306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
35662306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
35762306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),         */
35862306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
35962306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),        */
36062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
36162306a36Sopenharmony_ci	0x81, 0x03,         /*          Input (Constant, Variable), */
36262306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
36362306a36Sopenharmony_ci	0x09, 0x32,         /*          Usage (In Range),           */
36462306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
36562306a36Sopenharmony_ci	0x81, 0x03,         /*          Input (Constant, Variable), */
36662306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
36762306a36Sopenharmony_ci	0xA4,               /*          Push,                       */
36862306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
36962306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                */
37062306a36Sopenharmony_ci	0x55, 0xFD,         /*          Unit Exponent (-3),         */
37162306a36Sopenharmony_ci	0x34,               /*          Physical Minimum (0),       */
37262306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
37362306a36Sopenharmony_ci	0x46, 0x40, 0x1F,   /*          Physical Maximum (8000),    */
37462306a36Sopenharmony_ci	0x26, 0x00, 0x7D,   /*          Logical Maximum (32000),    */
37562306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
37662306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
37762306a36Sopenharmony_ci	0x46, 0x88, 0x13,   /*          Physical Maximum (5000),    */
37862306a36Sopenharmony_ci	0x26, 0x20, 0x4E,   /*          Logical Maximum (20000),    */
37962306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
38062306a36Sopenharmony_ci	0xB4,               /*          Pop,                        */
38162306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),       */
38262306a36Sopenharmony_ci	0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
38362306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
38462306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
38562306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
38662306a36Sopenharmony_ci};
38762306a36Sopenharmony_ci
38862306a36Sopenharmony_ciconst size_t uclogic_rdesc_twhl850_fixed0_size =
38962306a36Sopenharmony_ci			sizeof(uclogic_rdesc_twhl850_fixed0_arr);
39062306a36Sopenharmony_ci
39162306a36Sopenharmony_ci/* Fixed PID 0522 tablet report descriptor, interface 1 (mouse) */
39262306a36Sopenharmony_ci__u8 uclogic_rdesc_twhl850_fixed1_arr[] = {
39362306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
39462306a36Sopenharmony_ci	0x09, 0x02,         /*  Usage (Mouse),                      */
39562306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
39662306a36Sopenharmony_ci	0x85, 0x01,         /*      Report ID (1),                  */
39762306a36Sopenharmony_ci	0x09, 0x01,         /*      Usage (Pointer),                */
39862306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
39962306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
40062306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
40162306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
40262306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),        */
40362306a36Sopenharmony_ci	0x29, 0x03,         /*          Usage Maximum (03h),        */
40462306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
40562306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
40662306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
40762306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
40862306a36Sopenharmony_ci	0x81, 0x03,         /*          Input (Constant, Variable), */
40962306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
41062306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
41162306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
41262306a36Sopenharmony_ci	0x16, 0x00, 0x80,   /*          Logical Minimum (-32768),   */
41362306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
41462306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
41562306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
41662306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
41762306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
41862306a36Sopenharmony_ci	0x15, 0xFF,         /*          Logical Minimum (-1),       */
41962306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
42062306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
42162306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
42262306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
42362306a36Sopenharmony_ci	0x81, 0x03,         /*          Input (Constant, Variable), */
42462306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
42562306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
42662306a36Sopenharmony_ci};
42762306a36Sopenharmony_ci
42862306a36Sopenharmony_ciconst size_t uclogic_rdesc_twhl850_fixed1_size =
42962306a36Sopenharmony_ci			sizeof(uclogic_rdesc_twhl850_fixed1_arr);
43062306a36Sopenharmony_ci
43162306a36Sopenharmony_ci/* Fixed PID 0522 tablet report descriptor, interface 2 (frame buttons) */
43262306a36Sopenharmony_ci__u8 uclogic_rdesc_twhl850_fixed2_arr[] = {
43362306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
43462306a36Sopenharmony_ci	0x09, 0x06,         /*  Usage (Keyboard),                   */
43562306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
43662306a36Sopenharmony_ci	0x85, 0x03,         /*      Report ID (3),                  */
43762306a36Sopenharmony_ci	0x05, 0x07,         /*      Usage Page (Keyboard),          */
43862306a36Sopenharmony_ci	0x14,               /*      Logical Minimum (0),            */
43962306a36Sopenharmony_ci	0x19, 0xE0,         /*      Usage Minimum (KB Leftcontrol), */
44062306a36Sopenharmony_ci	0x29, 0xE7,         /*      Usage Maximum (KB Right GUI),   */
44162306a36Sopenharmony_ci	0x25, 0x01,         /*      Logical Maximum (1),            */
44262306a36Sopenharmony_ci	0x75, 0x01,         /*      Report Size (1),                */
44362306a36Sopenharmony_ci	0x95, 0x08,         /*      Report Count (8),               */
44462306a36Sopenharmony_ci	0x81, 0x02,         /*      Input (Variable),               */
44562306a36Sopenharmony_ci	0x18,               /*      Usage Minimum (None),           */
44662306a36Sopenharmony_ci	0x29, 0xFF,         /*      Usage Maximum (FFh),            */
44762306a36Sopenharmony_ci	0x26, 0xFF, 0x00,   /*      Logical Maximum (255),          */
44862306a36Sopenharmony_ci	0x75, 0x08,         /*      Report Size (8),                */
44962306a36Sopenharmony_ci	0x95, 0x06,         /*      Report Count (6),               */
45062306a36Sopenharmony_ci	0x80,               /*      Input,                          */
45162306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
45262306a36Sopenharmony_ci};
45362306a36Sopenharmony_ci
45462306a36Sopenharmony_ciconst size_t uclogic_rdesc_twhl850_fixed2_size =
45562306a36Sopenharmony_ci			sizeof(uclogic_rdesc_twhl850_fixed2_arr);
45662306a36Sopenharmony_ci
45762306a36Sopenharmony_ci/* Fixed TWHA60 report descriptor, interface 0 (stylus) */
45862306a36Sopenharmony_ci__u8 uclogic_rdesc_twha60_fixed0_arr[] = {
45962306a36Sopenharmony_ci	0x05, 0x0D,         /*  Usage Page (Digitizer),             */
46062306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                  */
46162306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
46262306a36Sopenharmony_ci	0x85, 0x09,         /*      Report ID (9),                  */
46362306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                 */
46462306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
46562306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
46662306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),         */
46762306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
46862306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),        */
46962306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
47062306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
47162306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
47262306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
47362306a36Sopenharmony_ci	0x95, 0x04,         /*          Report Count (4),           */
47462306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
47562306a36Sopenharmony_ci	0x09, 0x32,         /*          Usage (In Range),           */
47662306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
47762306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
47862306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),           */
47962306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
48062306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
48162306a36Sopenharmony_ci	0xA4,               /*          Push,                       */
48262306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
48362306a36Sopenharmony_ci	0x55, 0xFD,         /*          Unit Exponent (-3),         */
48462306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                */
48562306a36Sopenharmony_ci	0x34,               /*          Physical Minimum (0),       */
48662306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
48762306a36Sopenharmony_ci	0x46, 0x10, 0x27,   /*          Physical Maximum (10000),   */
48862306a36Sopenharmony_ci	0x27, 0x3F, 0x9C,
48962306a36Sopenharmony_ci		0x00, 0x00, /*          Logical Maximum (39999),    */
49062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
49162306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
49262306a36Sopenharmony_ci	0x46, 0x6A, 0x18,   /*          Physical Maximum (6250),    */
49362306a36Sopenharmony_ci	0x26, 0xA7, 0x61,   /*          Logical Maximum (24999),    */
49462306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
49562306a36Sopenharmony_ci	0xB4,               /*          Pop,                        */
49662306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),       */
49762306a36Sopenharmony_ci	0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
49862306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
49962306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
50062306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
50162306a36Sopenharmony_ci};
50262306a36Sopenharmony_ci
50362306a36Sopenharmony_ciconst size_t uclogic_rdesc_twha60_fixed0_size =
50462306a36Sopenharmony_ci			sizeof(uclogic_rdesc_twha60_fixed0_arr);
50562306a36Sopenharmony_ci
50662306a36Sopenharmony_ci/* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */
50762306a36Sopenharmony_ci__u8 uclogic_rdesc_twha60_fixed1_arr[] = {
50862306a36Sopenharmony_ci	0x05, 0x01, /*  Usage Page (Desktop),       */
50962306a36Sopenharmony_ci	0x09, 0x06, /*  Usage (Keyboard),           */
51062306a36Sopenharmony_ci	0xA1, 0x01, /*  Collection (Application),   */
51162306a36Sopenharmony_ci	0x85, 0x05, /*      Report ID (5),          */
51262306a36Sopenharmony_ci	0x05, 0x07, /*      Usage Page (Keyboard),  */
51362306a36Sopenharmony_ci	0x14,       /*      Logical Minimum (0),    */
51462306a36Sopenharmony_ci	0x25, 0x01, /*      Logical Maximum (1),    */
51562306a36Sopenharmony_ci	0x75, 0x01, /*      Report Size (1),        */
51662306a36Sopenharmony_ci	0x95, 0x08, /*      Report Count (8),       */
51762306a36Sopenharmony_ci	0x81, 0x01, /*      Input (Constant),       */
51862306a36Sopenharmony_ci	0x95, 0x0C, /*      Report Count (12),      */
51962306a36Sopenharmony_ci	0x19, 0x3A, /*      Usage Minimum (KB F1),  */
52062306a36Sopenharmony_ci	0x29, 0x45, /*      Usage Maximum (KB F12), */
52162306a36Sopenharmony_ci	0x81, 0x02, /*      Input (Variable),       */
52262306a36Sopenharmony_ci	0x95, 0x0C, /*      Report Count (12),      */
52362306a36Sopenharmony_ci	0x19, 0x68, /*      Usage Minimum (KB F13), */
52462306a36Sopenharmony_ci	0x29, 0x73, /*      Usage Maximum (KB F24), */
52562306a36Sopenharmony_ci	0x81, 0x02, /*      Input (Variable),       */
52662306a36Sopenharmony_ci	0x95, 0x08, /*      Report Count (8),       */
52762306a36Sopenharmony_ci	0x81, 0x01, /*      Input (Constant),       */
52862306a36Sopenharmony_ci	0xC0        /*  End Collection              */
52962306a36Sopenharmony_ci};
53062306a36Sopenharmony_ci
53162306a36Sopenharmony_ciconst size_t uclogic_rdesc_twha60_fixed1_size =
53262306a36Sopenharmony_ci			sizeof(uclogic_rdesc_twha60_fixed1_arr);
53362306a36Sopenharmony_ci
53462306a36Sopenharmony_ci/* Fixed report descriptor template for (tweaked) v1 pen reports */
53562306a36Sopenharmony_ciconst __u8 uclogic_rdesc_v1_pen_template_arr[] = {
53662306a36Sopenharmony_ci	0x05, 0x0D,             /*  Usage Page (Digitizer),                 */
53762306a36Sopenharmony_ci	0x09, 0x01,             /*  Usage (Digitizer),                      */
53862306a36Sopenharmony_ci	0xA1, 0x01,             /*  Collection (Application),               */
53962306a36Sopenharmony_ci	0x85, 0x07,             /*      Report ID (7),                      */
54062306a36Sopenharmony_ci	0x09, 0x20,             /*      Usage (Stylus),                     */
54162306a36Sopenharmony_ci	0xA0,                   /*      Collection (Physical),              */
54262306a36Sopenharmony_ci	0x14,                   /*          Logical Minimum (0),            */
54362306a36Sopenharmony_ci	0x25, 0x01,             /*          Logical Maximum (1),            */
54462306a36Sopenharmony_ci	0x75, 0x01,             /*          Report Size (1),                */
54562306a36Sopenharmony_ci	0x09, 0x42,             /*          Usage (Tip Switch),             */
54662306a36Sopenharmony_ci	0x09, 0x44,             /*          Usage (Barrel Switch),          */
54762306a36Sopenharmony_ci	0x09, 0x46,             /*          Usage (Tablet Pick),            */
54862306a36Sopenharmony_ci	0x95, 0x03,             /*          Report Count (3),               */
54962306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
55062306a36Sopenharmony_ci	0x95, 0x03,             /*          Report Count (3),               */
55162306a36Sopenharmony_ci	0x81, 0x03,             /*          Input (Constant, Variable),     */
55262306a36Sopenharmony_ci	0x09, 0x32,             /*          Usage (In Range),               */
55362306a36Sopenharmony_ci	0x95, 0x01,             /*          Report Count (1),               */
55462306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
55562306a36Sopenharmony_ci	0x95, 0x01,             /*          Report Count (1),               */
55662306a36Sopenharmony_ci	0x81, 0x03,             /*          Input (Constant, Variable),     */
55762306a36Sopenharmony_ci	0x75, 0x10,             /*          Report Size (16),               */
55862306a36Sopenharmony_ci	0x95, 0x01,             /*          Report Count (1),               */
55962306a36Sopenharmony_ci	0xA4,                   /*          Push,                           */
56062306a36Sopenharmony_ci	0x05, 0x01,             /*          Usage Page (Desktop),           */
56162306a36Sopenharmony_ci	0x65, 0x13,             /*          Unit (Inch),                    */
56262306a36Sopenharmony_ci	0x55, 0xFD,             /*          Unit Exponent (-3),             */
56362306a36Sopenharmony_ci	0x34,                   /*          Physical Minimum (0),           */
56462306a36Sopenharmony_ci	0x09, 0x30,             /*          Usage (X),                      */
56562306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(X_LM),
56662306a36Sopenharmony_ci				/*          Logical Maximum (PLACEHOLDER),  */
56762306a36Sopenharmony_ci	0x47, UCLOGIC_RDESC_PEN_PH(X_PM),
56862306a36Sopenharmony_ci				/*          Physical Maximum (PLACEHOLDER), */
56962306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
57062306a36Sopenharmony_ci	0x09, 0x31,             /*          Usage (Y),                      */
57162306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(Y_LM),
57262306a36Sopenharmony_ci				/*          Logical Maximum (PLACEHOLDER),  */
57362306a36Sopenharmony_ci	0x47, UCLOGIC_RDESC_PEN_PH(Y_PM),
57462306a36Sopenharmony_ci				/*          Physical Maximum (PLACEHOLDER), */
57562306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
57662306a36Sopenharmony_ci	0xB4,                   /*          Pop,                            */
57762306a36Sopenharmony_ci	0x09, 0x30,             /*          Usage (Tip Pressure),           */
57862306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(PRESSURE_LM),
57962306a36Sopenharmony_ci				/*          Logical Maximum (PLACEHOLDER),  */
58062306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
58162306a36Sopenharmony_ci	0xC0,                   /*      End Collection,                     */
58262306a36Sopenharmony_ci	0xC0                    /*  End Collection                          */
58362306a36Sopenharmony_ci};
58462306a36Sopenharmony_ci
58562306a36Sopenharmony_ciconst size_t uclogic_rdesc_v1_pen_template_size =
58662306a36Sopenharmony_ci			sizeof(uclogic_rdesc_v1_pen_template_arr);
58762306a36Sopenharmony_ci
58862306a36Sopenharmony_ci/* Fixed report descriptor template for (tweaked) v2 pen reports */
58962306a36Sopenharmony_ciconst __u8 uclogic_rdesc_v2_pen_template_arr[] = {
59062306a36Sopenharmony_ci	0x05, 0x0D,             /*  Usage Page (Digitizer),                 */
59162306a36Sopenharmony_ci	0x09, 0x01,             /*  Usage (Digitizer),                      */
59262306a36Sopenharmony_ci	0xA1, 0x01,             /*  Collection (Application),               */
59362306a36Sopenharmony_ci	0x85, 0x08,             /*      Report ID (8),                      */
59462306a36Sopenharmony_ci	0x09, 0x20,             /*      Usage (Stylus),                     */
59562306a36Sopenharmony_ci	0xA0,                   /*      Collection (Physical),              */
59662306a36Sopenharmony_ci	0x14,                   /*          Logical Minimum (0),            */
59762306a36Sopenharmony_ci	0x25, 0x01,             /*          Logical Maximum (1),            */
59862306a36Sopenharmony_ci	0x75, 0x01,             /*          Report Size (1),                */
59962306a36Sopenharmony_ci	0x09, 0x42,             /*          Usage (Tip Switch),             */
60062306a36Sopenharmony_ci	0x09, 0x44,             /*          Usage (Barrel Switch),          */
60162306a36Sopenharmony_ci	0x09, 0x46,             /*          Usage (Tablet Pick),            */
60262306a36Sopenharmony_ci	0x95, 0x03,             /*          Report Count (3),               */
60362306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
60462306a36Sopenharmony_ci	0x95, 0x03,             /*          Report Count (3),               */
60562306a36Sopenharmony_ci	0x81, 0x03,             /*          Input (Constant, Variable),     */
60662306a36Sopenharmony_ci	0x09, 0x32,             /*          Usage (In Range),               */
60762306a36Sopenharmony_ci	0x95, 0x01,             /*          Report Count (1),               */
60862306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
60962306a36Sopenharmony_ci	0x95, 0x01,             /*          Report Count (1),               */
61062306a36Sopenharmony_ci	0x81, 0x03,             /*          Input (Constant, Variable),     */
61162306a36Sopenharmony_ci	0x95, 0x01,             /*          Report Count (1),               */
61262306a36Sopenharmony_ci	0xA4,                   /*          Push,                           */
61362306a36Sopenharmony_ci	0x05, 0x01,             /*          Usage Page (Desktop),           */
61462306a36Sopenharmony_ci	0x65, 0x13,             /*          Unit (Inch),                    */
61562306a36Sopenharmony_ci	0x55, 0xFD,             /*          Unit Exponent (-3),             */
61662306a36Sopenharmony_ci	0x75, 0x18,             /*          Report Size (24),               */
61762306a36Sopenharmony_ci	0x34,                   /*          Physical Minimum (0),           */
61862306a36Sopenharmony_ci	0x09, 0x30,             /*          Usage (X),                      */
61962306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(X_LM),
62062306a36Sopenharmony_ci				/*          Logical Maximum (PLACEHOLDER),  */
62162306a36Sopenharmony_ci	0x47, UCLOGIC_RDESC_PEN_PH(X_PM),
62262306a36Sopenharmony_ci				/*          Physical Maximum (PLACEHOLDER), */
62362306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
62462306a36Sopenharmony_ci	0x09, 0x31,             /*          Usage (Y),                      */
62562306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(Y_LM),
62662306a36Sopenharmony_ci				/*          Logical Maximum (PLACEHOLDER),  */
62762306a36Sopenharmony_ci	0x47, UCLOGIC_RDESC_PEN_PH(Y_PM),
62862306a36Sopenharmony_ci				/*          Physical Maximum (PLACEHOLDER), */
62962306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
63062306a36Sopenharmony_ci	0xB4,                   /*          Pop,                            */
63162306a36Sopenharmony_ci	0x09, 0x30,             /*          Usage (Tip Pressure),           */
63262306a36Sopenharmony_ci	0x75, 0x10,             /*          Report Size (16),               */
63362306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(PRESSURE_LM),
63462306a36Sopenharmony_ci				/*          Logical Maximum (PLACEHOLDER),  */
63562306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
63662306a36Sopenharmony_ci	0x54,                   /*          Unit Exponent (0),              */
63762306a36Sopenharmony_ci	0x65, 0x14,             /*          Unit (Degrees),                 */
63862306a36Sopenharmony_ci	0x35, 0xC4,             /*          Physical Minimum (-60),         */
63962306a36Sopenharmony_ci	0x45, 0x3C,             /*          Physical Maximum (60),          */
64062306a36Sopenharmony_ci	0x15, 0xC4,             /*          Logical Minimum (-60),          */
64162306a36Sopenharmony_ci	0x25, 0x3C,             /*          Logical Maximum (60),           */
64262306a36Sopenharmony_ci	0x75, 0x08,             /*          Report Size (8),                */
64362306a36Sopenharmony_ci	0x95, 0x02,             /*          Report Count (2),               */
64462306a36Sopenharmony_ci	0x09, 0x3D,             /*          Usage (X Tilt),                 */
64562306a36Sopenharmony_ci	0x09, 0x3E,             /*          Usage (Y Tilt),                 */
64662306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
64762306a36Sopenharmony_ci	0xC0,                   /*      End Collection,                     */
64862306a36Sopenharmony_ci	0xC0                    /*  End Collection                          */
64962306a36Sopenharmony_ci};
65062306a36Sopenharmony_ci
65162306a36Sopenharmony_ciconst size_t uclogic_rdesc_v2_pen_template_size =
65262306a36Sopenharmony_ci			sizeof(uclogic_rdesc_v2_pen_template_arr);
65362306a36Sopenharmony_ci
65462306a36Sopenharmony_ci/*
65562306a36Sopenharmony_ci * Expand to the contents of a generic frame buttons report descriptor.
65662306a36Sopenharmony_ci *
65762306a36Sopenharmony_ci * @_id:	The report ID to use.
65862306a36Sopenharmony_ci * @_size:	Size of the report to pad to, including report ID, bytes.
65962306a36Sopenharmony_ci */
66062306a36Sopenharmony_ci#define UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(_id, _size) \
66162306a36Sopenharmony_ci	0x05, 0x01,     /*  Usage Page (Desktop),               */ \
66262306a36Sopenharmony_ci	0x09, 0x07,     /*  Usage (Keypad),                     */ \
66362306a36Sopenharmony_ci	0xA1, 0x01,     /*  Collection (Application),           */ \
66462306a36Sopenharmony_ci	0x85, (_id),    /*      Report ID (_id),                */ \
66562306a36Sopenharmony_ci	0x14,           /*      Logical Minimum (0),            */ \
66662306a36Sopenharmony_ci	0x25, 0x01,     /*      Logical Maximum (1),            */ \
66762306a36Sopenharmony_ci	0x75, 0x01,     /*      Report Size (1),                */ \
66862306a36Sopenharmony_ci	0x05, 0x0D,     /*      Usage Page (Digitizer),         */ \
66962306a36Sopenharmony_ci	0x09, 0x39,     /*      Usage (Tablet Function Keys),   */ \
67062306a36Sopenharmony_ci	0xA0,           /*      Collection (Physical),          */ \
67162306a36Sopenharmony_ci	0x09, 0x44,     /*          Usage (Barrel Switch),      */ \
67262306a36Sopenharmony_ci	0x95, 0x01,     /*          Report Count (1),           */ \
67362306a36Sopenharmony_ci	0x81, 0x02,     /*          Input (Variable),           */ \
67462306a36Sopenharmony_ci	0x05, 0x01,     /*          Usage Page (Desktop),       */ \
67562306a36Sopenharmony_ci	0x09, 0x30,     /*          Usage (X),                  */ \
67662306a36Sopenharmony_ci	0x09, 0x31,     /*          Usage (Y),                  */ \
67762306a36Sopenharmony_ci	0x95, 0x02,     /*          Report Count (2),           */ \
67862306a36Sopenharmony_ci	0x81, 0x02,     /*          Input (Variable),           */ \
67962306a36Sopenharmony_ci	0x95, 0x15,     /*          Report Count (21),          */ \
68062306a36Sopenharmony_ci	0x81, 0x01,     /*          Input (Constant),           */ \
68162306a36Sopenharmony_ci	0x05, 0x09,     /*          Usage Page (Button),        */ \
68262306a36Sopenharmony_ci	0x19, 0x01,     /*          Usage Minimum (01h),        */ \
68362306a36Sopenharmony_ci	0x29, 0x0A,     /*          Usage Maximum (0Ah),        */ \
68462306a36Sopenharmony_ci	0x95, 0x0A,     /*          Report Count (10),          */ \
68562306a36Sopenharmony_ci	0x81, 0x02,     /*          Input (Variable),           */ \
68662306a36Sopenharmony_ci	0xC0,           /*      End Collection,                 */ \
68762306a36Sopenharmony_ci	0x05, 0x01,     /*      Usage Page (Desktop),           */ \
68862306a36Sopenharmony_ci	0x09, 0x05,     /*      Usage (Gamepad),                */ \
68962306a36Sopenharmony_ci	0xA0,           /*      Collection (Physical),          */ \
69062306a36Sopenharmony_ci	0x05, 0x09,     /*          Usage Page (Button),        */ \
69162306a36Sopenharmony_ci	0x19, 0x01,     /*          Usage Minimum (01h),        */ \
69262306a36Sopenharmony_ci	0x29, 0x03,     /*          Usage Maximum (03h),        */ \
69362306a36Sopenharmony_ci	0x95, 0x03,     /*          Report Count (3),           */ \
69462306a36Sopenharmony_ci	0x81, 0x02,     /*          Input (Variable),           */ \
69562306a36Sopenharmony_ci	0x95, ((_size) * 8 - 45),                                  \
69662306a36Sopenharmony_ci			/*          Report Count (padding),     */ \
69762306a36Sopenharmony_ci	0x81, 0x01,     /*          Input (Constant),           */ \
69862306a36Sopenharmony_ci	0xC0,           /*      End Collection,                 */ \
69962306a36Sopenharmony_ci	0xC0            /*  End Collection                      */
70062306a36Sopenharmony_ci
70162306a36Sopenharmony_ci/* Fixed report descriptor for (tweaked) v1 frame reports */
70262306a36Sopenharmony_ciconst __u8 uclogic_rdesc_v1_frame_arr[] = {
70362306a36Sopenharmony_ci	UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V1_FRAME_ID, 8)
70462306a36Sopenharmony_ci};
70562306a36Sopenharmony_ciconst size_t uclogic_rdesc_v1_frame_size =
70662306a36Sopenharmony_ci			sizeof(uclogic_rdesc_v1_frame_arr);
70762306a36Sopenharmony_ci
70862306a36Sopenharmony_ci/* Fixed report descriptor for (tweaked) v2 frame button reports */
70962306a36Sopenharmony_ciconst __u8 uclogic_rdesc_v2_frame_buttons_arr[] = {
71062306a36Sopenharmony_ci	UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID,
71162306a36Sopenharmony_ci					  12)
71262306a36Sopenharmony_ci};
71362306a36Sopenharmony_ciconst size_t uclogic_rdesc_v2_frame_buttons_size =
71462306a36Sopenharmony_ci			sizeof(uclogic_rdesc_v2_frame_buttons_arr);
71562306a36Sopenharmony_ci
71662306a36Sopenharmony_ci/* Fixed report descriptor for (tweaked) v2 frame touch ring reports */
71762306a36Sopenharmony_ciconst __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {
71862306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
71962306a36Sopenharmony_ci	0x09, 0x07,         /*  Usage (Keypad),                     */
72062306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
72162306a36Sopenharmony_ci	0x85, UCLOGIC_RDESC_V2_FRAME_TOUCH_ID,
72262306a36Sopenharmony_ci			    /*      Report ID (TOUCH_ID),           */
72362306a36Sopenharmony_ci	0x14,               /*      Logical Minimum (0),            */
72462306a36Sopenharmony_ci	0x05, 0x0D,         /*      Usage Page (Digitizer),         */
72562306a36Sopenharmony_ci	0x09, 0x39,         /*      Usage (Tablet Function Keys),   */
72662306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
72762306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
72862306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
72962306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
73062306a36Sopenharmony_ci	0x09, 0x01,         /*          Usage (01h),                */
73162306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
73262306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
73362306a36Sopenharmony_ci	0x95, 0x07,         /*          Report Count (7),           */
73462306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
73562306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
73662306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
73762306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
73862306a36Sopenharmony_ci	0x05, 0x0D,         /*          Usage Page (Digitizer),     */
73962306a36Sopenharmony_ci	0x0A, 0xFF, 0xFF,   /*          Usage (FFFFh),              */
74062306a36Sopenharmony_ci	0x26, 0xFF, 0x00,   /*          Logical Maximum (255),      */
74162306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
74262306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
74362306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
74462306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
74562306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
74662306a36Sopenharmony_ci	0x15, 0x00,         /*          Logical Minimum (0),        */
74762306a36Sopenharmony_ci	0x25, 0x0B,         /*          Logical Maximum (11),       */
74862306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
74962306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
75062306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
75162306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
75262306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
75362306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
75462306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
75562306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
75662306a36Sopenharmony_ci	0x95, 0x2E,         /*          Report Count (46),          */
75762306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
75862306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
75962306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
76062306a36Sopenharmony_ci};
76162306a36Sopenharmony_ciconst size_t uclogic_rdesc_v2_frame_touch_ring_size =
76262306a36Sopenharmony_ci			sizeof(uclogic_rdesc_v2_frame_touch_ring_arr);
76362306a36Sopenharmony_ci
76462306a36Sopenharmony_ci/* Fixed report descriptor for (tweaked) v2 frame touch strip reports */
76562306a36Sopenharmony_ciconst __u8 uclogic_rdesc_v2_frame_touch_strip_arr[] = {
76662306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
76762306a36Sopenharmony_ci	0x09, 0x07,         /*  Usage (Keypad),                     */
76862306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
76962306a36Sopenharmony_ci	0x85, UCLOGIC_RDESC_V2_FRAME_TOUCH_ID,
77062306a36Sopenharmony_ci			    /*      Report ID (TOUCH_ID),           */
77162306a36Sopenharmony_ci	0x14,               /*      Logical Minimum (0),            */
77262306a36Sopenharmony_ci	0x05, 0x0D,         /*      Usage Page (Digitizer),         */
77362306a36Sopenharmony_ci	0x09, 0x39,         /*      Usage (Tablet Function Keys),   */
77462306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
77562306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
77662306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
77762306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
77862306a36Sopenharmony_ci	0x09, 0x01,         /*          Usage (01h),                */
77962306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
78062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
78162306a36Sopenharmony_ci	0x95, 0x07,         /*          Report Count (7),           */
78262306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
78362306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
78462306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
78562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
78662306a36Sopenharmony_ci	0x05, 0x0D,         /*          Usage Page (Digitizer),     */
78762306a36Sopenharmony_ci	0x0A, 0xFF, 0xFF,   /*          Usage (FFFFh),              */
78862306a36Sopenharmony_ci	0x26, 0xFF, 0x00,   /*          Logical Maximum (255),      */
78962306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
79062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
79162306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
79262306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
79362306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
79462306a36Sopenharmony_ci	0x15, 0x00,         /*          Logical Minimum (0),        */
79562306a36Sopenharmony_ci	0x25, 0x07,         /*          Logical Maximum (7),        */
79662306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
79762306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
79862306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
79962306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
80062306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
80162306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
80262306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
80362306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
80462306a36Sopenharmony_ci	0x95, 0x2E,         /*          Report Count (46),          */
80562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
80662306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
80762306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
80862306a36Sopenharmony_ci};
80962306a36Sopenharmony_ciconst size_t uclogic_rdesc_v2_frame_touch_strip_size =
81062306a36Sopenharmony_ci			sizeof(uclogic_rdesc_v2_frame_touch_strip_arr);
81162306a36Sopenharmony_ci
81262306a36Sopenharmony_ci/* Fixed report descriptor for (tweaked) v2 frame dial reports */
81362306a36Sopenharmony_ciconst __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
81462306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
81562306a36Sopenharmony_ci	0x09, 0x07,         /*  Usage (Keypad),                     */
81662306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
81762306a36Sopenharmony_ci	0x85, UCLOGIC_RDESC_V2_FRAME_DIAL_ID,
81862306a36Sopenharmony_ci			    /*      Report ID (DIAL_ID),            */
81962306a36Sopenharmony_ci	0x14,               /*      Logical Minimum (0),            */
82062306a36Sopenharmony_ci	0x05, 0x0D,         /*      Usage Page (Digitizer),         */
82162306a36Sopenharmony_ci	0x09, 0x39,         /*      Usage (Tablet Function Keys),   */
82262306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
82362306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
82462306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
82562306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
82662306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
82762306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
82862306a36Sopenharmony_ci	0x09, 0x01,         /*          Usage (01h),                */
82962306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
83062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
83162306a36Sopenharmony_ci	0x95, 0x06,         /*          Report Count (6),           */
83262306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
83362306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
83462306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
83562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
83662306a36Sopenharmony_ci	0x05, 0x0D,         /*          Usage Page (Digitizer),     */
83762306a36Sopenharmony_ci	0x0A, 0xFF, 0xFF,   /*          Usage (FFFFh),              */
83862306a36Sopenharmony_ci	0x26, 0xFF, 0x00,   /*          Logical Maximum (255),      */
83962306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
84062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
84162306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
84262306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
84362306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
84462306a36Sopenharmony_ci	0x15, 0xFF,         /*          Logical Minimum (-1),       */
84562306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
84662306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
84762306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
84862306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
84962306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
85062306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
85162306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
85262306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
85362306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
85462306a36Sopenharmony_ci	0x95, 0x2E,         /*          Report Count (46),          */
85562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
85662306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
85762306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
85862306a36Sopenharmony_ci};
85962306a36Sopenharmony_ciconst size_t uclogic_rdesc_v2_frame_dial_size =
86062306a36Sopenharmony_ci			sizeof(uclogic_rdesc_v2_frame_dial_arr);
86162306a36Sopenharmony_ci
86262306a36Sopenharmony_ciconst __u8 uclogic_ugee_v2_probe_arr[] = {
86362306a36Sopenharmony_ci	0x02, 0xb0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
86462306a36Sopenharmony_ci};
86562306a36Sopenharmony_ciconst size_t uclogic_ugee_v2_probe_size = sizeof(uclogic_ugee_v2_probe_arr);
86662306a36Sopenharmony_ciconst int uclogic_ugee_v2_probe_endpoint = 0x03;
86762306a36Sopenharmony_ci
86862306a36Sopenharmony_ci/* Fixed report descriptor template for UGEE v2 pen reports */
86962306a36Sopenharmony_ciconst __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
87062306a36Sopenharmony_ci	0x05, 0x0d,         /*  Usage Page (Digitizers),                */
87162306a36Sopenharmony_ci	0x09, 0x01,         /*  Usage (Digitizer),                      */
87262306a36Sopenharmony_ci	0xa1, 0x01,         /*  Collection (Application),               */
87362306a36Sopenharmony_ci	0x85, 0x02,         /*      Report ID (2),                      */
87462306a36Sopenharmony_ci	0x09, 0x20,         /*      Usage (Stylus),                     */
87562306a36Sopenharmony_ci	0xa1, 0x00,         /*      Collection (Physical),              */
87662306a36Sopenharmony_ci	0x09, 0x42,         /*          Usage (Tip Switch),             */
87762306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),          */
87862306a36Sopenharmony_ci	0x09, 0x46,         /*          Usage (Tablet Pick),            */
87962306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),                */
88062306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),               */
88162306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),            */
88262306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),            */
88362306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
88462306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),               */
88562306a36Sopenharmony_ci	0x81, 0x03,         /*          Input (Constant, Variable),     */
88662306a36Sopenharmony_ci	0x09, 0x32,         /*          Usage (In Range),               */
88762306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),               */
88862306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
88962306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),               */
89062306a36Sopenharmony_ci	0x81, 0x03,         /*          Input (Constant, Variable),     */
89162306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),               */
89262306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),               */
89362306a36Sopenharmony_ci	0x35, 0x00,         /*          Physical Minimum (0),           */
89462306a36Sopenharmony_ci	0xa4,               /*          Push,                           */
89562306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),           */
89662306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                      */
89762306a36Sopenharmony_ci	0x65, 0x13,         /*          Unit (Inch),                    */
89862306a36Sopenharmony_ci	0x55, 0x0d,         /*          Unit Exponent (-3),             */
89962306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(X_LM),
90062306a36Sopenharmony_ci			    /*          Logical Maximum (PLACEHOLDER),  */
90162306a36Sopenharmony_ci	0x47, UCLOGIC_RDESC_PEN_PH(X_PM),
90262306a36Sopenharmony_ci			    /*          Physical Maximum (PLACEHOLDER), */
90362306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
90462306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                      */
90562306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(Y_LM),
90662306a36Sopenharmony_ci			    /*          Logical Maximum (PLACEHOLDER),  */
90762306a36Sopenharmony_ci	0x47, UCLOGIC_RDESC_PEN_PH(Y_PM),
90862306a36Sopenharmony_ci			    /*          Physical Maximum (PLACEHOLDER), */
90962306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
91062306a36Sopenharmony_ci	0xb4,               /*          Pop,                            */
91162306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (Tip Pressure),           */
91262306a36Sopenharmony_ci	0x45, 0x00,         /*          Physical Maximum (0),           */
91362306a36Sopenharmony_ci	0x27, UCLOGIC_RDESC_PEN_PH(PRESSURE_LM),
91462306a36Sopenharmony_ci			    /*          Logical Maximum (PLACEHOLDER),  */
91562306a36Sopenharmony_ci	0x75, 0x0D,         /*          Report Size (13),               */
91662306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),               */
91762306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
91862306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),                */
91962306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),               */
92062306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
92162306a36Sopenharmony_ci	0x09, 0x3d,         /*          Usage (X Tilt),                 */
92262306a36Sopenharmony_ci	0x35, 0xC3,         /*          Physical Minimum (-61),         */
92362306a36Sopenharmony_ci	0x45, 0x3C,         /*          Physical Maximum (60),          */
92462306a36Sopenharmony_ci	0x15, 0xC3,         /*          Logical Minimum (-61),          */
92562306a36Sopenharmony_ci	0x25, 0x3C,         /*          Logical Maximum (60),           */
92662306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),                */
92762306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),               */
92862306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
92962306a36Sopenharmony_ci	0x09, 0x3e,         /*          Usage (Y Tilt),                 */
93062306a36Sopenharmony_ci	0x35, 0xC3,         /*          Physical Minimum (-61),         */
93162306a36Sopenharmony_ci	0x45, 0x3C,         /*          Physical Maximum (60),          */
93262306a36Sopenharmony_ci	0x15, 0xC3,         /*          Logical Minimum (-61),          */
93362306a36Sopenharmony_ci	0x25, 0x3C,         /*          Logical Maximum (60),           */
93462306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
93562306a36Sopenharmony_ci	0xc0,               /*      End Collection,                     */
93662306a36Sopenharmony_ci	0xc0,               /*  End Collection                          */
93762306a36Sopenharmony_ci};
93862306a36Sopenharmony_ciconst size_t uclogic_rdesc_ugee_v2_pen_template_size =
93962306a36Sopenharmony_ci			sizeof(uclogic_rdesc_ugee_v2_pen_template_arr);
94062306a36Sopenharmony_ci
94162306a36Sopenharmony_ci/* Fixed report descriptor template for UGEE v2 frame reports (buttons only) */
94262306a36Sopenharmony_ciconst __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[] = {
94362306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),                   */
94462306a36Sopenharmony_ci	0x09, 0x07,         /*  Usage (Keypad),                         */
94562306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),               */
94662306a36Sopenharmony_ci	0x85, UCLOGIC_RDESC_V1_FRAME_ID,
94762306a36Sopenharmony_ci			    /*      Report ID,                          */
94862306a36Sopenharmony_ci	0x05, 0x0D,         /*      Usage Page (Digitizer),             */
94962306a36Sopenharmony_ci	0x09, 0x39,         /*      Usage (Tablet Function Keys),       */
95062306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),              */
95162306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),                */
95262306a36Sopenharmony_ci	0x95, 0x08,         /*          Report Count (8),               */
95362306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
95462306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),            */
95562306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),            */
95662306a36Sopenharmony_ci	UCLOGIC_RDESC_FRAME_PH_BTN,
95762306a36Sopenharmony_ci			    /*          Usage Maximum (PLACEHOLDER),    */
95862306a36Sopenharmony_ci	0x95, 0x0A,         /*          Report Count (10),              */
95962306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),            */
96062306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),            */
96162306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
96262306a36Sopenharmony_ci	0x95, 0x46,         /*          Report Count (70),              */
96362306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
96462306a36Sopenharmony_ci	0xC0,               /*      End Collection,                     */
96562306a36Sopenharmony_ci	0xC0                /*  End Collection                          */
96662306a36Sopenharmony_ci};
96762306a36Sopenharmony_ciconst size_t uclogic_rdesc_ugee_v2_frame_btn_template_size =
96862306a36Sopenharmony_ci			sizeof(uclogic_rdesc_ugee_v2_frame_btn_template_arr);
96962306a36Sopenharmony_ci
97062306a36Sopenharmony_ci/* Fixed report descriptor template for UGEE v2 frame reports (dial) */
97162306a36Sopenharmony_ciconst __u8 uclogic_rdesc_ugee_v2_frame_dial_template_arr[] = {
97262306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),                   */
97362306a36Sopenharmony_ci	0x09, 0x07,         /*  Usage (Keypad),                         */
97462306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),               */
97562306a36Sopenharmony_ci	0x85, UCLOGIC_RDESC_V1_FRAME_ID,
97662306a36Sopenharmony_ci			    /*      Report ID,                          */
97762306a36Sopenharmony_ci	0x05, 0x0D,         /*      Usage Page (Digitizer),             */
97862306a36Sopenharmony_ci	0x09, 0x39,         /*      Usage (Tablet Function Keys),       */
97962306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),              */
98062306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),                */
98162306a36Sopenharmony_ci	0x95, 0x08,         /*          Report Count (8),               */
98262306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
98362306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),            */
98462306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),            */
98562306a36Sopenharmony_ci	UCLOGIC_RDESC_FRAME_PH_BTN,
98662306a36Sopenharmony_ci			    /*          Usage Maximum (PLACEHOLDER),    */
98762306a36Sopenharmony_ci	0x95, 0x0A,         /*          Report Count (10),              */
98862306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),            */
98962306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),            */
99062306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
99162306a36Sopenharmony_ci	0x95, 0x06,         /*          Report Count (6),               */
99262306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
99362306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),                */
99462306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),               */
99562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
99662306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),           */
99762306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),                  */
99862306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),               */
99962306a36Sopenharmony_ci	0x15, 0xFF,         /*          Logical Minimum (-1),           */
100062306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),            */
100162306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative),     */
100262306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),               */
100362306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
100462306a36Sopenharmony_ci	0xC0,               /*      End Collection,                     */
100562306a36Sopenharmony_ci	0xC0                /*  End Collection                          */
100662306a36Sopenharmony_ci};
100762306a36Sopenharmony_ciconst size_t uclogic_rdesc_ugee_v2_frame_dial_template_size =
100862306a36Sopenharmony_ci			sizeof(uclogic_rdesc_ugee_v2_frame_dial_template_arr);
100962306a36Sopenharmony_ci
101062306a36Sopenharmony_ci/* Fixed report descriptor template for UGEE v2 frame reports (mouse) */
101162306a36Sopenharmony_ciconst __u8 uclogic_rdesc_ugee_v2_frame_mouse_template_arr[] = {
101262306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),                   */
101362306a36Sopenharmony_ci	0x09, 0x02,         /*  Usage (Mouse),                          */
101462306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),               */
101562306a36Sopenharmony_ci	0x85, 0x01,         /*      Report ID (1),                      */
101662306a36Sopenharmony_ci	0x05, 0x01,         /*      Usage Page (Pointer),               */
101762306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),              */
101862306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),                */
101962306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),               */
102062306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),            */
102162306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),            */
102262306a36Sopenharmony_ci	0x29, 0x02,         /*          Usage Maximum (02h),            */
102362306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),            */
102462306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),            */
102562306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),               */
102662306a36Sopenharmony_ci	0x95, 0x06,         /*          Report Count (6),               */
102762306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
102862306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Generic Desktop),   */
102962306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                      */
103062306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                      */
103162306a36Sopenharmony_ci	0x75, 0x10,         /*          Report Size (16),               */
103262306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),               */
103362306a36Sopenharmony_ci	0x16, 0x00, 0x80,   /*          Logical Minimum (-32768),       */
103462306a36Sopenharmony_ci	0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),        */
103562306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative),     */
103662306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),               */
103762306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),               */
103862306a36Sopenharmony_ci	0xC0,               /*      End Collection,                     */
103962306a36Sopenharmony_ci	0xC0                /*  End Collection                          */
104062306a36Sopenharmony_ci};
104162306a36Sopenharmony_ciconst size_t uclogic_rdesc_ugee_v2_frame_mouse_template_size =
104262306a36Sopenharmony_ci			sizeof(uclogic_rdesc_ugee_v2_frame_mouse_template_arr);
104362306a36Sopenharmony_ci
104462306a36Sopenharmony_ci/* Fixed report descriptor template for UGEE v2 battery reports */
104562306a36Sopenharmony_ciconst __u8 uclogic_rdesc_ugee_v2_battery_template_arr[] = {
104662306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),                   */
104762306a36Sopenharmony_ci	0x09, 0x07,         /*  Usage (Keypad),                         */
104862306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),               */
104962306a36Sopenharmony_ci	0x85, UCLOGIC_RDESC_UGEE_V2_BATTERY_ID,
105062306a36Sopenharmony_ci			    /*      Report ID,                          */
105162306a36Sopenharmony_ci	0x75, 0x08,         /*      Report Size (8),                    */
105262306a36Sopenharmony_ci	0x95, 0x02,         /*      Report Count (2),                   */
105362306a36Sopenharmony_ci	0x81, 0x01,         /*      Input (Constant),                   */
105462306a36Sopenharmony_ci	0x05, 0x84,         /*      Usage Page (Power Device),          */
105562306a36Sopenharmony_ci	0x05, 0x85,         /*      Usage Page (Battery System),        */
105662306a36Sopenharmony_ci	0x09, 0x65,         /*      Usage Page (AbsoluteStateOfCharge), */
105762306a36Sopenharmony_ci	0x75, 0x08,         /*      Report Size (8),                    */
105862306a36Sopenharmony_ci	0x95, 0x01,         /*      Report Count (1),                   */
105962306a36Sopenharmony_ci	0x15, 0x00,         /*      Logical Minimum (0),                */
106062306a36Sopenharmony_ci	0x26, 0xff, 0x00,   /*      Logical Maximum (255),              */
106162306a36Sopenharmony_ci	0x81, 0x02,         /*      Input (Variable),                   */
106262306a36Sopenharmony_ci	0x75, 0x01,         /*      Report Size (1),                    */
106362306a36Sopenharmony_ci	0x95, 0x01,         /*      Report Count (1),                   */
106462306a36Sopenharmony_ci	0x15, 0x00,         /*      Logical Minimum (0),                */
106562306a36Sopenharmony_ci	0x25, 0x01,         /*      Logical Maximum (1),                */
106662306a36Sopenharmony_ci	0x09, 0x44,         /*      Usage Page (Charging),              */
106762306a36Sopenharmony_ci	0x81, 0x02,         /*      Input (Variable),                   */
106862306a36Sopenharmony_ci	0x95, 0x07,         /*      Report Count (7),                   */
106962306a36Sopenharmony_ci	0x81, 0x01,         /*      Input (Constant),                   */
107062306a36Sopenharmony_ci	0x75, 0x08,         /*      Report Size (8),                    */
107162306a36Sopenharmony_ci	0x95, 0x07,         /*      Report Count (7),                   */
107262306a36Sopenharmony_ci	0x81, 0x01,         /*      Input (Constant),                   */
107362306a36Sopenharmony_ci	0xC0                /*  End Collection                          */
107462306a36Sopenharmony_ci};
107562306a36Sopenharmony_ciconst size_t uclogic_rdesc_ugee_v2_battery_template_size =
107662306a36Sopenharmony_ci			sizeof(uclogic_rdesc_ugee_v2_battery_template_arr);
107762306a36Sopenharmony_ci
107862306a36Sopenharmony_ci/* Fixed report descriptor for Ugee EX07 frame */
107962306a36Sopenharmony_ciconst __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
108062306a36Sopenharmony_ci	0x05, 0x01,             /*  Usage Page (Desktop),                   */
108162306a36Sopenharmony_ci	0x09, 0x07,             /*  Usage (Keypad),                         */
108262306a36Sopenharmony_ci	0xA1, 0x01,             /*  Collection (Application),               */
108362306a36Sopenharmony_ci	0x85, 0x06,             /*      Report ID (6),                      */
108462306a36Sopenharmony_ci	0x05, 0x0D,             /*      Usage Page (Digitizer),             */
108562306a36Sopenharmony_ci	0x09, 0x39,             /*      Usage (Tablet Function Keys),       */
108662306a36Sopenharmony_ci	0xA0,                   /*      Collection (Physical),              */
108762306a36Sopenharmony_ci	0x05, 0x09,             /*          Usage Page (Button),            */
108862306a36Sopenharmony_ci	0x75, 0x01,             /*          Report Size (1),                */
108962306a36Sopenharmony_ci	0x19, 0x03,             /*          Usage Minimum (03h),            */
109062306a36Sopenharmony_ci	0x29, 0x06,             /*          Usage Maximum (06h),            */
109162306a36Sopenharmony_ci	0x95, 0x04,             /*          Report Count (4),               */
109262306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
109362306a36Sopenharmony_ci	0x95, 0x1A,             /*          Report Count (26),              */
109462306a36Sopenharmony_ci	0x81, 0x03,             /*          Input (Constant, Variable),     */
109562306a36Sopenharmony_ci	0x19, 0x01,             /*          Usage Minimum (01h),            */
109662306a36Sopenharmony_ci	0x29, 0x02,             /*          Usage Maximum (02h),            */
109762306a36Sopenharmony_ci	0x95, 0x02,             /*          Report Count (2),               */
109862306a36Sopenharmony_ci	0x81, 0x02,             /*          Input (Variable),               */
109962306a36Sopenharmony_ci	0xC0,                   /*      End Collection,                     */
110062306a36Sopenharmony_ci	0xC0                    /*  End Collection                          */
110162306a36Sopenharmony_ci};
110262306a36Sopenharmony_ciconst size_t uclogic_rdesc_ugee_ex07_frame_size =
110362306a36Sopenharmony_ci			sizeof(uclogic_rdesc_ugee_ex07_frame_arr);
110462306a36Sopenharmony_ci
110562306a36Sopenharmony_ci/* Fixed report descriptor for Ugee G5 frame controls */
110662306a36Sopenharmony_ciconst __u8 uclogic_rdesc_ugee_g5_frame_arr[] = {
110762306a36Sopenharmony_ci	0x05, 0x01,         /*  Usage Page (Desktop),               */
110862306a36Sopenharmony_ci	0x09, 0x07,         /*  Usage (Keypad),                     */
110962306a36Sopenharmony_ci	0xA1, 0x01,         /*  Collection (Application),           */
111062306a36Sopenharmony_ci	0x85, 0x06,         /*      Report ID (6),                  */
111162306a36Sopenharmony_ci	0x05, 0x0D,         /*      Usage Page (Digitizer),         */
111262306a36Sopenharmony_ci	0x09, 0x39,         /*      Usage (Tablet Function Keys),   */
111362306a36Sopenharmony_ci	0xA0,               /*      Collection (Physical),          */
111462306a36Sopenharmony_ci	0x14,               /*          Logical Minimum (0),        */
111562306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
111662306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
111762306a36Sopenharmony_ci	0x05, 0x09,         /*          Usage Page (Button),        */
111862306a36Sopenharmony_ci	0x19, 0x01,         /*          Usage Minimum (01h),        */
111962306a36Sopenharmony_ci	0x29, 0x05,         /*          Usage Maximum (05h),        */
112062306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
112162306a36Sopenharmony_ci	0x95, 0x05,         /*          Report Count (5),           */
112262306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
112362306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
112462306a36Sopenharmony_ci	0x95, 0x03,         /*          Report Count (3),           */
112562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
112662306a36Sopenharmony_ci	0x05, 0x0D,         /*          Usage Page (Digitizer),     */
112762306a36Sopenharmony_ci	0x0A, 0xFF, 0xFF,   /*          Usage (FFFFh),              */
112862306a36Sopenharmony_ci	0x26, 0xFF, 0x00,   /*          Logical Maximum (255),      */
112962306a36Sopenharmony_ci	0x75, 0x08,         /*          Report Size (8),            */
113062306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
113162306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
113262306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
113362306a36Sopenharmony_ci	0x09, 0x44,         /*          Usage (Barrel Switch),      */
113462306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
113562306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
113662306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
113762306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
113862306a36Sopenharmony_ci	0x09, 0x30,         /*          Usage (X),                  */
113962306a36Sopenharmony_ci	0x09, 0x31,         /*          Usage (Y),                  */
114062306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
114162306a36Sopenharmony_ci	0x95, 0x02,         /*          Report Count (2),           */
114262306a36Sopenharmony_ci	0x81, 0x02,         /*          Input (Variable),           */
114362306a36Sopenharmony_ci	0x75, 0x01,         /*          Report Size (1),            */
114462306a36Sopenharmony_ci	0x95, 0x0B,         /*          Report Count (11),          */
114562306a36Sopenharmony_ci	0x81, 0x01,         /*          Input (Constant),           */
114662306a36Sopenharmony_ci	0x05, 0x01,         /*          Usage Page (Desktop),       */
114762306a36Sopenharmony_ci	0x09, 0x38,         /*          Usage (Wheel),              */
114862306a36Sopenharmony_ci	0x15, 0xFF,         /*          Logical Minimum (-1),       */
114962306a36Sopenharmony_ci	0x25, 0x01,         /*          Logical Maximum (1),        */
115062306a36Sopenharmony_ci	0x75, 0x02,         /*          Report Size (2),            */
115162306a36Sopenharmony_ci	0x95, 0x01,         /*          Report Count (1),           */
115262306a36Sopenharmony_ci	0x81, 0x06,         /*          Input (Variable, Relative), */
115362306a36Sopenharmony_ci	0xC0,               /*      End Collection,                 */
115462306a36Sopenharmony_ci	0xC0                /*  End Collection                      */
115562306a36Sopenharmony_ci};
115662306a36Sopenharmony_ciconst size_t uclogic_rdesc_ugee_g5_frame_size =
115762306a36Sopenharmony_ci			sizeof(uclogic_rdesc_ugee_g5_frame_arr);
115862306a36Sopenharmony_ci
115962306a36Sopenharmony_ci/* Fixed report descriptor for XP-Pen Deco 01 frame controls */
116062306a36Sopenharmony_ciconst __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
116162306a36Sopenharmony_ci	0x05, 0x01, /*  Usage Page (Desktop),               */
116262306a36Sopenharmony_ci	0x09, 0x07, /*  Usage (Keypad),                     */
116362306a36Sopenharmony_ci	0xA1, 0x01, /*  Collection (Application),           */
116462306a36Sopenharmony_ci	0x85, 0x06, /*      Report ID (6),                  */
116562306a36Sopenharmony_ci	0x14,       /*      Logical Minimum (0),            */
116662306a36Sopenharmony_ci	0x25, 0x01, /*      Logical Maximum (1),            */
116762306a36Sopenharmony_ci	0x75, 0x01, /*      Report Size (1),                */
116862306a36Sopenharmony_ci	0x05, 0x0D, /*      Usage Page (Digitizer),         */
116962306a36Sopenharmony_ci	0x09, 0x39, /*      Usage (Tablet Function Keys),   */
117062306a36Sopenharmony_ci	0xA0,       /*      Collection (Physical),          */
117162306a36Sopenharmony_ci	0x05, 0x09, /*          Usage Page (Button),        */
117262306a36Sopenharmony_ci	0x19, 0x01, /*          Usage Minimum (01h),        */
117362306a36Sopenharmony_ci	0x29, 0x08, /*          Usage Maximum (08h),        */
117462306a36Sopenharmony_ci	0x95, 0x08, /*          Report Count (8),           */
117562306a36Sopenharmony_ci	0x81, 0x02, /*          Input (Variable),           */
117662306a36Sopenharmony_ci	0x05, 0x0D, /*          Usage Page (Digitizer),     */
117762306a36Sopenharmony_ci	0x09, 0x44, /*          Usage (Barrel Switch),      */
117862306a36Sopenharmony_ci	0x95, 0x01, /*          Report Count (1),           */
117962306a36Sopenharmony_ci	0x81, 0x02, /*          Input (Variable),           */
118062306a36Sopenharmony_ci	0x05, 0x01, /*          Usage Page (Desktop),       */
118162306a36Sopenharmony_ci	0x09, 0x30, /*          Usage (X),                  */
118262306a36Sopenharmony_ci	0x09, 0x31, /*          Usage (Y),                  */
118362306a36Sopenharmony_ci	0x95, 0x02, /*          Report Count (2),           */
118462306a36Sopenharmony_ci	0x81, 0x02, /*          Input (Variable),           */
118562306a36Sopenharmony_ci	0x95, 0x15, /*          Report Count (21),          */
118662306a36Sopenharmony_ci	0x81, 0x01, /*          Input (Constant),           */
118762306a36Sopenharmony_ci	0xC0,       /*      End Collection,                 */
118862306a36Sopenharmony_ci	0xC0        /*  End Collection                      */
118962306a36Sopenharmony_ci};
119062306a36Sopenharmony_ci
119162306a36Sopenharmony_ciconst size_t uclogic_rdesc_xppen_deco01_frame_size =
119262306a36Sopenharmony_ci			sizeof(uclogic_rdesc_xppen_deco01_frame_arr);
119362306a36Sopenharmony_ci
119462306a36Sopenharmony_ci/**
119562306a36Sopenharmony_ci * uclogic_rdesc_template_apply() - apply report descriptor parameters to a
119662306a36Sopenharmony_ci * report descriptor template, creating a report descriptor. Copies the
119762306a36Sopenharmony_ci * template over to the new report descriptor and replaces every occurrence of
119862306a36Sopenharmony_ci * the template placeholders, followed by an index byte, with the value from the
119962306a36Sopenharmony_ci * parameter list at that index.
120062306a36Sopenharmony_ci *
120162306a36Sopenharmony_ci * @template_ptr:	Pointer to the template buffer.
120262306a36Sopenharmony_ci * @template_size:	Size of the template buffer.
120362306a36Sopenharmony_ci * @param_list:		List of template parameters.
120462306a36Sopenharmony_ci * @param_num:		Number of parameters in the list.
120562306a36Sopenharmony_ci *
120662306a36Sopenharmony_ci * Returns:
120762306a36Sopenharmony_ci *	Kmalloc-allocated pointer to the created report descriptor,
120862306a36Sopenharmony_ci *	or NULL if allocation failed.
120962306a36Sopenharmony_ci */
121062306a36Sopenharmony_ci__u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
121162306a36Sopenharmony_ci				   size_t template_size,
121262306a36Sopenharmony_ci				   const s32 *param_list,
121362306a36Sopenharmony_ci				   size_t param_num)
121462306a36Sopenharmony_ci{
121562306a36Sopenharmony_ci	static const __u8 btn_head[] = {UCLOGIC_RDESC_FRAME_PH_BTN_HEAD};
121662306a36Sopenharmony_ci	static const __u8 pen_head[] = {UCLOGIC_RDESC_PEN_PH_HEAD};
121762306a36Sopenharmony_ci	__u8 *rdesc_ptr;
121862306a36Sopenharmony_ci	__u8 *p;
121962306a36Sopenharmony_ci	s32 v;
122062306a36Sopenharmony_ci
122162306a36Sopenharmony_ci	rdesc_ptr = kmemdup(template_ptr, template_size, GFP_KERNEL);
122262306a36Sopenharmony_ci	if (rdesc_ptr == NULL)
122362306a36Sopenharmony_ci		return NULL;
122462306a36Sopenharmony_ci
122562306a36Sopenharmony_ci	for (p = rdesc_ptr; p + sizeof(btn_head) < rdesc_ptr + template_size;) {
122662306a36Sopenharmony_ci		if (p + sizeof(pen_head) < rdesc_ptr + template_size &&
122762306a36Sopenharmony_ci		    memcmp(p, pen_head, sizeof(pen_head)) == 0 &&
122862306a36Sopenharmony_ci		    p[sizeof(pen_head)] < param_num) {
122962306a36Sopenharmony_ci			v = param_list[p[sizeof(pen_head)]];
123062306a36Sopenharmony_ci			put_unaligned((__force u32)cpu_to_le32(v), (s32 *)p);
123162306a36Sopenharmony_ci			p += sizeof(pen_head) + 1;
123262306a36Sopenharmony_ci		} else if (memcmp(p, btn_head, sizeof(btn_head)) == 0 &&
123362306a36Sopenharmony_ci			   p[sizeof(btn_head)] < param_num) {
123462306a36Sopenharmony_ci			v = param_list[p[sizeof(btn_head)]];
123562306a36Sopenharmony_ci			put_unaligned((__u8)0x2A, p); /* Usage Maximum */
123662306a36Sopenharmony_ci			put_unaligned((__force u16)cpu_to_le16(v), (s16 *)(p + 1));
123762306a36Sopenharmony_ci			p += sizeof(btn_head) + 1;
123862306a36Sopenharmony_ci		} else {
123962306a36Sopenharmony_ci			p++;
124062306a36Sopenharmony_ci		}
124162306a36Sopenharmony_ci	}
124262306a36Sopenharmony_ci
124362306a36Sopenharmony_ci	return rdesc_ptr;
124462306a36Sopenharmony_ci}
1245