Lines Matching full:hid
6 * HID char devices, giving access to raw HID device events.
22 #include <linux/hid.h>
56 hiddev_lookup_report(struct hid_device *hid, struct hiddev_report_info *rinfo) in hiddev_lookup_report() argument
68 report_enum = hid->report_enum + in hiddev_lookup_report()
109 hiddev_lookup_usage(struct hid_device *hid, struct hiddev_usage_ref *uref) in hiddev_lookup_usage() argument
120 report_enum = hid->report_enum + in hiddev_lookup_usage()
127 if (field->usage[j].hid == uref->usage_code) { in hiddev_lookup_usage()
140 static void hiddev_send_event(struct hid_device *hid, in hiddev_send_event() argument
143 struct hiddev *hiddev = hid->hiddev; in hiddev_send_event()
163 * This is where hid.c calls into hiddev to pass an event that occurred over
166 void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, in hiddev_hid_event() argument
179 uref.usage_code = usage->hid; in hiddev_hid_event()
182 hiddev_send_event(hid, &uref); in hiddev_hid_event()
186 void hiddev_report_event(struct hid_device *hid, struct hid_report *report) in hiddev_report_event() argument
199 hiddev_send_event(hid, &uref); in hiddev_report_event()
228 hid_hw_close(list->hiddev->hid); in hiddev_release()
229 hid_hw_power(list->hiddev->hid, PM_HINT_NORMAL); in hiddev_release()
259 error = hid_hw_power(hiddev->hid, PM_HINT_FULLON); in __hiddev_open()
263 error = hid_hw_open(hiddev->hid); in __hiddev_open()
277 hid_hw_power(hiddev->hid, PM_HINT_NORMAL); in __hiddev_open()
290 struct hid_device *hid; in hiddev_open() local
298 hid = usb_get_intfdata(intf); in hiddev_open()
299 hiddev = hid->hiddev; in hiddev_open()
380 event.hid = list->buffer[list->tail].usage_code; in hiddev_read()
429 struct hid_device *hid = hiddev->hid; in hiddev_ioctl_usage() local
454 if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL) in hiddev_ioctl_usage()
468 uref->usage_code = field->usage[uref->usage_index].hid; in hiddev_ioctl_usage()
482 field = hiddev_lookup_usage(hid, uref); in hiddev_ioctl_usage()
488 if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL) in hiddev_ioctl_usage()
568 struct hid_device *hid = hiddev->hid; in hiddev_ioctl_string() local
569 struct usb_device *dev = hid_to_usb_dev(hid); in hiddev_ioctl_string()
598 struct hid_device *hid; in hiddev_ioctl() local
616 hid = hiddev->hid; in hiddev_ioctl()
626 if (arg >= hid->maxapplication) in hiddev_ioctl()
629 for (i = 0; i < hid->maxcollection; i++) in hiddev_ioctl()
630 if (hid->collection[i].type == in hiddev_ioctl()
634 if (i < hid->maxcollection) in hiddev_ioctl()
635 r = hid->collection[i].usage; in hiddev_ioctl()
640 struct usb_device *dev = hid_to_usb_dev(hid); in hiddev_ioctl()
641 struct usbhid_device *usbhid = hid->driver_data; in hiddev_ioctl()
652 dinfo.num_applications = hid->maxapplication; in hiddev_ioctl()
689 usbhid_init_reports(hid); in hiddev_ioctl()
703 report = hiddev_lookup_report(hid, &rinfo); in hiddev_ioctl()
707 hid_hw_request(hid, report, HID_REQ_GET_REPORT); in hiddev_ioctl()
708 hid_hw_wait(hid); in hiddev_ioctl()
722 report = hiddev_lookup_report(hid, &rinfo); in hiddev_ioctl()
726 hid_hw_request(hid, report, HID_REQ_SET_REPORT); in hiddev_ioctl()
727 hid_hw_wait(hid); in hiddev_ioctl()
738 report = hiddev_lookup_report(hid, &rinfo); in hiddev_ioctl()
757 report = hiddev_lookup_report(hid, &rinfo); in hiddev_ioctl()
794 usbhid_init_reports(hid); in hiddev_ioctl()
806 if (cinfo.index >= hid->maxcollection) in hiddev_ioctl()
809 hid->maxcollection); in hiddev_ioctl()
811 cinfo.type = hid->collection[cinfo.index].type; in hiddev_ioctl()
812 cinfo.usage = hid->collection[cinfo.index].usage; in hiddev_ioctl()
813 cinfo.level = hid->collection[cinfo.index].level; in hiddev_ioctl()
824 int len = strlen(hid->name) + 1; in hiddev_ioctl()
827 r = copy_to_user(user_arg, hid->name, len) ? in hiddev_ioctl()
833 int len = strlen(hid->phys) + 1; in hiddev_ioctl()
836 r = copy_to_user(user_arg, hid->phys, len) ? in hiddev_ioctl()
873 * This is where hid.c calls us to connect a hid device to the hiddev driver
875 int hiddev_connect(struct hid_device *hid, unsigned int force) in hiddev_connect() argument
878 struct usbhid_device *usbhid = hid->driver_data; in hiddev_connect()
883 for (i = 0; i < hid->maxcollection; i++) in hiddev_connect()
884 if (hid->collection[i].type == in hiddev_connect()
886 !IS_INPUT_APPLICATION(hid->collection[i].usage)) in hiddev_connect()
889 if (i == hid->maxcollection) in hiddev_connect()
900 hid->hiddev = hiddev; in hiddev_connect()
901 hiddev->hid = hid; in hiddev_connect()
905 hid_err(hid, "Not able to get a minor for this device\n"); in hiddev_connect()
906 hid->hiddev = NULL; in hiddev_connect()
915 hiddev->initialized = hid->quirks & HID_QUIRK_NO_INIT_REPORTS; in hiddev_connect()
923 * This is where hid.c calls us to disconnect a hiddev device from the
924 * corresponding hid device (usually because the usb device has disconnected)
927 void hiddev_disconnect(struct hid_device *hid) in hiddev_disconnect() argument
929 struct hiddev *hiddev = hid->hiddev; in hiddev_disconnect()
930 struct usbhid_device *usbhid = hid->driver_data; in hiddev_disconnect()
938 hid_hw_close(hiddev->hid); in hiddev_disconnect()