Lines Matching full:hid
3 * Goodix GT7986U SPI Driver Code for HID.
9 #include <linux/hid.h>
96 struct hid_device *hid; member
103 /* lock for hid raw request operation */
105 /* buffer used to store hid report event */
238 * goodix_hid_parse() - hid-core .parse() callback
239 * @hid: hid device instance
245 static int goodix_hid_parse(struct hid_device *hid) in goodix_hid_parse() argument
247 struct goodix_ts_data *ts = hid->driver_data; in goodix_hid_parse()
267 error = hid_parse_report(hid, rdesc, rsize); in goodix_hid_parse()
282 static void goodix_hid_find_max_report(struct hid_device *hid, unsigned int type, in goodix_hid_find_max_report() argument
288 list_for_each_entry(report, &hid->report_enum[type].report_list, list) { in goodix_hid_find_max_report()
295 static int goodix_hid_start(struct hid_device *hid) in goodix_hid_start() argument
297 struct goodix_ts_data *ts = hid->driver_data; in goodix_hid_start()
301 goodix_hid_find_max_report(hid, HID_INPUT_REPORT, &bufsize); in goodix_hid_start()
302 goodix_hid_find_max_report(hid, HID_OUTPUT_REPORT, &bufsize); in goodix_hid_start()
303 goodix_hid_find_max_report(hid, HID_FEATURE_REPORT, &bufsize); in goodix_hid_start()
319 static void goodix_hid_stop(struct hid_device *hid) in goodix_hid_stop() argument
321 hid->claimed = 0; in goodix_hid_stop()
324 static int goodix_hid_open(struct hid_device *hid) in goodix_hid_open() argument
326 struct goodix_ts_data *ts = hid->driver_data; in goodix_hid_open()
332 static void goodix_hid_close(struct hid_device *hid) in goodix_hid_close() argument
334 struct goodix_ts_data *ts = hid->driver_data; in goodix_hid_close()
349 * 3 bytes of hid request response data in goodix_hid_check_ack_status()
374 * @hid: hid device instance
381 * get report request. The transmitted data follows the standard i2c-hid
386 static int goodix_hid_get_raw_report(struct hid_device *hid, in goodix_hid_get_raw_report() argument
391 struct goodix_ts_data *ts = hid->driver_data; in goodix_hid_get_raw_report()
419 /* Clean 3 bytes of hid ack header data */ in goodix_hid_get_raw_report()
455 /* Step3: read response data(skip 2bytes of hid pkg length) */ in goodix_hid_get_raw_report()
460 dev_err(ts->dev, "failed read hid response data, %d", error); in goodix_hid_get_raw_report()
474 * @hid: HID device
481 * set report request. The transmitted data follows the standard i2c-hid
486 static int goodix_hid_set_raw_report(struct hid_device *hid, in goodix_hid_set_raw_report() argument
491 struct goodix_ts_data *ts = hid->driver_data; in goodix_hid_set_raw_report()
510 /* Clean 3 bytes of hid ack header data */ in goodix_hid_set_raw_report()
534 static int goodix_hid_raw_request(struct hid_device *hid, in goodix_hid_raw_request() argument
539 struct goodix_ts_data *ts = hid->driver_data; in goodix_hid_raw_request()
545 error = goodix_hid_get_raw_report(hid, reportnum, buf, in goodix_hid_raw_request()
550 error = goodix_hid_set_raw_report(hid, reportnum, in goodix_hid_raw_request()
605 hid_input_report(ts->hid, HID_INPUT_REPORT, pkg->data, in goodix_hid_irq()
628 hid_input_report(ts->hid, HID_INPUT_REPORT, pkg->data, in goodix_hid_irq()
636 struct hid_device *hid; in goodix_hid_init() local
639 /* Get hid descriptor */ in goodix_hid_init()
643 dev_err(ts->dev, "failed get hid desc, %d", error); in goodix_hid_init()
647 hid = hid_allocate_device(); in goodix_hid_init()
648 if (IS_ERR(hid)) in goodix_hid_init()
649 return PTR_ERR(hid); in goodix_hid_init()
651 hid->driver_data = ts; in goodix_hid_init()
652 hid->ll_driver = &goodix_hid_ll_driver; in goodix_hid_init()
653 hid->bus = BUS_SPI; in goodix_hid_init()
654 hid->dev.parent = &ts->spi->dev; in goodix_hid_init()
656 hid->version = le16_to_cpu(ts->hid_desc.bcd_version); in goodix_hid_init()
657 hid->vendor = le16_to_cpu(ts->hid_desc.vendor_id); in goodix_hid_init()
658 hid->product = le16_to_cpu(ts->hid_desc.product_id); in goodix_hid_init()
659 snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "hid-gdix", in goodix_hid_init()
660 hid->vendor, hid->product); in goodix_hid_init()
662 error = hid_add_device(hid); in goodix_hid_init()
664 dev_err(ts->dev, "failed add hid device, %d", error); in goodix_hid_init()
665 hid_destroy_device(hid); in goodix_hid_init()
669 ts->hid = hid; in goodix_hid_init()
715 dev_err(dev, "failed init hid device"); in goodix_spi_probe()
731 hid_destroy_device(ts->hid); in goodix_spi_probe()
740 hid_destroy_device(ts->hid); in goodix_spi_remove()
805 .name = "goodix-spi-hid",
816 MODULE_DESCRIPTION("Goodix SPI driver for HID touchscreen");