提交 fde44ac5 编写于 作者: N Nikolai Kondrashov 提交者: Benjamin Tissoires

HID: uclogic: Support faking Wacom pad device ID

Add support for inserting a Wacom pad device ID into hid-uclogic
reports. This allows reporting dial inputs in a way compatible with the
Wacom driver. Needed for Ugee G5 support in particular.
Signed-off-by: NNikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
上级 08367be1
...@@ -300,6 +300,16 @@ static int uclogic_raw_event(struct hid_device *hdev, ...@@ -300,6 +300,16 @@ static int uclogic_raw_event(struct hid_device *hdev,
} }
} }
/* Tweak frame control reports, if necessary */
if ((report->type == HID_INPUT_REPORT) &&
(report->id == params->frame.id)) {
/* If need to, and can, set pad device ID for Wacom drivers */
if (params->frame.dev_id_byte > 0 &&
params->frame.dev_id_byte < size) {
data[params->frame.dev_id_byte] = 0xf;
}
}
return 0; return 0;
} }
......
...@@ -87,6 +87,13 @@ struct uclogic_params_frame { ...@@ -87,6 +87,13 @@ struct uclogic_params_frame {
* Report ID, if reports should be tweaked, zero if not. * Report ID, if reports should be tweaked, zero if not.
*/ */
unsigned int id; unsigned int id;
/*
* Offset of the Wacom-style device ID byte in the report, to be set
* to pad device ID (0xf), for compatibility with Wacom drivers. Zero
* if no changes to the report should be made. Only valid if "id" is
* not zero.
*/
unsigned int dev_id_byte;
}; };
/* /*
...@@ -161,6 +168,7 @@ extern int uclogic_params_init(struct uclogic_params *params, ...@@ -161,6 +168,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
".frame.desc_ptr = %p\n" \ ".frame.desc_ptr = %p\n" \
".frame.desc_size = %u\n" \ ".frame.desc_size = %u\n" \
".frame.id = %u\n" \ ".frame.id = %u\n" \
".frame.dev_id_byte = %u\n" \
".pen_frame_flag = 0x%02x\n" ".pen_frame_flag = 0x%02x\n"
/* Tablet interface parameters *printf format arguments */ /* Tablet interface parameters *printf format arguments */
...@@ -177,6 +185,7 @@ extern int uclogic_params_init(struct uclogic_params *params, ...@@ -177,6 +185,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
(_params)->frame.desc_ptr, \ (_params)->frame.desc_ptr, \
(_params)->frame.desc_size, \ (_params)->frame.desc_size, \
(_params)->frame.id, \ (_params)->frame.id, \
(_params)->frame.dev_id_byte, \
(_params)->pen_frame_flag (_params)->pen_frame_flag
/* Get a replacement report descriptor for a tablet's interface. */ /* Get a replacement report descriptor for a tablet's interface. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册