Lines Matching refs:hid

289 		field->usage[i].hid = parser->local.usage[j];  in hid_add_field()
647 struct hid_device *hid = to_hid_device(dev); in hid_device_release() local
649 hid_close_report(hid); in hid_device_release()
650 kfree(hid->dev_rdesc); in hid_device_release()
651 kfree(hid); in hid_device_release()
723 struct hid_device *hid = parser->device; in hid_scan_input_usage() local
726 hid->group = HID_GROUP_MULTITOUCH; in hid_scan_input_usage()
738 struct hid_device *hid = parser->device; in hid_scan_collection() local
743 hid->group = HID_GROUP_SENSOR_HUB; in hid_scan_collection()
745 if (hid->vendor == USB_VENDOR_ID_MICROSOFT && in hid_scan_collection()
746 hid->product == USB_DEVICE_ID_MS_POWER_COVER && in hid_scan_collection()
747 hid->group == HID_GROUP_MULTITOUCH) in hid_scan_collection()
748 hid->group = HID_GROUP_GENERIC; in hid_scan_collection()
798 static int hid_scan_report(struct hid_device *hid) in hid_scan_report() argument
802 __u8 *start = hid->dev_rdesc; in hid_scan_report()
803 __u8 *end = start + hid->dev_rsize; in hid_scan_report()
816 parser->device = hid; in hid_scan_report()
817 hid->group = HID_GROUP_GENERIC; in hid_scan_report()
831 (hid->group == HID_GROUP_MULTITOUCH)) in hid_scan_report()
832 hid->group = HID_GROUP_MULTITOUCH_WIN_8; in hid_scan_report()
837 switch (hid->vendor) { in hid_scan_report()
839 hid->group = HID_GROUP_WACOM; in hid_scan_report()
842 if (hid->group == HID_GROUP_GENERIC) in hid_scan_report()
849 hid->group = HID_GROUP_RMI; in hid_scan_report()
868 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size) in hid_parse_report() argument
870 hid->dev_rdesc = kmemdup(start, size, GFP_KERNEL); in hid_parse_report()
871 if (!hid->dev_rdesc) in hid_parse_report()
873 hid->dev_rsize = size; in hid_parse_report()
895 struct hid_report *hid_validate_values(struct hid_device *hid, in hid_validate_values() argument
903 hid_err(hid, "invalid HID report type %u\n", type); in hid_validate_values()
908 hid_err(hid, "invalid HID report id %u\n", id); in hid_validate_values()
923 hid->report_enum[type].report_list.next, in hid_validate_values()
926 report = hid->report_enum[type].report_id_hash[id]; in hid_validate_values()
929 hid_err(hid, "missing %s %u\n", hid_report_names[type], id); in hid_validate_values()
933 hid_err(hid, "not enough fields in %s %u\n", in hid_validate_values()
938 hid_err(hid, "not enough values in %s %u field %u\n", in hid_validate_values()
1126 u32 hid_field_extract(const struct hid_device *hid, u8 *report, in hid_field_extract() argument
1130 hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", in hid_field_extract()
1172 static void implement(const struct hid_device *hid, u8 *report, in implement() argument
1176 hid_warn(hid, "%s() called with n (%d) > 32! (%s)\n", in implement()
1183 hid_warn(hid, in implement()
1215 static int hid_match_report(struct hid_device *hid, struct hid_report *report) in hid_match_report() argument
1217 const struct hid_report_id *id = hid->driver->report_table; in hid_match_report()
1238 static int hid_match_usage(struct hid_device *hid, struct hid_usage *usage) in hid_match_usage() argument
1240 const struct hid_usage_id *id = hid->driver->usage_table; in hid_match_usage()
1247 id->usage_hid == usage->hid) && in hid_match_usage()
1256 static void hid_process_event(struct hid_device *hid, struct hid_field *field, in hid_process_event() argument
1259 struct hid_driver *hdrv = hid->driver; in hid_process_event()
1262 if (!list_empty(&hid->debug_list)) in hid_process_event()
1263 hid_dump_input(hid, usage, value); in hid_process_event()
1265 if (hdrv && hdrv->event && hid_match_usage(hid, usage)) { in hid_process_event()
1266 ret = hdrv->event(hid, field, usage, value); in hid_process_event()
1269 hid_err(hid, "%s's event failed with %d\n", in hid_process_event()
1275 if (hid->claimed & HID_CLAIMED_INPUT) in hid_process_event()
1276 hidinput_hid_event(hid, field, usage, value); in hid_process_event()
1277 if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt && hid->hiddev_hid_event) in hid_process_event()
1278 hid->hiddev_hid_event(hid, field, usage, value); in hid_process_event()
1287 static void hid_input_field(struct hid_device *hid, struct hid_field *field, in hid_input_field() argument
1305 snto32(hid_field_extract(hid, data, offset + n * size, in hid_input_field()
1307 hid_field_extract(hid, data, offset + n * size, size); in hid_input_field()
1313 field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) in hid_input_field()
1320 hid_process_event(hid, field, &field->usage[n], value[n], interrupt); in hid_input_field()
1326 && field->usage[field->value[n] - min].hid in hid_input_field()
1328 hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt); in hid_input_field()
1332 && field->usage[value[n] - min].hid in hid_input_field()
1334 hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt); in hid_input_field()
1346 static void hid_output_field(const struct hid_device *hid, in hid_output_field() argument
1356 implement(hid, data, offset + n * size, size, in hid_output_field()
1359 implement(hid, data, offset + n * size, size, in hid_output_field()
1452 void __hid_request(struct hid_device *hid, struct hid_report *report, in __hid_request() argument
1468 ret = hid->ll_driver->raw_request(hid, report->id, buf, len, in __hid_request()
1476 hid_input_report(hid, report->type, buf, ret, 0); in __hid_request()
1483 int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, in hid_report_raw_event() argument
1486 struct hid_report_enum *report_enum = hid->report_enum + type; in hid_report_raw_event()
1514 if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event) in hid_report_raw_event()
1515 hid->hiddev_report_event(hid, report); in hid_report_raw_event()
1516 if (hid->claimed & HID_CLAIMED_HIDRAW) { in hid_report_raw_event()
1517 ret = hidraw_report_event(hid, data, size); in hid_report_raw_event()
1522 if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) { in hid_report_raw_event()
1524 hid_input_field(hid, report->field[a], cdata, interrupt); in hid_report_raw_event()
1525 hdrv = hid->driver; in hid_report_raw_event()
1527 hdrv->report(hid, report); in hid_report_raw_event()
1530 if (hid->claimed & HID_CLAIMED_INPUT) in hid_report_raw_event()
1531 hidinput_report_event(hid, report); in hid_report_raw_event()
1548 int hid_input_report(struct hid_device *hid, int type, u8 *data, u32 size, int interrupt) in hid_input_report() argument
1555 if (!hid) in hid_input_report()
1558 if (down_trylock(&hid->driver_input_lock)) in hid_input_report()
1561 if (!hid->driver) { in hid_input_report()
1565 report_enum = hid->report_enum + type; in hid_input_report()
1566 hdrv = hid->driver; in hid_input_report()
1575 if (!list_empty(&hid->debug_list)) in hid_input_report()
1576 hid_dump_report(hid, type, data, size); in hid_input_report()
1585 if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) { in hid_input_report()
1586 ret = hdrv->raw_event(hid, report, data, size); in hid_input_report()
1591 ret = hid_report_raw_event(hid, type, data, size, interrupt); in hid_input_report()
1594 up(&hid->driver_input_lock); in hid_input_report()
2313 int hid_check_keys_pressed(struct hid_device *hid) in hid_check_keys_pressed() argument
2318 if (!(hid->claimed & HID_CLAIMED_INPUT)) in hid_check_keys_pressed()
2321 list_for_each_entry(hidinput, &hid->inputs, list) { in hid_check_keys_pressed()