Commit a985de58 authored by Nikolai Kondrashov's avatar Nikolai Kondrashov Committed by Jiri Kosina

HID: uclogic: Put version first in rdesc namespace

Put general hardware version before everything else in uclogic_rdesc_
namespace.
Signed-off-by: default avatarNikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 2e28f3e0
...@@ -207,8 +207,8 @@ static int uclogic_params_pen_init_v1(struct uclogic_params_pen *pen, ...@@ -207,8 +207,8 @@ static int uclogic_params_pen_init_v1(struct uclogic_params_pen *pen,
* Generate pen report descriptor * Generate pen report descriptor
*/ */
desc_ptr = uclogic_rdesc_template_apply( desc_ptr = uclogic_rdesc_template_apply(
uclogic_rdesc_pen_v1_template_arr, uclogic_rdesc_v1_pen_template_arr,
uclogic_rdesc_pen_v1_template_size, uclogic_rdesc_v1_pen_template_size,
desc_params, ARRAY_SIZE(desc_params)); desc_params, ARRAY_SIZE(desc_params));
if (desc_ptr == NULL) { if (desc_ptr == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
...@@ -221,8 +221,8 @@ static int uclogic_params_pen_init_v1(struct uclogic_params_pen *pen, ...@@ -221,8 +221,8 @@ static int uclogic_params_pen_init_v1(struct uclogic_params_pen *pen,
memset(pen, 0, sizeof(*pen)); memset(pen, 0, sizeof(*pen));
pen->desc_ptr = desc_ptr; pen->desc_ptr = desc_ptr;
desc_ptr = NULL; desc_ptr = NULL;
pen->desc_size = uclogic_rdesc_pen_v1_template_size; pen->desc_size = uclogic_rdesc_v1_pen_template_size;
pen->id = UCLOGIC_RDESC_PEN_V1_ID; pen->id = UCLOGIC_RDESC_V1_PEN_ID;
pen->inrange = UCLOGIC_PARAMS_PEN_INRANGE_INVERTED; pen->inrange = UCLOGIC_PARAMS_PEN_INRANGE_INVERTED;
found = true; found = true;
finish: finish:
...@@ -351,8 +351,8 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen, ...@@ -351,8 +351,8 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen,
* Generate pen report descriptor * Generate pen report descriptor
*/ */
desc_ptr = uclogic_rdesc_template_apply( desc_ptr = uclogic_rdesc_template_apply(
uclogic_rdesc_pen_v2_template_arr, uclogic_rdesc_v2_pen_template_arr,
uclogic_rdesc_pen_v2_template_size, uclogic_rdesc_v2_pen_template_size,
desc_params, ARRAY_SIZE(desc_params)); desc_params, ARRAY_SIZE(desc_params));
if (desc_ptr == NULL) { if (desc_ptr == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
...@@ -365,8 +365,8 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen, ...@@ -365,8 +365,8 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen,
memset(pen, 0, sizeof(*pen)); memset(pen, 0, sizeof(*pen));
pen->desc_ptr = desc_ptr; pen->desc_ptr = desc_ptr;
desc_ptr = NULL; desc_ptr = NULL;
pen->desc_size = uclogic_rdesc_pen_v2_template_size; pen->desc_size = uclogic_rdesc_v2_pen_template_size;
pen->id = UCLOGIC_RDESC_PEN_V2_ID; pen->id = UCLOGIC_RDESC_V2_PEN_ID;
pen->inrange = UCLOGIC_PARAMS_PEN_INRANGE_NONE; pen->inrange = UCLOGIC_PARAMS_PEN_INRANGE_NONE;
pen->fragmented_hires = true; pen->fragmented_hires = true;
pen->tilt_y_flipped = true; pen->tilt_y_flipped = true;
...@@ -487,9 +487,9 @@ static int uclogic_params_frame_init_v1(struct uclogic_params_frame *frame, ...@@ -487,9 +487,9 @@ static int uclogic_params_frame_init_v1(struct uclogic_params_frame *frame,
hid_dbg(hdev, "generic buttons enabled\n"); hid_dbg(hdev, "generic buttons enabled\n");
rc = uclogic_params_frame_init_with_desc( rc = uclogic_params_frame_init_with_desc(
frame, frame,
uclogic_rdesc_frame_v1_arr, uclogic_rdesc_v1_frame_arr,
uclogic_rdesc_frame_v1_size, uclogic_rdesc_v1_frame_size,
UCLOGIC_RDESC_FRAME_V1_ID); UCLOGIC_RDESC_V1_FRAME_ID);
if (rc != 0) if (rc != 0)
goto cleanup; goto cleanup;
found = true; found = true;
...@@ -752,9 +752,9 @@ static int uclogic_params_huion_init(struct uclogic_params *params, ...@@ -752,9 +752,9 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
/* Create v2 frame parameters */ /* Create v2 frame parameters */
rc = uclogic_params_frame_init_with_desc( rc = uclogic_params_frame_init_with_desc(
&p.frame, &p.frame,
uclogic_rdesc_frame_v2_arr, uclogic_rdesc_v2_frame_arr,
uclogic_rdesc_frame_v2_size, uclogic_rdesc_v2_frame_size,
UCLOGIC_RDESC_FRAME_V2_ID); UCLOGIC_RDESC_V2_FRAME_ID);
if (rc != 0) { if (rc != 0) {
hid_err(hdev, hid_err(hdev,
"failed creating v2 frame parameters: %d\n", "failed creating v2 frame parameters: %d\n",
...@@ -764,7 +764,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params, ...@@ -764,7 +764,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
/* Link frame button subreports from pen reports */ /* Link frame button subreports from pen reports */
p.pen.subreport_list[0].value = 0xe0; p.pen.subreport_list[0].value = 0xe0;
p.pen.subreport_list[0].id = p.pen.subreport_list[0].id =
UCLOGIC_RDESC_FRAME_V2_ID; UCLOGIC_RDESC_V2_FRAME_ID;
goto output; goto output;
} }
hid_dbg(hdev, "pen v2 parameters not found\n"); hid_dbg(hdev, "pen v2 parameters not found\n");
...@@ -791,7 +791,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params, ...@@ -791,7 +791,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
/* Link frame button subreports from pen reports */ /* Link frame button subreports from pen reports */
p.pen.subreport_list[0].value = 0xe0; p.pen.subreport_list[0].value = 0xe0;
p.pen.subreport_list[0].id = p.pen.subreport_list[0].id =
UCLOGIC_RDESC_FRAME_V1_ID; UCLOGIC_RDESC_V1_FRAME_ID;
} }
goto output; goto output;
} }
......
...@@ -532,7 +532,7 @@ const size_t uclogic_rdesc_twha60_fixed1_size = ...@@ -532,7 +532,7 @@ const size_t uclogic_rdesc_twha60_fixed1_size =
sizeof(uclogic_rdesc_twha60_fixed1_arr); sizeof(uclogic_rdesc_twha60_fixed1_arr);
/* Fixed report descriptor template for (tweaked) v1 pen reports */ /* Fixed report descriptor template for (tweaked) v1 pen reports */
const __u8 uclogic_rdesc_pen_v1_template_arr[] = { const __u8 uclogic_rdesc_v1_pen_template_arr[] = {
0x05, 0x0D, /* Usage Page (Digitizer), */ 0x05, 0x0D, /* Usage Page (Digitizer), */
0x09, 0x02, /* Usage (Pen), */ 0x09, 0x02, /* Usage (Pen), */
0xA1, 0x01, /* Collection (Application), */ 0xA1, 0x01, /* Collection (Application), */
...@@ -582,11 +582,11 @@ const __u8 uclogic_rdesc_pen_v1_template_arr[] = { ...@@ -582,11 +582,11 @@ const __u8 uclogic_rdesc_pen_v1_template_arr[] = {
0xC0 /* End Collection */ 0xC0 /* End Collection */
}; };
const size_t uclogic_rdesc_pen_v1_template_size = const size_t uclogic_rdesc_v1_pen_template_size =
sizeof(uclogic_rdesc_pen_v1_template_arr); sizeof(uclogic_rdesc_v1_pen_template_arr);
/* Fixed report descriptor template for (tweaked) v2 pen reports */ /* Fixed report descriptor template for (tweaked) v2 pen reports */
const __u8 uclogic_rdesc_pen_v2_template_arr[] = { const __u8 uclogic_rdesc_v2_pen_template_arr[] = {
0x05, 0x0D, /* Usage Page (Digitizer), */ 0x05, 0x0D, /* Usage Page (Digitizer), */
0x09, 0x02, /* Usage (Pen), */ 0x09, 0x02, /* Usage (Pen), */
0xA1, 0x01, /* Collection (Application), */ 0xA1, 0x01, /* Collection (Application), */
...@@ -648,8 +648,8 @@ const __u8 uclogic_rdesc_pen_v2_template_arr[] = { ...@@ -648,8 +648,8 @@ const __u8 uclogic_rdesc_pen_v2_template_arr[] = {
0xC0 /* End Collection */ 0xC0 /* End Collection */
}; };
const size_t uclogic_rdesc_pen_v2_template_size = const size_t uclogic_rdesc_v2_pen_template_size =
sizeof(uclogic_rdesc_pen_v2_template_arr); sizeof(uclogic_rdesc_v2_pen_template_arr);
/* /*
* Expand to the contents of a generic frame report descriptor. * Expand to the contents of a generic frame report descriptor.
...@@ -699,18 +699,18 @@ const size_t uclogic_rdesc_pen_v2_template_size = ...@@ -699,18 +699,18 @@ const size_t uclogic_rdesc_pen_v2_template_size =
0xC0 /* End Collection */ 0xC0 /* End Collection */
/* Fixed report descriptor for (tweaked) v1 frame reports */ /* Fixed report descriptor for (tweaked) v1 frame reports */
const __u8 uclogic_rdesc_frame_v1_arr[] = { const __u8 uclogic_rdesc_v1_frame_arr[] = {
UCLOGIC_RDESC_FRAME_BYTES(UCLOGIC_RDESC_FRAME_V1_ID, 8) UCLOGIC_RDESC_FRAME_BYTES(UCLOGIC_RDESC_V1_FRAME_ID, 8)
}; };
const size_t uclogic_rdesc_frame_v1_size = const size_t uclogic_rdesc_v1_frame_size =
sizeof(uclogic_rdesc_frame_v1_arr); sizeof(uclogic_rdesc_v1_frame_arr);
/* Fixed report descriptor for (tweaked) v2 frame reports */ /* Fixed report descriptor for (tweaked) v2 frame reports */
const __u8 uclogic_rdesc_frame_v2_arr[] = { const __u8 uclogic_rdesc_v2_frame_arr[] = {
UCLOGIC_RDESC_FRAME_BYTES(UCLOGIC_RDESC_FRAME_V2_ID, 12) UCLOGIC_RDESC_FRAME_BYTES(UCLOGIC_RDESC_V2_FRAME_ID, 12)
}; };
const size_t uclogic_rdesc_frame_v2_size = const size_t uclogic_rdesc_v2_frame_size =
sizeof(uclogic_rdesc_frame_v2_arr); sizeof(uclogic_rdesc_v2_frame_arr);
/* Fixed report descriptor for Ugee EX07 frame */ /* Fixed report descriptor for Ugee EX07 frame */
const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = { const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
......
...@@ -104,32 +104,32 @@ enum uclogic_rdesc_pen_ph_id { ...@@ -104,32 +104,32 @@ enum uclogic_rdesc_pen_ph_id {
UCLOGIC_RDESC_PH_HEAD, UCLOGIC_RDESC_PEN_PH_ID_##_ID UCLOGIC_RDESC_PH_HEAD, UCLOGIC_RDESC_PEN_PH_ID_##_ID
/* Report ID for v1 pen reports */ /* Report ID for v1 pen reports */
#define UCLOGIC_RDESC_PEN_V1_ID 0x07 #define UCLOGIC_RDESC_V1_PEN_ID 0x07
/* Fixed report descriptor template for (tweaked) v1 pen reports */ /* Fixed report descriptor template for (tweaked) v1 pen reports */
extern const __u8 uclogic_rdesc_pen_v1_template_arr[]; extern const __u8 uclogic_rdesc_v1_pen_template_arr[];
extern const size_t uclogic_rdesc_pen_v1_template_size; extern const size_t uclogic_rdesc_v1_pen_template_size;
/* Report ID for v2 pen reports */ /* Report ID for v2 pen reports */
#define UCLOGIC_RDESC_PEN_V2_ID 0x08 #define UCLOGIC_RDESC_V2_PEN_ID 0x08
/* Fixed report descriptor template for (tweaked) v2 pen reports */ /* Fixed report descriptor template for (tweaked) v2 pen reports */
extern const __u8 uclogic_rdesc_pen_v2_template_arr[]; extern const __u8 uclogic_rdesc_v2_pen_template_arr[];
extern const size_t uclogic_rdesc_pen_v2_template_size; extern const size_t uclogic_rdesc_v2_pen_template_size;
/* Fixed report descriptor for (tweaked) v1 frame reports */ /* Fixed report descriptor for (tweaked) v1 frame reports */
extern const __u8 uclogic_rdesc_frame_v1_arr[]; extern const __u8 uclogic_rdesc_v1_frame_arr[];
extern const size_t uclogic_rdesc_frame_v1_size; extern const size_t uclogic_rdesc_v1_frame_size;
/* Report ID for tweaked v1 frame reports */ /* Report ID for tweaked v1 frame reports */
#define UCLOGIC_RDESC_FRAME_V1_ID 0xf7 #define UCLOGIC_RDESC_V1_FRAME_ID 0xf7
/* Fixed report descriptor for (tweaked) v2 frame reports */ /* Fixed report descriptor for (tweaked) v2 frame reports */
extern const __u8 uclogic_rdesc_frame_v2_arr[]; extern const __u8 uclogic_rdesc_v2_frame_arr[];
extern const size_t uclogic_rdesc_frame_v2_size; extern const size_t uclogic_rdesc_v2_frame_size;
/* Report ID for tweaked v2 frame reports */ /* Report ID for tweaked v2 frame reports */
#define UCLOGIC_RDESC_FRAME_V2_ID 0xf7 #define UCLOGIC_RDESC_V2_FRAME_ID 0xf7
/* Fixed report descriptor for Ugee EX07 frame */ /* Fixed report descriptor for Ugee EX07 frame */
extern const __u8 uclogic_rdesc_ugee_ex07_frame_arr[]; extern const __u8 uclogic_rdesc_ugee_ex07_frame_arr[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment