Lines Matching defs:hid

34 #include <linux/hid.h>
36 #include <linux/hid-debug.h>
39 #include "hid-ids.h"
270 field->usage[i].hid = parser->local.usage[j];
628 struct hid_device *hid = container_of(dev, struct hid_device, dev);
630 hid_close_report(hid);
631 kfree(hid->dev_rdesc);
632 kfree(hid);
704 struct hid_device *hid = parser->device;
707 hid->group = HID_GROUP_MULTITOUCH;
719 struct hid_device *hid = parser->device;
724 hid->group = HID_GROUP_SENSOR_HUB;
726 if (hid->vendor == USB_VENDOR_ID_MICROSOFT &&
727 (hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3 ||
728 hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2 ||
729 hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP ||
730 hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 ||
731 hid->product == USB_DEVICE_ID_MS_POWER_COVER) &&
732 hid->group == HID_GROUP_MULTITOUCH)
733 hid->group = HID_GROUP_GENERIC;
758 /* ignore constant inputs, they will be ignored by hid-input */
783 static int hid_scan_report(struct hid_device *hid)
787 __u8 *start = hid->dev_rdesc;
788 __u8 *end = start + hid->dev_rsize;
801 parser->device = hid;
802 hid->group = HID_GROUP_GENERIC;
806 * be robust against hid errors. Those errors will be raised by
816 (hid->group == HID_GROUP_MULTITOUCH))
817 hid->group = HID_GROUP_MULTITOUCH_WIN_8;
822 switch (hid->vendor) {
824 hid->group = HID_GROUP_WACOM;
827 if (hid->group == HID_GROUP_GENERIC)
831 * hid-rmi should take care of them,
832 * not hid-generic
834 hid->group = HID_GROUP_RMI;
845 * @device: hid device
852 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size)
854 hid->dev_rdesc = kmemdup(start, size, GFP_KERNEL);
855 if (!hid->dev_rdesc)
857 hid->dev_rsize = size;
870 * @device: hid device
879 struct hid_report *hid_validate_values(struct hid_device *hid,
887 hid_err(hid, "invalid HID report type %u\n", type);
892 hid_err(hid, "invalid HID report id %u\n", id);
907 hid->report_enum[type].report_list.next,
910 report = hid->report_enum[type].report_id_hash[id];
913 hid_err(hid, "missing %s %u\n", hid_report_names[type], id);
917 hid_err(hid, "not enough fields in %s %u\n",
922 hid_err(hid, "not enough values in %s %u field %u\n",
933 * @device: hid device
1083 * Search linux-kernel and linux-usb-devel archives for "hid-core extract".
1086 __u32 hid_field_extract(const struct hid_device *hid, __u8 *report,
1092 hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n",
1111 static void implement(const struct hid_device *hid, __u8 *report,
1118 hid_warn(hid, "%s() called with n (%d) > 32! (%s)\n",
1122 hid_warn(hid, "%s() called with too large value %d! (%s)\n",
1152 * @hid: hid device
1155 * compare hid->driver->report_table->report_type to report->type
1157 static int hid_match_report(struct hid_device *hid, struct hid_report *report)
1159 const struct hid_report_id *id = hid->driver->report_table;
1174 * @hid: hid device
1177 * compare hid->driver->usage_table->usage_{type,code} to
1180 static int hid_match_usage(struct hid_device *hid, struct hid_usage *usage)
1182 const struct hid_usage_id *id = hid->driver->usage_table;
1189 id->usage_hid == usage->hid) &&
1198 static void hid_process_event(struct hid_device *hid, struct hid_field *field,
1201 struct hid_driver *hdrv = hid->driver;
1204 if (!list_empty(&hid->debug_list))
1205 hid_dump_input(hid, usage, value);
1207 if (hdrv && hdrv->event && hid_match_usage(hid, usage)) {
1208 ret = hdrv->event(hid, field, usage, value);
1211 hid_err(hid, "%s's event failed with %d\n",
1217 if (hid->claimed & HID_CLAIMED_INPUT)
1218 hidinput_hid_event(hid, field, usage, value);
1219 if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt && hid->hiddev_hid_event)
1220 hid->hiddev_hid_event(hid, field, usage, value);
1229 static void hid_input_field(struct hid_device *hid, struct hid_field *field,
1247 snto32(hid_field_extract(hid, data, offset + n * size,
1249 hid_field_extract(hid, data, offset + n * size, size);
1254 field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1)
1261 hid_process_event(hid, field, &field->usage[n], value[n], interrupt);
1266 && field->usage[field->value[n] - min].hid
1268 hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt);
1271 && field->usage[value[n] - min].hid
1273 hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt);
1285 static void hid_output_field(const struct hid_device *hid,
1295 implement(hid, data, offset + n * size, size,
1298 implement(hid, data, offset + n * size, size,
1389 * DO NOT USE in hid drivers directly, but through hid_hw_request instead.
1391 void __hid_request(struct hid_device *hid, struct hid_report *report,
1407 ret = hid->ll_driver->raw_request(hid, report->id, buf, len,
1415 hid_input_report(hid, report->type, buf, ret, 0);
1422 int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
1425 struct hid_report_enum *report_enum = hid->report_enum + type;
1453 if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event)
1454 hid->hiddev_report_event(hid, report);
1455 if (hid->claimed & HID_CLAIMED_HIDRAW) {
1456 ret = hidraw_report_event(hid, data, size);
1461 if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) {
1463 hid_input_field(hid, report->field[a], cdata, interrupt);
1464 hdrv = hid->driver;
1466 hdrv->report(hid, report);
1469 if (hid->claimed & HID_CLAIMED_INPUT)
1470 hidinput_report_event(hid, report);
1479 * @hid: hid device
1487 int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt)
1494 if (!hid)
1497 if (down_trylock(&hid->driver_input_lock))
1500 if (!hid->driver) {
1504 report_enum = hid->report_enum + type;
1505 hdrv = hid->driver;
1514 if (!list_empty(&hid->debug_list))
1515 hid_dump_report(hid, type, data, size);
1524 if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
1525 ret = hdrv->raw_event(hid, report, data, size);
1530 ret = hid_report_raw_event(hid, type, data, size, interrupt);
1533 up(&hid->driver_input_lock);
1724 * Please note that for multitouch devices (driven by hid-multitouch driver),
1730 * physical is found inside a usage page of type sensor, hid-sensor-hub will be
2074 * Adds a new dynamic hid device ID to this driver,
2229 len = snprintf(buf, PAGE_SIZE, "hid:b%04Xg%04Xv%08Xp%08X\n",
2259 if (add_uevent_var(env, "MODALIAS=hid:b%04Xg%04Xv%08Xp%08X",
2267 .name = "hid",
2445 * hid_mouse_ignore_list - mouse devices which should not be handled by the hid layer
2531 * the Logitech AudioHub Speaker, but it should ignore the hid.
2567 * ignore the hid. Check the name, bus, product and ignore
2645 * hid_allocate_device - allocate new hid device descriptor
2647 * Allocate and initialize hid device, so that hid_destroy_device might be
2693 * @hdev: hid device
2738 int hid_check_keys_pressed(struct hid_device *hid)
2743 if (!(hid->claimed & HID_CLAIMED_INPUT))
2746 list_for_each_entry(hidinput, &hid->inputs, list) {
2767 pr_err("can't register hid bus\n");