Lines Matching defs:hdev
161 struct hid_device *hdev; /* hid_device we're attached to */
377 struct hid_device *hdev = to_hid_device(dev);
378 struct mt_device *td = hid_get_drvdata(hdev);
387 struct hid_device *hdev = to_hid_device(dev);
388 struct mt_device *td = hid_get_drvdata(hdev);
418 static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
428 if (hdev->quirks & HID_QUIRK_NO_INIT_REPORTS)
435 ret = hid_hw_raw_request(hdev, report->id, buf, size,
438 dev_warn(&hdev->dev, "failed to fetch feature %d\n",
441 ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, buf,
444 dev_warn(&hdev->dev, "failed to report feature\n");
450 static void mt_feature_mapping(struct hid_device *hdev,
453 struct mt_device *td = hid_get_drvdata(hdev);
457 mt_get_feature(hdev, field->report);
470 dev_err(&hdev->dev, "HID_DG_BUTTONTYPE out of range\n");
474 mt_get_feature(hdev, field->report);
482 mt_get_feature(hdev, field->report);
497 static struct mt_usages *mt_allocate_usage(struct hid_device *hdev,
502 usage = devm_kzalloc(&hdev->dev, sizeof(*usage), GFP_KERNEL);
531 mt_application = devm_kzalloc(&td->hdev->dev, sizeof(*mt_application),
589 rdata = devm_kzalloc(&td->hdev->dev, sizeof(*rdata), GFP_KERNEL);
597 devm_kfree(&td->hdev->dev, rdata);
607 if (field->logical == HID_DG_FINGER || td->hdev->group != HID_GROUP_MULTITOUCH_WIN_8) {
640 static void mt_store_field(struct hid_device *hdev,
649 usage = mt_allocate_usage(hdev, application);
667 hid_dbg(hdev,
671 usage = mt_allocate_usage(hdev, application);
682 mt_store_field(hdev, app, \
686 static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
690 struct mt_device *td = hid_get_drvdata(hdev);
1242 static int mt_touch_input_configured(struct hid_device *hdev,
1246 struct mt_device *td = hid_get_drvdata(hdev);
1289 static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
1293 struct mt_device *td = hid_get_drvdata(hdev);
1299 hid_err(hdev, "failed to allocate data for report\n");
1348 return mt_touch_input_mapping(hdev, hi, field, usage, bit, max,
1362 static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
1366 struct mt_device *td = hid_get_drvdata(hdev);
1409 static bool mt_need_to_apply_feature(struct hid_device *hdev,
1417 struct mt_device *td = hid_get_drvdata(hdev);
1439 hid_err(hdev,
1443 hid_hw_raw_request(hdev, report->id, buf, report_len,
1480 static void mt_set_modes(struct hid_device *hdev, enum latency_mode latency,
1490 rep_enum = &hdev->report_enum[HID_FEATURE_REPORT];
1502 if (mt_need_to_apply_feature(hdev,
1514 hid_hw_request(hdev, rep, HID_REQ_SET_REPORT);
1541 static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
1543 struct mt_device *td = hid_get_drvdata(hdev);
1553 hid_err(hdev, "failed to allocate data for report\n");
1560 ret = mt_touch_input_configured(hdev, hi,
1580 hi->input->name = hdev->name;
1598 hi->input->name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
1599 "%s %s", hdev->name, suffix);
1614 static void mt_fix_const_fields(struct hid_device *hdev, unsigned int usage)
1620 &hdev->report_enum[HID_INPUT_REPORT].report_list,
1661 struct hid_device *hdev = td->hdev;
1670 mt_release_contacts(hdev);
1674 static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
1687 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL);
1689 dev_err(&hdev->dev, "cannot allocate multitouch data\n");
1692 td->hdev = hdev;
1695 hid_set_drvdata(hdev, td);
1706 hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC;
1713 hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
1716 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
1719 hdev->quirks &= ~HID_QUIRK_INPUT_PER_APP;
1720 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
1725 ret = hid_parse(hdev);
1730 mt_fix_const_fields(hdev, HID_DG_CONTACTID);
1732 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
1736 ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group);
1738 dev_warn(&hdev->dev, "Cannot allocate sysfs group for %s\n",
1739 hdev->name);
1741 mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true);
1747 static int mt_reset_resume(struct hid_device *hdev)
1749 mt_release_contacts(hdev);
1750 mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true);
1754 static int mt_resume(struct hid_device *hdev)
1760 hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE);
1766 static void mt_remove(struct hid_device *hdev)
1768 struct mt_device *td = hid_get_drvdata(hdev);
1772 sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group);
1773 hid_hw_stop(hdev);