Lines Matching +full:tablet +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Driver for the LetSketch / VSON WP9620N drawing tablet.
6 * This drawing tablet is also sold under other brand names such as Case U,
12 * to special key-combos. E.g. the 2 stylus buttons send right mouse clicks /
23 * Interface 1 EP 0x82 bootclass mouse, rdesc len 83, report id 0x0a, Tablet
27 * with a phone in portraid mode, while using the tablet in landscape mode.
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
46 #include "hid-ids.h"
71 return hid_hw_open(data->hdev); in letsketch_open()
78 hid_hw_close(data->hdev); in letsketch_close()
85 input = devm_input_allocate_device(&data->hdev->dev); 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()
109 return -ENOMEM; in letsketch_setup_input_tablet()
121 /* All known brands selling this tablet use WP9620[N] as model name */ 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()
136 return -ENOMEM; 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()
178 input = data->input_tablet; 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()
201 hid_warn(data->hdev, "Warning unknown data header: 0x%02x\n", in letsketch_raw_event()
211 * The tablets magic handshake to put it in raw mode relies on getting
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()
252 * message the tablet needs this elaborate magic reading of USB in letsketch_probe()
253 * string descriptors to kick it into raw mode. This is what the in letsketch_probe()
279 * The tablet should be in raw mode now, end with a final delay before 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()