Lines Matching refs:hid

270 		field->usage[i].hid = parser->local.usage[j];  in hid_add_field()
628 struct hid_device *hid = container_of(dev, struct hid_device, dev); in hid_device_release() local
630 hid_close_report(hid); in hid_device_release()
631 kfree(hid->dev_rdesc); in hid_device_release()
632 kfree(hid); in hid_device_release()
704 struct hid_device *hid = parser->device; in hid_scan_input_usage() local
707 hid->group = HID_GROUP_MULTITOUCH; in hid_scan_input_usage()
719 struct hid_device *hid = parser->device; in hid_scan_collection() local
724 hid->group = HID_GROUP_SENSOR_HUB; in hid_scan_collection()
726 if (hid->vendor == USB_VENDOR_ID_MICROSOFT && in hid_scan_collection()
727 (hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3 || in hid_scan_collection()
728 hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2 || in hid_scan_collection()
729 hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP || in hid_scan_collection()
730 hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 || in hid_scan_collection()
731 hid->product == USB_DEVICE_ID_MS_POWER_COVER) && in hid_scan_collection()
732 hid->group == HID_GROUP_MULTITOUCH) in hid_scan_collection()
733 hid->group = HID_GROUP_GENERIC; in hid_scan_collection()
783 static int hid_scan_report(struct hid_device *hid) in hid_scan_report() argument
787 __u8 *start = hid->dev_rdesc; in hid_scan_report()
788 __u8 *end = start + hid->dev_rsize; in hid_scan_report()
801 parser->device = hid; in hid_scan_report()
802 hid->group = HID_GROUP_GENERIC; in hid_scan_report()
816 (hid->group == HID_GROUP_MULTITOUCH)) in hid_scan_report()
817 hid->group = HID_GROUP_MULTITOUCH_WIN_8; in hid_scan_report()
822 switch (hid->vendor) { in hid_scan_report()
824 hid->group = HID_GROUP_WACOM; in hid_scan_report()
827 if (hid->group == HID_GROUP_GENERIC) in hid_scan_report()
834 hid->group = HID_GROUP_RMI; in hid_scan_report()
852 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size) in hid_parse_report() argument
854 hid->dev_rdesc = kmemdup(start, size, GFP_KERNEL); in hid_parse_report()
855 if (!hid->dev_rdesc) in hid_parse_report()
857 hid->dev_rsize = size; in hid_parse_report()
879 struct hid_report *hid_validate_values(struct hid_device *hid, in hid_validate_values() argument
887 hid_err(hid, "invalid HID report type %u\n", type); in hid_validate_values()
892 hid_err(hid, "invalid HID report id %u\n", id); in hid_validate_values()
907 hid->report_enum[type].report_list.next, in hid_validate_values()
910 report = hid->report_enum[type].report_id_hash[id]; in hid_validate_values()
913 hid_err(hid, "missing %s %u\n", hid_report_names[type], id); in hid_validate_values()
917 hid_err(hid, "not enough fields in %s %u\n", in hid_validate_values()
922 hid_err(hid, "not enough values in %s %u field %u\n", in hid_validate_values()
1086 __u32 hid_field_extract(const struct hid_device *hid, __u8 *report, in hid_field_extract() argument
1092 hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", in hid_field_extract()
1111 static void implement(const struct hid_device *hid, __u8 *report, in implement() argument
1118 hid_warn(hid, "%s() called with n (%d) > 32! (%s)\n", in implement()
1122 hid_warn(hid, "%s() called with too large value %d! (%s)\n", in implement()
1157 static int hid_match_report(struct hid_device *hid, struct hid_report *report) in hid_match_report() argument
1159 const struct hid_report_id *id = hid->driver->report_table; in hid_match_report()
1180 static int hid_match_usage(struct hid_device *hid, struct hid_usage *usage) in hid_match_usage() argument
1182 const struct hid_usage_id *id = hid->driver->usage_table; in hid_match_usage()
1189 id->usage_hid == usage->hid) && in hid_match_usage()
1198 static void hid_process_event(struct hid_device *hid, struct hid_field *field, in hid_process_event() argument
1201 struct hid_driver *hdrv = hid->driver; in hid_process_event()
1204 if (!list_empty(&hid->debug_list)) in hid_process_event()
1205 hid_dump_input(hid, usage, value); in hid_process_event()
1207 if (hdrv && hdrv->event && hid_match_usage(hid, usage)) { in hid_process_event()
1208 ret = hdrv->event(hid, field, usage, value); in hid_process_event()
1211 hid_err(hid, "%s's event failed with %d\n", in hid_process_event()
1217 if (hid->claimed & HID_CLAIMED_INPUT) in hid_process_event()
1218 hidinput_hid_event(hid, field, usage, value); in hid_process_event()
1219 if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt && hid->hiddev_hid_event) in hid_process_event()
1220 hid->hiddev_hid_event(hid, field, usage, value); in hid_process_event()
1229 static void hid_input_field(struct hid_device *hid, struct hid_field *field, in hid_input_field() argument
1247 snto32(hid_field_extract(hid, data, offset + n * size, in hid_input_field()
1249 hid_field_extract(hid, data, offset + n * size, size); in hid_input_field()
1254 field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) in hid_input_field()
1261 hid_process_event(hid, field, &field->usage[n], value[n], interrupt); in hid_input_field()
1266 && field->usage[field->value[n] - min].hid in hid_input_field()
1268 hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt); in hid_input_field()
1271 && field->usage[value[n] - min].hid in hid_input_field()
1273 hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt); in hid_input_field()
1285 static void hid_output_field(const struct hid_device *hid, in hid_output_field() argument
1295 implement(hid, data, offset + n * size, size, in hid_output_field()
1298 implement(hid, data, offset + n * size, size, in hid_output_field()
1391 void __hid_request(struct hid_device *hid, struct hid_report *report, in __hid_request() argument
1407 ret = hid->ll_driver->raw_request(hid, report->id, buf, len, in __hid_request()
1415 hid_input_report(hid, report->type, buf, ret, 0); in __hid_request()
1422 int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, in hid_report_raw_event() argument
1425 struct hid_report_enum *report_enum = hid->report_enum + type; in hid_report_raw_event()
1453 if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event) in hid_report_raw_event()
1454 hid->hiddev_report_event(hid, report); in hid_report_raw_event()
1455 if (hid->claimed & HID_CLAIMED_HIDRAW) { in hid_report_raw_event()
1456 ret = hidraw_report_event(hid, data, size); in hid_report_raw_event()
1461 if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) { in hid_report_raw_event()
1463 hid_input_field(hid, report->field[a], cdata, interrupt); in hid_report_raw_event()
1464 hdrv = hid->driver; in hid_report_raw_event()
1466 hdrv->report(hid, report); in hid_report_raw_event()
1469 if (hid->claimed & HID_CLAIMED_INPUT) in hid_report_raw_event()
1470 hidinput_report_event(hid, report); in hid_report_raw_event()
1487 int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt) in hid_input_report() argument
1494 if (!hid) in hid_input_report()
1497 if (down_trylock(&hid->driver_input_lock)) in hid_input_report()
1500 if (!hid->driver) { in hid_input_report()
1504 report_enum = hid->report_enum + type; in hid_input_report()
1505 hdrv = hid->driver; in hid_input_report()
1514 if (!list_empty(&hid->debug_list)) in hid_input_report()
1515 hid_dump_report(hid, type, data, size); in hid_input_report()
1524 if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) { in hid_input_report()
1525 ret = hdrv->raw_event(hid, report, data, size); in hid_input_report()
1530 ret = hid_report_raw_event(hid, type, data, size, interrupt); in hid_input_report()
1533 up(&hid->driver_input_lock); in hid_input_report()
2738 int hid_check_keys_pressed(struct hid_device *hid) in hid_check_keys_pressed() argument
2743 if (!(hid->claimed & HID_CLAIMED_INPUT)) in hid_check_keys_pressed()
2746 list_for_each_entry(hidinput, &hid->inputs, list) { in hid_check_keys_pressed()