diff options
author | Nikolai Kondrashov <spbnick@gmail.com> | 2022-03-03 08:47:34 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2022-04-11 16:51:52 +0200 |
commit | c3e6e59af2a0c7937815808804eb4d9ddc9df9be (patch) | |
tree | 984ddec0364526b9999ed908eaf98009bc5d33b2 /drivers/hid/hid-uclogic-params.c | |
parent | HID: uclogic: Allow three frame parameter sets (diff) | |
download | linux-c3e6e59af2a0c7937815808804eb4d9ddc9df9be.tar.xz linux-c3e6e59af2a0c7937815808804eb4d9ddc9df9be.zip |
HID: uclogic: Add support for Huion touch ring reports
Support touch ring reports found in Huion HS610 to the UC-Logic driver.
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-uclogic-params.c')
-rw-r--r-- | drivers/hid/hid-uclogic-params.c | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c index 5f50ceb875d6..3ac45e7572a0 100644 --- a/drivers/hid/hid-uclogic-params.c +++ b/drivers/hid/hid-uclogic-params.c @@ -745,22 +745,48 @@ static int uclogic_params_huion_init(struct uclogic_params *params, goto cleanup; } else if (found) { hid_dbg(hdev, "pen v2 parameters found\n"); - /* Create v2 frame parameters */ + /* Create v2 frame button parameters */ rc = uclogic_params_frame_init_with_desc( &p.frame_list[0], - uclogic_rdesc_v2_frame_arr, - uclogic_rdesc_v2_frame_size, - UCLOGIC_RDESC_V2_FRAME_ID); + uclogic_rdesc_v2_frame_buttons_arr, + uclogic_rdesc_v2_frame_buttons_size, + UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID); if (rc != 0) { hid_err(hdev, - "failed creating v2 frame parameters: %d\n", + "failed creating v2 frame button parameters: %d\n", rc); goto cleanup; } - /* Link frame button subreports from pen reports */ + + /* Create v2 frame touch ring parameters */ + rc = uclogic_params_frame_init_with_desc( + &p.frame_list[1], + uclogic_rdesc_v2_frame_touch_ring_arr, + uclogic_rdesc_v2_frame_touch_ring_size, + UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID); + if (rc != 0) { + hid_err(hdev, + "failed creating v2 frame touch ring parameters: %d\n", + rc); + goto cleanup; + } + p.frame_list[1].suffix = "Touch Ring"; + p.frame_list[1].dev_id_byte = + UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_DEV_ID_BYTE; + p.frame_list[1].touch_ring_byte = 5; + p.frame_list[1].touch_ring_max = 12; + p.frame_list[1].touch_ring_flip_at = 6; + + /* + * Link button and touch ring subreports from pen + * reports + */ p.pen.subreport_list[0].value = 0xe0; p.pen.subreport_list[0].id = - UCLOGIC_RDESC_V2_FRAME_ID; + UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID; + p.pen.subreport_list[1].value = 0xf0; + p.pen.subreport_list[1].id = + UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID; goto output; } hid_dbg(hdev, "pen v2 parameters not found\n"); |