Lines Matching refs:hdev

30 static int wacom_get_report(struct hid_device *hdev, u8 type, u8 *buf,  in wacom_get_report()  argument
36 retval = hid_hw_raw_request(hdev, buf[0], buf, size, type, in wacom_get_report()
43 static int wacom_set_report(struct hid_device *hdev, u8 type, u8 *buf, in wacom_set_report() argument
49 retval = hid_hw_raw_request(hdev, buf[0], buf, size, type, in wacom_set_report()
56 static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report, in wacom_raw_event() argument
59 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_raw_event()
75 return hid_hw_open(wacom->hdev); in wacom_open()
82 hid_hw_close(wacom->hdev); in wacom_close()
101 static void wacom_feature_mapping(struct hid_device *hdev, in wacom_feature_mapping() argument
104 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_feature_mapping()
119 ret = wacom_get_report(hdev, HID_FEATURE_REPORT, in wacom_feature_mapping()
129 dev_err(&hdev->dev, "HID_DG_INPUTMODE out of range\n"); in wacom_feature_mapping()
171 static void wacom_usage_mapping(struct hid_device *hdev, in wacom_usage_mapping() argument
174 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_usage_mapping()
228 wacom_wac_usage_mapping(hdev, field, usage); in wacom_usage_mapping()
231 static void wacom_post_parse_hid(struct hid_device *hdev, in wacom_post_parse_hid() argument
234 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_post_parse_hid()
246 static void wacom_parse_hid(struct hid_device *hdev, in wacom_parse_hid() argument
254 rep_enum = &hdev->report_enum[HID_FEATURE_REPORT]; in wacom_parse_hid()
262 wacom_feature_mapping(hdev, hreport->field[i], in wacom_parse_hid()
269 rep_enum = &hdev->report_enum[HID_INPUT_REPORT]; in wacom_parse_hid()
277 wacom_usage_mapping(hdev, hreport->field[i], in wacom_parse_hid()
281 wacom_post_parse_hid(hdev, features); in wacom_parse_hid()
284 static int wacom_hid_set_device_mode(struct hid_device *hdev) in wacom_hid_set_device_mode() argument
286 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_hid_set_device_mode()
294 re = &(hdev->report_enum[HID_FEATURE_REPORT]); in wacom_hid_set_device_mode()
298 hid_hw_request(hdev, r, HID_REQ_SET_REPORT); in wacom_hid_set_device_mode()
303 static int wacom_set_device_mode(struct hid_device *hdev, int report_id, in wacom_set_device_mode() argument
317 error = wacom_set_report(hdev, HID_FEATURE_REPORT, rep_data, in wacom_set_device_mode()
320 error = wacom_get_report(hdev, HID_FEATURE_REPORT, in wacom_set_device_mode()
329 static int wacom_bt_query_tablet_data(struct hid_device *hdev, u8 speed, in wacom_bt_query_tablet_data() argument
332 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_bt_query_tablet_data()
340 ret = wacom_set_report(hdev, HID_FEATURE_REPORT, rep_data, 2, in wacom_bt_query_tablet_data()
347 ret = wacom_set_report(hdev, HID_FEATURE_REPORT, in wacom_bt_query_tablet_data()
360 hid_warn(hdev, "failed to poke device, command %d, err %d\n", in wacom_bt_query_tablet_data()
372 ret = wacom_set_report(hdev, HID_FEATURE_REPORT, rep_data, 2, in wacom_bt_query_tablet_data()
389 static int wacom_query_tablet_data(struct hid_device *hdev, in wacom_query_tablet_data() argument
392 if (hdev->bus == BUS_BLUETOOTH) in wacom_query_tablet_data()
393 return wacom_bt_query_tablet_data(hdev, 1, features); in wacom_query_tablet_data()
396 return wacom_hid_set_device_mode(hdev); in wacom_query_tablet_data()
401 return wacom_set_device_mode(hdev, 3, 4, 4); in wacom_query_tablet_data()
404 return wacom_set_device_mode(hdev, 18, 3, 2); in wacom_query_tablet_data()
407 return wacom_set_device_mode(hdev, 131, 3, 2); in wacom_query_tablet_data()
410 return wacom_set_device_mode(hdev, 2, 2, 2); in wacom_query_tablet_data()
414 return wacom_set_device_mode(hdev, 2, 2, 2); in wacom_query_tablet_data()
421 static void wacom_retrieve_hid_descriptor(struct hid_device *hdev, in wacom_retrieve_hid_descriptor() argument
424 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_retrieve_hid_descriptor()
453 wacom_parse_hid(hdev, features); in wacom_retrieve_hid_descriptor()
466 static bool wacom_are_sibling(struct hid_device *hdev, in wacom_are_sibling() argument
469 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_are_sibling()
476 vid = hdev->vendor; in wacom_are_sibling()
477 pid = hdev->product; in wacom_are_sibling()
484 n1 = strrchr(hdev->phys, '.') - hdev->phys; in wacom_are_sibling()
489 return !strncmp(hdev->phys, sibling->phys, n1); in wacom_are_sibling()
492 static struct wacom_hdev_data *wacom_get_hdev_data(struct hid_device *hdev) in wacom_get_hdev_data() argument
497 if (wacom_are_sibling(hdev, data->dev)) { in wacom_get_hdev_data()
506 static int wacom_add_shared_data(struct hid_device *hdev) in wacom_add_shared_data() argument
508 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_add_shared_data()
515 data = wacom_get_hdev_data(hdev); in wacom_add_shared_data()
524 data->dev = hdev; in wacom_add_shared_data()
531 wacom_wac->shared->touch = hdev; in wacom_add_shared_data()
533 wacom_wac->shared->pen = hdev; in wacom_add_shared_data()
561 if (wacom_wac->shared->touch == wacom->hdev) in wacom_remove_shared_data()
563 else if (wacom_wac->shared->pen == wacom->hdev) in wacom_remove_shared_data()
600 wacom_get_report(wacom->hdev, HID_FEATURE_REPORT, in wacom_led_control()
621 retval = wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, buf, buf_size, in wacom_led_control()
642 retval = wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, buf, 2, in wacom_led_putimage()
653 retval = wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, in wacom_led_putimage()
662 wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, buf, 2, in wacom_led_putimage()
673 struct hid_device *hdev = container_of(dev, struct hid_device, dev); in wacom_led_select_store() local
674 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_led_select_store()
701 struct hid_device *hdev = container_of(dev, struct hid_device, dev);\
702 struct wacom *wacom = hid_get_drvdata(hdev); \
737 struct hid_device *hdev = container_of(dev, struct hid_device, dev);\
738 struct wacom *wacom = hid_get_drvdata(hdev); \
760 struct hid_device *hdev = container_of(dev, struct hid_device, dev); in wacom_button_image_store() local
761 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_button_image_store()
766 if (hdev->bus == BUS_BLUETOOTH) { in wacom_button_image_store()
862 error = sysfs_create_group(&wacom->hdev->dev.kobj, in wacom_initialize_leds()
874 error = sysfs_create_group(&wacom->hdev->dev.kobj, in wacom_initialize_leds()
891 error = sysfs_create_group(&wacom->hdev->dev.kobj, in wacom_initialize_leds()
902 hid_err(wacom->hdev, in wacom_initialize_leds()
924 sysfs_remove_group(&wacom->hdev->dev.kobj, in wacom_destroy_leds()
930 sysfs_remove_group(&wacom->hdev->dev.kobj, in wacom_destroy_leds()
941 sysfs_remove_group(&wacom->hdev->dev.kobj, in wacom_destroy_leds()
1047 wacom->battery = power_supply_register(&wacom->hdev->dev, in wacom_initialize_battery()
1052 power_supply_powers(wacom->battery, &wacom->hdev->dev); in wacom_initialize_battery()
1054 wacom->ac = power_supply_register(&wacom->hdev->dev, in wacom_initialize_battery()
1062 power_supply_powers(wacom->ac, &wacom->hdev->dev); in wacom_initialize_battery()
1082 struct hid_device *hdev = container_of(dev, struct hid_device, dev); in wacom_show_speed() local
1083 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_show_speed()
1092 struct hid_device *hdev = container_of(dev, struct hid_device, dev); in wacom_store_speed() local
1093 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_store_speed()
1102 wacom_bt_query_tablet_data(hdev, new_speed, &wacom->wacom_wac.features); in wacom_store_speed()
1113 struct hid_device *hdev = wacom->hdev; in wacom_allocate_input() local
1121 input_dev->phys = hdev->phys; in wacom_allocate_input()
1122 input_dev->dev.parent = &hdev->dev; in wacom_allocate_input()
1125 input_dev->uniq = hdev->uniq; in wacom_allocate_input()
1126 input_dev->id.bustype = hdev->bus; in wacom_allocate_input()
1127 input_dev->id.vendor = hdev->vendor; in wacom_allocate_input()
1128 input_dev->id.product = wacom_wac->pid ? wacom_wac->pid : hdev->product; in wacom_allocate_input()
1129 input_dev->id.version = hdev->version; in wacom_allocate_input()
1265 hid_info(wacom->hdev, "wireless tablet disconnected\n"); in wacom_wireless_work()
1270 hid_info(wacom->hdev, "wireless tablet connected with PID %x\n", in wacom_wireless_work()
1281 hid_info(wacom->hdev, "ignoring unknown PID.\n"); in wacom_wireless_work()
1382 static size_t wacom_compute_pktlen(struct hid_device *hdev) in wacom_compute_pktlen() argument
1388 report_enum = hdev->report_enum + HID_INPUT_REPORT; in wacom_compute_pktlen()
1399 static int wacom_probe(struct hid_device *hdev, in wacom_probe() argument
1402 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in wacom_probe()
1413 hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; in wacom_probe()
1416 hdev->quirks &= ~HID_QUIRK_NOGET; in wacom_probe()
1422 hid_set_drvdata(hdev, wacom); in wacom_probe()
1423 wacom->hdev = hdev; in wacom_probe()
1426 error = hid_parse(hdev); in wacom_probe()
1428 hid_err(hdev, "parse failed\n"); in wacom_probe()
1435 features->pktlen = wacom_compute_pktlen(hdev); in wacom_probe()
1441 if (features->check_for_hid_type && features->hid_type != hdev->type) { in wacom_probe()
1476 wacom_retrieve_hid_descriptor(hdev, features); in wacom_probe()
1512 if (hdev->bus == BUS_BLUETOOTH) in wacom_probe()
1536 error = wacom_add_shared_data(hdev); in wacom_probe()
1553 if (hdev->bus == BUS_BLUETOOTH) { in wacom_probe()
1554 error = device_create_file(&hdev->dev, &dev_attr_speed); in wacom_probe()
1556 hid_warn(hdev, in wacom_probe()
1565 error = hid_hw_start(hdev, connect_mask); in wacom_probe()
1567 hid_err(hdev, "hw start failed\n"); in wacom_probe()
1572 wacom_query_tablet_data(hdev, features); in wacom_probe()
1575 error = hid_hw_open(hdev); in wacom_probe()
1585 if (hdev->bus == BUS_BLUETOOTH) in wacom_probe()
1586 device_remove_file(&hdev->dev, &dev_attr_speed); in wacom_probe()
1599 hid_set_drvdata(hdev, NULL); in wacom_probe()
1603 static void wacom_remove(struct hid_device *hdev) in wacom_remove() argument
1605 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_remove()
1607 hid_hw_stop(hdev); in wacom_remove()
1611 if (hdev->bus == BUS_BLUETOOTH) in wacom_remove()
1612 device_remove_file(&hdev->dev, &dev_attr_speed); in wacom_remove()
1616 hid_set_drvdata(hdev, NULL); in wacom_remove()
1621 static int wacom_resume(struct hid_device *hdev) in wacom_resume() argument
1623 struct wacom *wacom = hid_get_drvdata(hdev); in wacom_resume()
1629 wacom_query_tablet_data(hdev, features); in wacom_resume()
1637 static int wacom_reset_resume(struct hid_device *hdev) in wacom_reset_resume() argument
1639 return wacom_resume(hdev); in wacom_reset_resume()