Lines Matching refs:hidinput
51 #define map_abs(c) hid_map_usage(hidinput, usage, &bit, &max, EV_ABS, (c))
52 #define map_rel(c) hid_map_usage(hidinput, usage, &bit, &max, EV_REL, (c))
53 #define map_key(c) hid_map_usage(hidinput, usage, &bit, &max, EV_KEY, (c))
54 #define map_led(c) hid_map_usage(hidinput, usage, &bit, &max, EV_LED, (c))
56 #define map_abs_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \
58 #define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \
562 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, in hidinput_configure_usage() argument
565 struct input_dev *input = hidinput->input; in hidinput_configure_usage()
570 field->hidinput = hidinput; in hidinput_configure_usage()
586 int ret = device->driver->input_mapping(device, hidinput, field, in hidinput_configure_usage()
1143 device->driver->input_mapped(device, hidinput, field, usage, in hidinput_configure_usage()
1283 if (!field->hidinput) in hidinput_hid_event()
1286 input = field->hidinput->input; in hidinput_hid_event()
1410 struct hid_input *hidinput; in hidinput_report_event() local
1415 list_for_each_entry(hidinput, &hid->inputs, list) in hidinput_report_event()
1416 input_sync(hidinput->input); in hidinput_report_event()
1678 struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); in hidinput_allocate() local
1683 if (!hidinput || !input_dev) in hidinput_allocate()
1729 hidinput->name = kasprintf(GFP_KERNEL, "%s %s", in hidinput_allocate()
1731 if (!hidinput->name) in hidinput_allocate()
1743 input_dev->name = hidinput->name ? hidinput->name : hid->name; in hidinput_allocate()
1752 hidinput->input = input_dev; in hidinput_allocate()
1753 hidinput->application = application; in hidinput_allocate()
1754 list_add_tail(&hidinput->list, &hid->inputs); in hidinput_allocate()
1756 INIT_LIST_HEAD(&hidinput->reports); in hidinput_allocate()
1758 return hidinput; in hidinput_allocate()
1761 kfree(hidinput); in hidinput_allocate()
1767 static bool hidinput_has_been_populated(struct hid_input *hidinput) in hidinput_has_been_populated() argument
1773 r |= hidinput->input->evbit[i]; in hidinput_has_been_populated()
1776 r |= hidinput->input->keybit[i]; in hidinput_has_been_populated()
1779 r |= hidinput->input->relbit[i]; in hidinput_has_been_populated()
1782 r |= hidinput->input->absbit[i]; in hidinput_has_been_populated()
1785 r |= hidinput->input->mscbit[i]; in hidinput_has_been_populated()
1788 r |= hidinput->input->ledbit[i]; in hidinput_has_been_populated()
1791 r |= hidinput->input->sndbit[i]; in hidinput_has_been_populated()
1794 r |= hidinput->input->ffbit[i]; in hidinput_has_been_populated()
1797 r |= hidinput->input->swbit[i]; in hidinput_has_been_populated()
1803 struct hid_input *hidinput) in hidinput_cleanup_hidinput() argument
1808 list_del(&hidinput->list); in hidinput_cleanup_hidinput()
1809 input_free_device(hidinput->input); in hidinput_cleanup_hidinput()
1810 kfree(hidinput->name); in hidinput_cleanup_hidinput()
1821 if (report->field[i]->hidinput == hidinput) in hidinput_cleanup_hidinput()
1822 report->field[i]->hidinput = NULL; in hidinput_cleanup_hidinput()
1826 kfree(hidinput); in hidinput_cleanup_hidinput()
1832 struct hid_input *hidinput; in hidinput_match() local
1834 list_for_each_entry(hidinput, &hid->inputs, list) { in hidinput_match()
1835 if (hidinput->report && in hidinput_match()
1836 hidinput->report->id == report->id) in hidinput_match()
1837 return hidinput; in hidinput_match()
1846 struct hid_input *hidinput; in hidinput_match_application() local
1848 list_for_each_entry(hidinput, &hid->inputs, list) { in hidinput_match_application()
1849 if (hidinput->application == report->application) in hidinput_match_application()
1850 return hidinput; in hidinput_match_application()
1856 static inline void hidinput_configure_usages(struct hid_input *hidinput, in hidinput_configure_usages() argument
1863 hidinput_configure_usage(hidinput, report->field[i], in hidinput_configure_usages()
1877 struct hid_input *next, *hidinput = NULL; in hidinput_connect() local
1918 hidinput = hidinput_match(report); in hidinput_connect()
1921 hidinput = hidinput_match_application(report); in hidinput_connect()
1923 if (!hidinput) { in hidinput_connect()
1924 hidinput = hidinput_allocate(hid, application); in hidinput_connect()
1925 if (!hidinput) in hidinput_connect()
1929 hidinput_configure_usages(hidinput, report); in hidinput_connect()
1932 hidinput->report = report; in hidinput_connect()
1935 &hidinput->reports); in hidinput_connect()
1941 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { in hidinput_connect()
1943 drv->input_configured(hid, hidinput)) in hidinput_connect()
1946 if (!hidinput_has_been_populated(hidinput)) { in hidinput_connect()
1948 hidinput_cleanup_hidinput(hid, hidinput); in hidinput_connect()
1952 if (input_register_device(hidinput->input)) in hidinput_connect()
1954 hidinput->registered = true; in hidinput_connect()
1978 struct hid_input *hidinput, *next; in hidinput_disconnect() local
1982 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { in hidinput_disconnect()
1983 list_del(&hidinput->list); in hidinput_disconnect()
1984 if (hidinput->registered) in hidinput_disconnect()
1985 input_unregister_device(hidinput->input); in hidinput_disconnect()
1987 input_free_device(hidinput->input); in hidinput_disconnect()
1988 kfree(hidinput->name); in hidinput_disconnect()
1989 kfree(hidinput); in hidinput_disconnect()