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, &params->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, &params->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,
888 strscpy(hdev->uniq, ver_ptr, sizeof(hdev->uniq));
892 hid_dbg(hdev,
898 hdev);
900 hid_err(hdev,
904 hid_dbg(hdev, "pen v2 parameters found\n");
912 hid_err(hdev,
935 hid_err(hdev,
954 hid_err(hdev,
978 hid_err(hdev,
995 hid_dbg(hdev, "pen v2 parameters not found\n");
999 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1001 hid_err(hdev,
1005 hid_dbg(hdev, "pen v1 parameters found\n");
1008 &found, hdev);
1010 hid_err(hdev, "v1 frame probing failed: %d\n", rc);
1013 hid_dbg(hdev, "frame v1 parameters%s found\n",
1023 hid_dbg(hdev, "pen v1 parameters not found\n");
1043 * @hdev: The HID device of the tablet interface to initialize and get
1053 static int uclogic_probe_interface(struct hid_device *hdev, const u8 *magic_arr,
1062 if (!hdev || !magic_arr) {
1073 udev = hid_to_usb_dev(hdev);
1078 hid_err(hdev, "Interface probing failed: %d\n", rc);
1247 * @hdev: The HID device of the tablet interface.
1252 static bool uclogic_params_ugee_v2_has_battery(struct hid_device *hdev)
1254 struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
1264 if (hdev->vendor == USB_VENDOR_ID_UGEE &&
1265 hdev->product == USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L) {
1266 struct usb_device *udev = hid_to_usb_dev(hdev);
1277 * @hdev: The HID device of the tablet interface, cannot be NULL.
1283 static int uclogic_params_ugee_v2_init_battery(struct hid_device *hdev,
1288 if (!hdev || !p)
1291 /* Some tablets contain invalid characters in hdev->uniq, throwing a
1295 snprintf(hdev->uniq, sizeof(hdev->uniq), "%x-%x", hdev->vendor,
1296 hdev->product);
1325 uclogic_probe_interface(event_hook->hdev, uclogic_ugee_v2_probe_arr,
1333 * @hdev: The HID device of the tablet interface to initialize and get
1340 static int uclogic_params_ugee_v2_init_event_hooks(struct hid_device *hdev,
1353 if (!uclogic_params_ugee_v2_has_battery(hdev))
1367 event_hook->hdev = hdev;
1391 * @hdev: The HID device of the tablet interface to initialize and get
1398 struct hid_device *hdev)
1412 if (!params || !hdev) {
1417 drvdata = hid_get_drvdata(hdev);
1418 iface = to_usb_interface(hdev->dev.parent);
1439 rc = uclogic_probe_interface(hdev, uclogic_ugee_v2_probe_arr,
1452 rc = uclogic_params_get_str_desc(&str_desc, hdev, 100, str_desc_len);
1454 hid_err(hdev, "failed retrieving pen and frame parameters: %d\n", rc);
1506 if (uclogic_params_ugee_v2_has_battery(hdev)) {
1507 rc = uclogic_params_ugee_v2_init_battery(hdev, &p);
1509 hid_err(hdev, "error initializing battery: %d\n", rc);
1515 rc = uclogic_params_ugee_v2_init_event_hooks(hdev, &p);
1517 hid_err(hdev, "error initializing event hook list: %d\n", rc);
1539 * @hdev: The HID device of the tablet interface to initialize and get
1547 struct hid_device *hdev)
1559 if (params == NULL || hdev == NULL || !hid_is_usb(hdev)) {
1564 udev = hid_to_usb_dev(hdev);
1566 iface = to_usb_interface(hdev->dev.parent);
1575 &p, hdev, \
1602 switch (VID_PID(hdev->vendor, hdev->product)) {
1617 if (hdev->dev_rsize == UCLOGIC_RDESC_WP5540U_V2_ORIG_SIZE) {
1621 &found, hdev);
1623 hid_err(hdev,
1629 hid_warn(hdev,
1713 rc = uclogic_params_huion_init(&p, hdev);
1732 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1734 hid_err(hdev, "pen probing failed: %d\n", rc);
1738 hid_warn(hdev, "pen parameters not found");
1750 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1752 hid_err(hdev, "pen probing failed: %d\n", rc);
1779 rc = uclogic_params_ugee_v2_init(&p, hdev);
1793 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1795 hid_err(hdev, "pen probing failed: %d\n", rc);
1804 hid_err(hdev,
1814 hid_warn(hdev, "pen parameters not found");
1827 rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev);
1829 hid_err(hdev, "pen probing failed: %d\n", rc);
1838 hid_err(hdev,
1844 hid_warn(hdev, "pen parameters not found");