Lines Matching refs:hdev

275 	struct hid_device *hdev = container_of(dev, struct hid_device, dev);  in mt_show_quirks()  local
276 struct mt_device *td = hid_get_drvdata(hdev); in mt_show_quirks()
285 struct hid_device *hdev = container_of(dev, struct hid_device, dev); in mt_set_quirks() local
286 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_quirks()
312 static void mt_get_feature(struct hid_device *hdev, struct hid_report *report) in mt_get_feature() argument
314 struct mt_device *td = hid_get_drvdata(hdev); in mt_get_feature()
323 if (!(hdev->quirks & HID_QUIRK_NO_INIT_REPORTS)) in mt_get_feature()
332 ret = hid_hw_raw_request(hdev, report->id, buf, size, in mt_get_feature()
335 dev_warn(&hdev->dev, "failed to fetch feature %d\n", in mt_get_feature()
338 ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, buf, in mt_get_feature()
341 dev_warn(&hdev->dev, "failed to report feature\n"); in mt_get_feature()
347 static void mt_feature_mapping(struct hid_device *hdev, in mt_feature_mapping() argument
350 struct mt_device *td = hid_get_drvdata(hdev); in mt_feature_mapping()
356 dev_err(&hdev->dev, "HID_DG_INPUTMODE out of range\n"); in mt_feature_mapping()
370 dev_info(&hdev->dev, in mt_feature_mapping()
376 mt_get_feature(hdev, field->report); in mt_feature_mapping()
390 dev_err(&hdev->dev, "HID_DG_BUTTONTYPE out of range\n"); in mt_feature_mapping()
394 mt_get_feature(hdev, field->report); in mt_feature_mapping()
402 mt_get_feature(hdev, field->report); in mt_feature_mapping()
428 static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, in mt_touch_input_mapping() argument
432 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_mapping()
577 static int mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi, in mt_touch_input_mapped() argument
782 static int mt_touch_input_configured(struct hid_device *hdev, in mt_touch_input_configured() argument
785 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_configured()
818 static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, in mt_input_mapping() argument
822 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapping()
852 return mt_touch_input_mapping(hdev, hi, field, usage, bit, max); in mt_input_mapping()
858 static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi, in mt_input_mapped() argument
871 return mt_touch_input_mapped(hdev, hi, field, usage, bit, max); in mt_input_mapped()
903 static void mt_set_input_mode(struct hid_device *hdev) in mt_set_input_mode() argument
905 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_input_mode()
915 re = &(hdev->report_enum[HID_FEATURE_REPORT]); in mt_set_input_mode()
922 hid_err(hdev, "failed to allocate buffer for report\n"); in mt_set_input_mode()
925 hid_hw_raw_request(hdev, r->id, buf, report_len, in mt_set_input_mode()
931 hid_hw_request(hdev, r, HID_REQ_SET_REPORT); in mt_set_input_mode()
935 static void mt_set_maxcontacts(struct hid_device *hdev) in mt_set_maxcontacts() argument
937 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_maxcontacts()
948 re = &hdev->report_enum[HID_FEATURE_REPORT]; in mt_set_maxcontacts()
956 hid_hw_request(hdev, r, HID_REQ_SET_REPORT); in mt_set_maxcontacts()
991 static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi) in mt_input_configured() argument
993 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_configured()
1000 ret = mt_touch_input_configured(hdev, hi); in mt_input_configured()
1050 strlen(hdev->name) + strlen(suffix) + 2, in mt_input_configured()
1053 sprintf(name, "%s %s", hdev->name, suffix); in mt_input_configured()
1061 static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) in mt_probe() argument
1077 hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC; in mt_probe()
1084 hdev->quirks |= HID_QUIRK_MULTI_INPUT; in mt_probe()
1085 hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT; in mt_probe()
1102 hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; in mt_probe()
1104 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); in mt_probe()
1106 dev_err(&hdev->dev, "cannot allocate multitouch data\n"); in mt_probe()
1115 hid_set_drvdata(hdev, td); in mt_probe()
1117 td->fields = devm_kzalloc(&hdev->dev, sizeof(struct mt_fields), in mt_probe()
1120 dev_err(&hdev->dev, "cannot allocate multitouch fields data\n"); in mt_probe()
1127 ret = hid_parse(hdev); in mt_probe()
1131 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); in mt_probe()
1135 ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group); in mt_probe()
1137 mt_set_maxcontacts(hdev); in mt_probe()
1138 mt_set_input_mode(hdev); in mt_probe()
1141 devm_kfree(&hdev->dev, td->fields); in mt_probe()
1148 static int mt_reset_resume(struct hid_device *hdev) in mt_reset_resume() argument
1150 mt_set_maxcontacts(hdev); in mt_reset_resume()
1151 mt_set_input_mode(hdev); in mt_reset_resume()
1155 static int mt_resume(struct hid_device *hdev) in mt_resume() argument
1161 hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE); in mt_resume()
1167 static void mt_remove(struct hid_device *hdev) in mt_remove() argument
1169 sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group); in mt_remove()
1170 hid_hw_stop(hdev); in mt_remove()