Lines Matching full:hid

3  * User-space I/O driver support for HID subsystem
15 #include <linux/hid.h>
32 /* This flag tracks whether the HID device is usable for commands from
39 * holding @devlock, it's still fine to access @hid.
47 struct hid_device *hid; member
73 ret = hid_add_device(uhid->hid); in uhid_device_add_worker()
75 hid_err(uhid->hid, "Cannot register HID device: error %d\n", ret); in uhid_device_add_worker()
80 * of using uhid->hid. in uhid_device_add_worker()
81 * Just leave uhid->hid as-is for now, and clean it up when in uhid_device_add_worker()
103 hid_warn(uhid->hid, "Output queue is full\n"); in uhid_queue()
126 static int uhid_hid_start(struct hid_device *hid) in uhid_hid_start() argument
128 struct uhid_device *uhid = hid->driver_data; in uhid_hid_start()
138 if (hid->report_enum[HID_FEATURE_REPORT].numbered) in uhid_hid_start()
140 if (hid->report_enum[HID_OUTPUT_REPORT].numbered) in uhid_hid_start()
142 if (hid->report_enum[HID_INPUT_REPORT].numbered) in uhid_hid_start()
152 static void uhid_hid_stop(struct hid_device *hid) in uhid_hid_stop() argument
154 struct uhid_device *uhid = hid->driver_data; in uhid_hid_stop()
156 hid->claimed = 0; in uhid_hid_stop()
160 static int uhid_hid_open(struct hid_device *hid) in uhid_hid_open() argument
162 struct uhid_device *uhid = hid->driver_data; in uhid_hid_open()
167 static void uhid_hid_close(struct hid_device *hid) in uhid_hid_close() argument
169 struct uhid_device *uhid = hid->driver_data; in uhid_hid_close()
174 static int uhid_hid_parse(struct hid_device *hid) in uhid_hid_parse() argument
176 struct uhid_device *uhid = hid->driver_data; in uhid_hid_parse()
178 return hid_parse_report(hid, uhid->rd_data, uhid->rd_size); in uhid_hid_parse()
232 static int uhid_hid_get_report(struct hid_device *hid, unsigned char rnum, in uhid_hid_get_report() argument
235 struct uhid_device *uhid = hid->driver_data; in uhid_hid_get_report()
275 static int uhid_hid_set_report(struct hid_device *hid, unsigned char rnum, in uhid_hid_set_report() argument
278 struct uhid_device *uhid = hid->driver_data; in uhid_hid_set_report()
316 static int uhid_hid_raw_request(struct hid_device *hid, unsigned char reportnum, in uhid_hid_raw_request() argument
338 return uhid_hid_get_report(hid, reportnum, buf, len, u_rtype); in uhid_hid_raw_request()
340 return uhid_hid_set_report(hid, reportnum, buf, len, u_rtype); in uhid_hid_raw_request()
346 static int uhid_hid_output_raw(struct hid_device *hid, __u8 *buf, size_t count, in uhid_hid_output_raw() argument
349 struct uhid_device *uhid = hid->driver_data; in uhid_hid_output_raw()
384 static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf, in uhid_hid_output_report() argument
387 return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT); in uhid_hid_output_report()
492 struct hid_device *hid; in uhid_dev_create2() local
497 if (uhid->hid) in uhid_dev_create2()
511 hid = hid_allocate_device(); in uhid_dev_create2()
512 if (IS_ERR(hid)) { in uhid_dev_create2()
513 ret = PTR_ERR(hid); in uhid_dev_create2()
517 BUILD_BUG_ON(sizeof(hid->name) != sizeof(ev->u.create2.name)); in uhid_dev_create2()
518 strscpy(hid->name, ev->u.create2.name, sizeof(hid->name)); in uhid_dev_create2()
519 BUILD_BUG_ON(sizeof(hid->phys) != sizeof(ev->u.create2.phys)); in uhid_dev_create2()
520 strscpy(hid->phys, ev->u.create2.phys, sizeof(hid->phys)); in uhid_dev_create2()
521 BUILD_BUG_ON(sizeof(hid->uniq) != sizeof(ev->u.create2.uniq)); in uhid_dev_create2()
522 strscpy(hid->uniq, ev->u.create2.uniq, sizeof(hid->uniq)); in uhid_dev_create2()
524 hid->ll_driver = &uhid_hid_driver; in uhid_dev_create2()
525 hid->bus = ev->u.create2.bus; in uhid_dev_create2()
526 hid->vendor = ev->u.create2.vendor; in uhid_dev_create2()
527 hid->product = ev->u.create2.product; in uhid_dev_create2()
528 hid->version = ev->u.create2.version; in uhid_dev_create2()
529 hid->country = ev->u.create2.country; in uhid_dev_create2()
530 hid->driver_data = uhid; in uhid_dev_create2()
531 hid->dev.parent = uhid_misc.this_device; in uhid_dev_create2()
533 uhid->hid = hid; in uhid_dev_create2()
536 /* Adding of a HID device is done through a worker, to allow HID drivers in uhid_dev_create2()
578 if (!uhid->hid) in uhid_dev_destroy()
586 hid_destroy_device(uhid->hid); in uhid_dev_destroy()
587 uhid->hid = NULL; in uhid_dev_destroy()
598 hid_input_report(uhid->hid, HID_INPUT_REPORT, ev->u.input.data, in uhid_dev_input()
609 hid_input_report(uhid->hid, HID_INPUT_REPORT, ev->u.input2.data, in uhid_dev_input2()
817 MODULE_DESCRIPTION("User-space I/O driver support for HID subsystem");