Lines Matching full:hid

3  *  Force feedback driver for USB HID PID compliant devices
19 #include <linux/hid.h>
145 struct hid_device *hid; member
250 hid_dbg(pidff->hid, "attack %u => %d\n", in pidff_set_envelope_report()
254 hid_hw_request(pidff->hid, pidff->reports[PID_SET_ENVELOPE], in pidff_set_envelope_report()
281 hid_hw_request(pidff->hid, pidff->reports[PID_SET_CONSTANT], in pidff_set_constant_force_report()
316 hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT], in pidff_set_effect_report()
348 hid_hw_request(pidff->hid, pidff->reports[PID_SET_PERIODIC], in pidff_set_periodic_report()
390 hid_hw_request(pidff->hid, pidff->reports[PID_SET_CONDITION], in pidff_set_condition_report()
431 hid_hw_request(pidff->hid, pidff->reports[PID_SET_RAMP], in pidff_set_ramp_force_report()
456 hid_hw_request(pidff->hid, pidff->reports[PID_CREATE_NEW_EFFECT], in pidff_request_effect_upload()
458 hid_dbg(pidff->hid, "create_new_effect sent, type: %d\n", efnum); in pidff_request_effect_upload()
462 hid_hw_wait(pidff->hid); in pidff_request_effect_upload()
465 hid_dbg(pidff->hid, "pid_block_load requested\n"); in pidff_request_effect_upload()
466 hid_hw_request(pidff->hid, pidff->reports[PID_BLOCK_LOAD], in pidff_request_effect_upload()
468 hid_hw_wait(pidff->hid); in pidff_request_effect_upload()
471 hid_dbg(pidff->hid, "device reported free memory: %d bytes\n", in pidff_request_effect_upload()
478 hid_dbg(pidff->hid, "not enough memory free: %d bytes\n", in pidff_request_effect_upload()
484 hid_err(pidff->hid, "pid_block_load failed 60 times\n"); in pidff_request_effect_upload()
504 hid_hw_request(pidff->hid, pidff->reports[PID_EFFECT_OPERATION], in pidff_playback_pid()
526 hid_hw_request(pidff->hid, pidff->reports[PID_BLOCK_FREE], in pidff_erase_pid()
538 hid_dbg(pidff->hid, "starting to erase %d/%d\n", in pidff_erase_effect()
542 hid_hw_wait(pidff->hid); in pidff_erase_effect()
603 hid_err(pidff->hid, "invalid waveform\n"); in pidff_upload_effect()
694 hid_err(pidff->hid, "invalid type\n"); in pidff_upload_effect()
702 hid_dbg(pidff->hid, "uploaded\n"); in pidff_upload_effect()
715 hid_hw_request(pidff->hid, pidff->reports[PID_DEVICE_GAIN], in pidff_set_gain()
741 hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT], in pidff_autocenter()
772 if (report->field[i]->usage[j].hid == in pidff_find_fields()
812 static void pidff_find_reports(struct hid_device *hid, int report_type, in pidff_find_reports() argument
819 &hid->report_enum[report_type].report_list, list) { in pidff_find_reports()
824 hid_dbg(hid, "found usage 0x%02x from field->logical\n", in pidff_find_reports()
833 * case we want the usage of the parent. However, Linux HID in pidff_find_reports()
839 hid->collection[i - 1].type != HID_COLLECTION_LOGICAL) in pidff_find_reports()
841 ret = pidff_check_usage(hid->collection[i - 1].usage); in pidff_find_reports()
843 hid_dbg(hid, in pidff_find_reports()
860 hid_dbg(pidff->hid, "%d missing\n", i); in pidff_reports_ok()
903 if (fld->usage[j].hid == (HID_UP_PID | usagetable[i])) { in pidff_find_special_keys()
922 hid_dbg(pidff->hid, "finding special fields\n"); in pidff_find_special_fields()
943 hid_dbg(pidff->hid, "search done\n"); in pidff_find_special_fields()
946 hid_err(pidff->hid, "effect lists not found\n"); in pidff_find_special_fields()
951 hid_err(pidff->hid, "direction field not found\n"); in pidff_find_special_fields()
956 hid_err(pidff->hid, "device control field not found\n"); in pidff_find_special_fields()
961 hid_err(pidff->hid, "block load status field not found\n"); in pidff_find_special_fields()
966 hid_err(pidff->hid, "effect operation field not found\n"); in pidff_find_special_fields()
978 hid_err(pidff->hid, "no effect types found\n"); in pidff_find_special_fields()
985 hid_err(pidff->hid, in pidff_find_special_fields()
993 hid_err(pidff->hid, "effect operation identifiers not found\n"); in pidff_find_special_fields()
1010 if (pidff->set_effect_type->usage[pidff_type].hid != in pidff_find_effects()
1011 pidff->create_new_effect_type->usage[pidff_type].hid) { in pidff_find_effects()
1012 hid_err(pidff->hid, in pidff_find_effects()
1068 hid_err(pidff->hid, "unknown set_effect report layout\n"); in pidff_init_fields()
1074 hid_err(pidff->hid, "unknown pid_block_load report layout\n"); in pidff_init_fields()
1079 hid_err(pidff->hid, "unknown effect_operation report layout\n"); in pidff_init_fields()
1084 hid_err(pidff->hid, "unknown pid_block_free report layout\n"); in pidff_init_fields()
1096 hid_warn(pidff->hid, in pidff_init_fields()
1099 hid_warn(pidff->hid, in pidff_init_fields()
1103 hid_warn(pidff->hid, in pidff_init_fields()
1109 hid_warn(pidff->hid, "unknown constant effect layout\n"); in pidff_init_fields()
1115 hid_warn(pidff->hid, "unknown ramp effect layout\n"); in pidff_init_fields()
1124 hid_warn(pidff->hid, "unknown condition effect layout\n"); in pidff_init_fields()
1133 hid_warn(pidff->hid, "unknown periodic effect layout\n"); in pidff_init_fields()
1150 struct hid_device *hid = pidff->hid; in pidff_reset() local
1155 hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); in pidff_reset()
1156 hid_hw_wait(hid); in pidff_reset()
1157 hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); in pidff_reset()
1158 hid_hw_wait(hid); in pidff_reset()
1162 hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); in pidff_reset()
1163 hid_hw_wait(hid); in pidff_reset()
1166 hid_hw_request(hid, pidff->reports[PID_POOL], HID_REQ_GET_REPORT); in pidff_reset()
1167 hid_hw_wait(hid); in pidff_reset()
1172 hid_warn(pidff->hid, in pidff_reset()
1177 hid_dbg(pidff->hid, "pid_pool requested again\n"); in pidff_reset()
1178 hid_hw_request(hid, pidff->reports[PID_POOL], in pidff_reset()
1180 hid_hw_wait(hid); in pidff_reset()
1203 hid_err(pidff->hid, "upload request failed\n"); in pidff_check_autocenter()
1212 hid_notice(pidff->hid, in pidff_check_autocenter()
1226 int hid_pidff_init(struct hid_device *hid) in hid_pidff_init() argument
1229 struct hid_input *hidinput = list_entry(hid->inputs.next, in hid_pidff_init()
1236 hid_dbg(hid, "starting pid init\n"); in hid_pidff_init()
1238 if (list_empty(&hid->report_enum[HID_OUTPUT_REPORT].report_list)) { in hid_pidff_init()
1239 hid_dbg(hid, "not a PID device, no output report\n"); in hid_pidff_init()
1247 pidff->hid = hid; in hid_pidff_init()
1249 hid_device_io_start(hid); in hid_pidff_init()
1251 pidff_find_reports(hid, HID_OUTPUT_REPORT, pidff); in hid_pidff_init()
1252 pidff_find_reports(hid, HID_FEATURE_REPORT, pidff); in hid_pidff_init()
1255 hid_dbg(hid, "reports not ok, aborting\n"); in hid_pidff_init()
1268 hid_hw_request(hid, pidff->reports[PID_DEVICE_GAIN], in hid_pidff_init()
1280 hid_dbg(hid, "max effects is %d\n", max_effects); in hid_pidff_init()
1286 hid_dbg(hid, "max simultaneous effects is %d\n", in hid_pidff_init()
1290 hid_dbg(hid, "device memory size is %d bytes\n", in hid_pidff_init()
1296 hid_notice(hid, in hid_pidff_init()
1313 …hid_info(dev, "Force feedback for USB HID PID devices by Anssi Hannula <anssi.hannula@gmail.com>\n… in hid_pidff_init()
1315 hid_device_io_stop(hid); in hid_pidff_init()
1320 hid_device_io_stop(hid); in hid_pidff_init()