Lines Matching +full:input +full:- +full:only

1 // SPDX-License-Identifier: GPL-2.0-only
7 * presumably this driver will work for all of them. But it has only been
10 * These tablets also work without a special HID driver, but then only part
12 * to special key-combos. E.g. the 2 stylus buttons send right mouse clicks /
19 * This interface sends raw event input reports in a custom format, but only
25 * but only for some part of the active area due to special "aspect ratio"
26 * correction and only half by default since it assumes it will be used
31 * This interfaces send various hard-coded key-combos for the pad buttons
35 * This reports right-click mouse-button events for the 1st stylus button
38 #include <linux/input.h>
46 #include "hid-ids.h"
71 return hid_hw_open(data->hdev); in letsketch_open()
78 hid_hw_close(data->hdev); in letsketch_close()
83 struct input_dev *input; in letsketch_alloc_input_dev() local
85 input = devm_input_allocate_device(&data->hdev->dev); in letsketch_alloc_input_dev()
86 if (!input) in letsketch_alloc_input_dev()
89 input->id.bustype = data->hdev->bus; in letsketch_alloc_input_dev()
90 input->id.vendor = data->hdev->vendor; in letsketch_alloc_input_dev()
91 input->id.product = data->hdev->product; in letsketch_alloc_input_dev()
92 input->id.version = data->hdev->bus; in letsketch_alloc_input_dev()
93 input->phys = data->hdev->phys; in letsketch_alloc_input_dev()
94 input->uniq = data->hdev->uniq; in letsketch_alloc_input_dev()
95 input->open = letsketch_open; in letsketch_alloc_input_dev()
96 input->close = letsketch_close; in letsketch_alloc_input_dev()
98 input_set_drvdata(input, data); in letsketch_alloc_input_dev()
100 return input; in letsketch_alloc_input_dev()
105 struct input_dev *input; in letsketch_setup_input_tablet() local
107 input = letsketch_alloc_input_dev(data); in letsketch_setup_input_tablet()
108 if (!input) in letsketch_setup_input_tablet()
109 return -ENOMEM; in letsketch_setup_input_tablet()
111 input_set_abs_params(input, ABS_X, 0, 50800, 0, 0); in letsketch_setup_input_tablet()
112 input_set_abs_params(input, ABS_Y, 0, 31750, 0, 0); in letsketch_setup_input_tablet()
113 input_set_abs_params(input, ABS_PRESSURE, 0, 8192, 0, 0); in letsketch_setup_input_tablet()
114 input_abs_set_res(input, ABS_X, 240); in letsketch_setup_input_tablet()
115 input_abs_set_res(input, ABS_Y, 225); in letsketch_setup_input_tablet()
116 input_set_capability(input, EV_KEY, BTN_TOUCH); in letsketch_setup_input_tablet()
117 input_set_capability(input, EV_KEY, BTN_TOOL_PEN); in letsketch_setup_input_tablet()
118 input_set_capability(input, EV_KEY, BTN_STYLUS); in letsketch_setup_input_tablet()
119 input_set_capability(input, EV_KEY, BTN_STYLUS2); in letsketch_setup_input_tablet()
122 input->name = "WP9620 Tablet"; in letsketch_setup_input_tablet()
124 data->input_tablet = input; in letsketch_setup_input_tablet()
126 return input_register_device(data->input_tablet); in letsketch_setup_input_tablet()
131 struct input_dev *input; in letsketch_setup_input_tablet_pad() local
134 input = letsketch_alloc_input_dev(data); in letsketch_setup_input_tablet_pad()
135 if (!input) in letsketch_setup_input_tablet_pad()
136 return -ENOMEM; in letsketch_setup_input_tablet_pad()
139 input_set_capability(input, EV_KEY, BTN_0 + i); in letsketch_setup_input_tablet_pad()
145 input_set_abs_params(input, ABS_X, 0, 1, 0, 0); in letsketch_setup_input_tablet_pad()
146 input_set_abs_params(input, ABS_Y, 0, 1, 0, 0); in letsketch_setup_input_tablet_pad()
147 input_set_capability(input, EV_KEY, BTN_STYLUS); in letsketch_setup_input_tablet_pad()
149 input->name = "WP9620 Pad"; in letsketch_setup_input_tablet_pad()
151 data->input_tablet_pad = input; in letsketch_setup_input_tablet_pad()
153 return input_register_device(data->input_tablet_pad); in letsketch_setup_input_tablet_pad()
159 struct input_dev *input = data->input_tablet; in letsketch_inrange_timeout() local
161 input_report_key(input, BTN_TOOL_PEN, 0); in letsketch_inrange_timeout()
162 input_sync(input); in letsketch_inrange_timeout()
170 struct input_dev *input; in letsketch_raw_event() local
178 input = data->input_tablet; in letsketch_raw_event()
179 input_report_key(input, BTN_TOOL_PEN, 1); in letsketch_raw_event()
180 input_report_key(input, BTN_TOUCH, raw_data[1] & 0x01); in letsketch_raw_event()
181 input_report_key(input, BTN_STYLUS, raw_data[1] & 0x02); in letsketch_raw_event()
182 input_report_key(input, BTN_STYLUS2, raw_data[1] & 0x04); in letsketch_raw_event()
183 input_report_abs(input, ABS_X, in letsketch_raw_event()
185 input_report_abs(input, ABS_Y, in letsketch_raw_event()
187 input_report_abs(input, ABS_PRESSURE, in letsketch_raw_event()
193 mod_timer(&data->inrange_timer, jiffies + msecs_to_jiffies(100)); in letsketch_raw_event()
196 input = data->input_tablet_pad; in letsketch_raw_event()
198 input_report_key(input, BTN_0 + i, raw_data[4] == (i + 1)); in letsketch_raw_event()
201 hid_warn(data->hdev, "Warning unknown data header: 0x%02x\n", in letsketch_raw_event()
206 input_sync(input); in letsketch_raw_event()
227 dev_err(&udev->dev, "Max retries (%d) exceeded reading string descriptor %d\n", in letsketch_get_string()
229 return ret ? ret : -EIO; in letsketch_get_string()
234 struct device *dev = &hdev->dev; in letsketch_probe()
242 return -ENODEV; in letsketch_probe()
244 intf = to_usb_interface(hdev->dev.parent); in letsketch_probe()
245 if (intf->altsetting->desc.bInterfaceNumber != LETSKETCH_RAW_IF) in letsketch_probe()
246 return -ENODEV; /* Ignore the other interfaces */ in letsketch_probe()
251 * Instead of using a set-feature request, or even a custom USB ctrl in letsketch_probe()
290 return -ENOMEM; in letsketch_probe()
292 data->hdev = hdev; in letsketch_probe()
293 timer_setup(&data->inrange_timer, letsketch_inrange_timeout, 0); in letsketch_probe()