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, \
580 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, in hidinput_configure_usage() argument
583 struct input_dev *input = hidinput->input; in hidinput_configure_usage()
588 field->hidinput = hidinput; in hidinput_configure_usage()
604 int ret = device->driver->input_mapping(device, hidinput, field, in hidinput_configure_usage()
1186 device->driver->input_mapped(device, hidinput, field, usage, in hidinput_configure_usage()
1326 if (!field->hidinput) in hidinput_hid_event()
1329 input = field->hidinput->input; in hidinput_hid_event()
1453 struct hid_input *hidinput; in hidinput_report_event() local
1458 list_for_each_entry(hidinput, &hid->inputs, list) in hidinput_report_event()
1459 input_sync(hidinput->input); in hidinput_report_event()
1721 struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); in hidinput_allocate() local
1726 if (!hidinput || !input_dev) in hidinput_allocate()
1772 hidinput->name = kasprintf(GFP_KERNEL, "%s %s", in hidinput_allocate()
1774 if (!hidinput->name) in hidinput_allocate()
1786 input_dev->name = hidinput->name ? hidinput->name : hid->name; in hidinput_allocate()
1795 hidinput->input = input_dev; in hidinput_allocate()
1796 hidinput->application = application; in hidinput_allocate()
1797 list_add_tail(&hidinput->list, &hid->inputs); in hidinput_allocate()
1799 INIT_LIST_HEAD(&hidinput->reports); in hidinput_allocate()
1801 return hidinput; in hidinput_allocate()
1804 kfree(hidinput); in hidinput_allocate()
1810 static bool hidinput_has_been_populated(struct hid_input *hidinput) in hidinput_has_been_populated() argument
1816 r |= hidinput->input->evbit[i]; in hidinput_has_been_populated()
1819 r |= hidinput->input->keybit[i]; in hidinput_has_been_populated()
1822 r |= hidinput->input->relbit[i]; in hidinput_has_been_populated()
1825 r |= hidinput->input->absbit[i]; in hidinput_has_been_populated()
1828 r |= hidinput->input->mscbit[i]; in hidinput_has_been_populated()
1831 r |= hidinput->input->ledbit[i]; in hidinput_has_been_populated()
1834 r |= hidinput->input->sndbit[i]; in hidinput_has_been_populated()
1837 r |= hidinput->input->ffbit[i]; in hidinput_has_been_populated()
1840 r |= hidinput->input->swbit[i]; in hidinput_has_been_populated()
1846 struct hid_input *hidinput) in hidinput_cleanup_hidinput() argument
1851 list_del(&hidinput->list); in hidinput_cleanup_hidinput()
1852 input_free_device(hidinput->input); in hidinput_cleanup_hidinput()
1853 kfree(hidinput->name); in hidinput_cleanup_hidinput()
1864 if (report->field[i]->hidinput == hidinput) in hidinput_cleanup_hidinput()
1865 report->field[i]->hidinput = NULL; in hidinput_cleanup_hidinput()
1869 kfree(hidinput); in hidinput_cleanup_hidinput()
1875 struct hid_input *hidinput; in hidinput_match() local
1877 list_for_each_entry(hidinput, &hid->inputs, list) { in hidinput_match()
1878 if (hidinput->report && in hidinput_match()
1879 hidinput->report->id == report->id) in hidinput_match()
1880 return hidinput; in hidinput_match()
1889 struct hid_input *hidinput; in hidinput_match_application() local
1891 list_for_each_entry(hidinput, &hid->inputs, list) { in hidinput_match_application()
1892 if (hidinput->application == report->application) in hidinput_match_application()
1893 return hidinput; in hidinput_match_application()
1901 hidinput->application == HID_GD_KEYBOARD) { in hidinput_match_application()
1902 return hidinput; in hidinput_match_application()
1909 static inline void hidinput_configure_usages(struct hid_input *hidinput, in hidinput_configure_usages() argument
1916 hidinput_configure_usage(hidinput, report->field[i], in hidinput_configure_usages()
1930 struct hid_input *next, *hidinput = NULL; in hidinput_connect() local
1971 hidinput = hidinput_match(report); in hidinput_connect()
1974 hidinput = hidinput_match_application(report); in hidinput_connect()
1976 if (!hidinput) { in hidinput_connect()
1977 hidinput = hidinput_allocate(hid, application); in hidinput_connect()
1978 if (!hidinput) in hidinput_connect()
1982 hidinput_configure_usages(hidinput, report); in hidinput_connect()
1985 hidinput->report = report; in hidinput_connect()
1988 &hidinput->reports); in hidinput_connect()
1994 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { in hidinput_connect()
1996 drv->input_configured(hid, hidinput)) in hidinput_connect()
1999 if (!hidinput_has_been_populated(hidinput)) { in hidinput_connect()
2001 hidinput_cleanup_hidinput(hid, hidinput); in hidinput_connect()
2005 if (input_register_device(hidinput->input)) in hidinput_connect()
2007 hidinput->registered = true; in hidinput_connect()
2031 struct hid_input *hidinput, *next; in hidinput_disconnect() local
2035 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { in hidinput_disconnect()
2036 list_del(&hidinput->list); in hidinput_disconnect()
2037 if (hidinput->registered) in hidinput_disconnect()
2038 input_unregister_device(hidinput->input); in hidinput_disconnect()
2040 input_free_device(hidinput->input); in hidinput_disconnect()
2041 kfree(hidinput->name); in hidinput_disconnect()
2042 kfree(hidinput); in hidinput_disconnect()