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, \
566 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, in hidinput_configure_usage() argument
569 struct input_dev *input = hidinput->input; in hidinput_configure_usage()
574 field->hidinput = hidinput; in hidinput_configure_usage()
590 int ret = device->driver->input_mapping(device, hidinput, field, in hidinput_configure_usage()
1153 device->driver->input_mapped(device, hidinput, field, usage, in hidinput_configure_usage()
1293 if (!field->hidinput) in hidinput_hid_event()
1296 input = field->hidinput->input; in hidinput_hid_event()
1426 struct hid_input *hidinput; in hidinput_report_event() local
1431 list_for_each_entry(hidinput, &hid->inputs, list) in hidinput_report_event()
1432 input_sync(hidinput->input); in hidinput_report_event()
1694 struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); in hidinput_allocate() local
1699 if (!hidinput || !input_dev) in hidinput_allocate()
1745 hidinput->name = kasprintf(GFP_KERNEL, "%s %s", in hidinput_allocate()
1747 if (!hidinput->name) in hidinput_allocate()
1759 input_dev->name = hidinput->name ? hidinput->name : hid->name; in hidinput_allocate()
1768 hidinput->input = input_dev; in hidinput_allocate()
1769 hidinput->application = application; in hidinput_allocate()
1770 list_add_tail(&hidinput->list, &hid->inputs); in hidinput_allocate()
1772 INIT_LIST_HEAD(&hidinput->reports); in hidinput_allocate()
1774 return hidinput; in hidinput_allocate()
1777 kfree(hidinput); in hidinput_allocate()
1783 static bool hidinput_has_been_populated(struct hid_input *hidinput) in hidinput_has_been_populated() argument
1789 r |= hidinput->input->evbit[i]; in hidinput_has_been_populated()
1792 r |= hidinput->input->keybit[i]; in hidinput_has_been_populated()
1795 r |= hidinput->input->relbit[i]; in hidinput_has_been_populated()
1798 r |= hidinput->input->absbit[i]; in hidinput_has_been_populated()
1801 r |= hidinput->input->mscbit[i]; in hidinput_has_been_populated()
1804 r |= hidinput->input->ledbit[i]; in hidinput_has_been_populated()
1807 r |= hidinput->input->sndbit[i]; in hidinput_has_been_populated()
1810 r |= hidinput->input->ffbit[i]; in hidinput_has_been_populated()
1813 r |= hidinput->input->swbit[i]; in hidinput_has_been_populated()
1819 struct hid_input *hidinput) in hidinput_cleanup_hidinput() argument
1824 list_del(&hidinput->list); in hidinput_cleanup_hidinput()
1825 input_free_device(hidinput->input); in hidinput_cleanup_hidinput()
1826 kfree(hidinput->name); in hidinput_cleanup_hidinput()
1837 if (report->field[i]->hidinput == hidinput) in hidinput_cleanup_hidinput()
1838 report->field[i]->hidinput = NULL; in hidinput_cleanup_hidinput()
1842 kfree(hidinput); in hidinput_cleanup_hidinput()
1848 struct hid_input *hidinput; in hidinput_match() local
1850 list_for_each_entry(hidinput, &hid->inputs, list) { in hidinput_match()
1851 if (hidinput->report && in hidinput_match()
1852 hidinput->report->id == report->id) in hidinput_match()
1853 return hidinput; in hidinput_match()
1862 struct hid_input *hidinput; in hidinput_match_application() local
1864 list_for_each_entry(hidinput, &hid->inputs, list) { in hidinput_match_application()
1865 if (hidinput->application == report->application) in hidinput_match_application()
1866 return hidinput; in hidinput_match_application()
1872 static inline void hidinput_configure_usages(struct hid_input *hidinput, in hidinput_configure_usages() argument
1879 hidinput_configure_usage(hidinput, report->field[i], in hidinput_configure_usages()
1893 struct hid_input *next, *hidinput = NULL; in hidinput_connect() local
1934 hidinput = hidinput_match(report); in hidinput_connect()
1937 hidinput = hidinput_match_application(report); in hidinput_connect()
1939 if (!hidinput) { in hidinput_connect()
1940 hidinput = hidinput_allocate(hid, application); in hidinput_connect()
1941 if (!hidinput) in hidinput_connect()
1945 hidinput_configure_usages(hidinput, report); in hidinput_connect()
1948 hidinput->report = report; in hidinput_connect()
1951 &hidinput->reports); in hidinput_connect()
1957 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { in hidinput_connect()
1959 drv->input_configured(hid, hidinput)) in hidinput_connect()
1962 if (!hidinput_has_been_populated(hidinput)) { in hidinput_connect()
1964 hidinput_cleanup_hidinput(hid, hidinput); in hidinput_connect()
1968 if (input_register_device(hidinput->input)) in hidinput_connect()
1970 hidinput->registered = true; in hidinput_connect()
1994 struct hid_input *hidinput, *next; in hidinput_disconnect() local
1998 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { in hidinput_disconnect()
1999 list_del(&hidinput->list); in hidinput_disconnect()
2000 if (hidinput->registered) in hidinput_disconnect()
2001 input_unregister_device(hidinput->input); in hidinput_disconnect()
2003 input_free_device(hidinput->input); in hidinput_disconnect()
2004 kfree(hidinput->name); in hidinput_disconnect()
2005 kfree(hidinput); in hidinput_disconnect()