Lines Matching defs:hdev
50 * @hdev: The HID device the pen parameters describe.
56 static void uclogic_params_pen_hid_dbg(const struct hid_device *hdev,
61 hid_dbg(hdev, "\t.usage_invalid = %s\n",
63 hid_dbg(hdev, "\t.desc_ptr = %p\n", pen->desc_ptr);
64 hid_dbg(hdev, "\t.desc_size = %u\n", pen->desc_size);
65 hid_dbg(hdev, "\t.id = %u\n", pen->id);
66 hid_dbg(hdev, "\t.subreport_list = {\n");
68 hid_dbg(hdev, "\t\t{0x%02hhx, %hhu}%s\n",
73 hid_dbg(hdev, "\t}\n");
74 hid_dbg(hdev, "\t.inrange = %s\n",
76 hid_dbg(hdev, "\t.fragmented_hires = %s\n",
78 hid_dbg(hdev, "\t.tilt_y_flipped = %s\n",
84 * @hdev: The HID device the pen parameters describe.
91 const struct hid_device *hdev,
94 hid_dbg(hdev, "\t\t.desc_ptr = %p\n", frame->desc_ptr);
95 hid_dbg(hdev, "\t\t.desc_size = %u\n", frame->desc_size);
96 hid_dbg(hdev, "\t\t.id = %u\n", frame->id);
97 hid_dbg(hdev, "\t\t.suffix = %s\n", frame->suffix);
98 hid_dbg(hdev, "\t\t.re_lsb = %u\n", frame->re_lsb);
99 hid_dbg(hdev, "\t\t.dev_id_byte = %u\n", frame->dev_id_byte);
100 hid_dbg(hdev, "\t\t.touch_byte = %u\n", frame->touch_byte);
101 hid_dbg(hdev, "\t\t.touch_max = %hhd\n", frame->touch_max);
102 hid_dbg(hdev, "\t\t.touch_flip_at = %hhd\n",
104 hid_dbg(hdev, "\t\t.bitmap_dial_byte = %u\n",
110 * @hdev: The HID device the parameters describe.
115 void uclogic_params_hid_dbg(const struct hid_device *hdev,
120 hid_dbg(hdev, ".invalid = %s\n",
122 hid_dbg(hdev, ".desc_ptr = %p\n", params->desc_ptr);
123 hid_dbg(hdev, ".desc_size = %u\n", params->desc_size);
124 hid_dbg(hdev, ".pen = {\n");
125 uclogic_params_pen_hid_dbg(hdev, ¶ms->pen);
126 hid_dbg(hdev, "\t}\n");
127 hid_dbg(hdev, ".frame_list = {\n");
129 hid_dbg(hdev, "\t{\n");
130 uclogic_params_frame_hid_dbg(hdev, ¶ms->frame_list[i]);
131 hid_dbg(hdev, "\t}%s\n",
134 hid_dbg(hdev, "}\n");
145 * @hdev: The HID device of the tablet interface to retrieve the string
155 static int uclogic_params_get_str_desc(__u8 **pbuf, struct hid_device *hdev,
163 if (hdev == NULL) {
168 udev = hid_to_usb_dev(hdev);
182 hid_dbg(hdev, "string descriptor #%hhu not found\n", idx);
185 hid_err(hdev,
224 * @hdev: The HID device of the tablet interface to initialize and get
232 struct hid_device *hdev)
246 if (pen == NULL || pfound == NULL || hdev == NULL) {
257 rc = uclogic_params_get_str_desc(&buf, hdev, 100, len);
259 hid_dbg(hdev,
263 hid_err(hdev, "failed retrieving pen parameters: %d\n", rc);
266 hid_dbg(hdev,
362 * @hdev: The HID device of the tablet interface to initialize
372 struct hid_device *hdev)
391 if (pen == NULL || pfound == NULL || hdev == NULL) {
402 rc = uclogic_params_get_str_desc(&buf, hdev, 200, params_len_max);
404 hid_dbg(hdev,
408 hid_err(hdev, "failed retrieving pen parameters: %d\n", rc);
411 hid_dbg(hdev,
429 hid_dbg(hdev,
556 * @hdev: The HID device of the tablet interface to initialize and get
564 struct hid_device *hdev)
573 if (frame == NULL || pfound == NULL || hdev == NULL) {
578 usb_dev = hid_to_usb_dev(hdev);
591 hid_dbg(hdev,
596 hid_dbg(hdev,
600 hid_dbg(hdev, "generic buttons enabled\n");
757 * @hdev: The HID device of the tablet interface create the
770 struct hid_device *hdev,
780 if (params == NULL || hdev == NULL ||
787 if (hdev->dev_rsize == orig_desc_size) {
788 hid_dbg(hdev,
797 hid_dbg(hdev,
799 hdev->dev_rsize, orig_desc_size);
823 * @hdev: The HID device of the tablet interface to initialize and get
830 struct hid_device *hdev)
852 if (params == NULL || hdev == NULL) {
857 udev = hid_to_usb_dev(hdev);
858 iface = to_usb_interface(hdev->dev.parent);
882 hid_err(hdev,
889 hid_dbg(hdev,
895 hdev);
897 hid_err(hdev,
901 hid_dbg(hdev, "pen v2 parameters found\n");
909 hid_err(hdev,
932 hid_err(hdev,
951 hid_err(hdev,
975 hid_err(hdev,
992 hid_dbg(hdev, "pen v2 parameters not found\n");
996 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
998 hid_err(hdev,
1002 hid_dbg(hdev, "pen v1 parameters found\n");
1005 &found, hdev);
1007 hid_err(hdev, "v1 frame probing failed: %d\n", rc);
1010 hid_dbg(hdev, "frame v1 parameters%s found\n",
1020 hid_dbg(hdev, "pen v1 parameters not found\n");
1040 * @hdev: The HID device of the tablet interface to initialize and get
1050 static int uclogic_probe_interface(struct hid_device *hdev, const u8 *magic_arr,
1059 if (!hdev || !magic_arr) {
1070 udev = hid_to_usb_dev(hdev);
1075 hid_err(hdev, "Interface probing failed: %d\n", rc);
1244 * @hdev: The HID device of the tablet interface.
1249 static bool uclogic_params_ugee_v2_has_battery(struct hid_device *hdev)
1251 struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
1261 if (hdev->vendor == USB_VENDOR_ID_UGEE &&
1262 hdev->product == USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L) {
1263 struct usb_device *udev = hid_to_usb_dev(hdev);
1274 * @hdev: The HID device of the tablet interface, cannot be NULL.
1280 static int uclogic_params_ugee_v2_init_battery(struct hid_device *hdev,
1285 if (!hdev || !p)
1288 /* Some tablets contain invalid characters in hdev->uniq, throwing a
1292 snprintf(hdev->uniq, sizeof(hdev->uniq), "%x-%x", hdev->vendor,
1293 hdev->product);
1322 uclogic_probe_interface(event_hook->hdev, uclogic_ugee_v2_probe_arr,
1330 * @hdev: The HID device of the tablet interface to initialize and get
1337 static int uclogic_params_ugee_v2_init_event_hooks(struct hid_device *hdev,
1350 if (!uclogic_params_ugee_v2_has_battery(hdev))
1364 event_hook->hdev = hdev;
1388 * @hdev: The HID device of the tablet interface to initialize and get
1395 struct hid_device *hdev)
1409 if (!params || !hdev) {
1414 drvdata = hid_get_drvdata(hdev);
1415 iface = to_usb_interface(hdev->dev.parent);
1436 rc = uclogic_probe_interface(hdev, uclogic_ugee_v2_probe_arr,
1449 rc = uclogic_params_get_str_desc(&str_desc, hdev, 100, str_desc_len);
1451 hid_err(hdev, "failed retrieving pen and frame parameters: %d\n", rc);
1503 if (uclogic_params_ugee_v2_has_battery(hdev)) {
1504 rc = uclogic_params_ugee_v2_init_battery(hdev, &p);
1506 hid_err(hdev, "error initializing battery: %d\n", rc);
1512 rc = uclogic_params_ugee_v2_init_event_hooks(hdev, &p);
1514 hid_err(hdev, "error initializing event hook list: %d\n", rc);
1536 * @hdev: The HID device of the tablet interface to initialize and get
1544 struct hid_device *hdev)
1556 if (params == NULL || hdev == NULL || !hid_is_usb(hdev)) {
1561 udev = hid_to_usb_dev(hdev);
1563 iface = to_usb_interface(hdev->dev.parent);
1572 &p, hdev, \
1599 switch (VID_PID(hdev->vendor, hdev->product)) {
1614 if (hdev->dev_rsize == UCLOGIC_RDESC_WP5540U_V2_ORIG_SIZE) {
1618 &found, hdev);
1620 hid_err(hdev,
1626 hid_warn(hdev,
1710 rc = uclogic_params_huion_init(&p, hdev);
1729 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1731 hid_err(hdev, "pen probing failed: %d\n", rc);
1735 hid_warn(hdev, "pen parameters not found");
1747 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1749 hid_err(hdev, "pen probing failed: %d\n", rc);
1776 rc = uclogic_params_ugee_v2_init(&p, hdev);
1790 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1792 hid_err(hdev, "pen probing failed: %d\n", rc);
1801 hid_err(hdev,
1811 hid_warn(hdev, "pen parameters not found");
1824 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1826 hid_err(hdev, "pen probing failed: %d\n", rc);
1835 hid_err(hdev,
1841 hid_warn(hdev, "pen parameters not found");