Lines Matching refs:field
143 for (j = 0; j < report->field[i]->maxusage; j++) { in hidinput_find_key()
144 usage = report->field[i]->usage + j; in hidinput_find_key()
246 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) in hidinput_calc_abs_res() argument
248 __s32 unit_exponent = field->unit_exponent; in hidinput_calc_abs_res()
249 __s32 logical_extents = field->logical_maximum - in hidinput_calc_abs_res()
250 field->logical_minimum; in hidinput_calc_abs_res()
251 __s32 physical_extents = field->physical_maximum - in hidinput_calc_abs_res()
252 field->physical_minimum; in hidinput_calc_abs_res()
273 if (field->unit == 0x11) { /* If centimeters */ in hidinput_calc_abs_res()
276 } else if (field->unit == 0x13) { /* If inches */ in hidinput_calc_abs_res()
294 if (field->unit == 0x14) { /* If degrees */ in hidinput_calc_abs_res()
301 } else if (field->unit != 0x12) { /* If not radians */ in hidinput_calc_abs_res()
511 struct hid_field *field, bool is_percentage) in hidinput_setup_battery() argument
548 min = field->logical_minimum; in hidinput_setup_battery()
549 max = field->logical_maximum; in hidinput_setup_battery()
562 dev->battery_report_id = field->report->id; in hidinput_setup_battery()
571 field->physical == HID_DG_STYLUS; in hidinput_setup_battery()
647 struct hid_field *field, bool is_percentage) in hidinput_setup_battery() argument
667 static bool hidinput_field_in_collection(struct hid_device *device, struct hid_field *field, in hidinput_field_in_collection() argument
672 collection = &device->collection[field->usage->collection_index]; in hidinput_field_in_collection()
677 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, in hidinput_configure_usage() argument
687 field->hidinput = hidinput; in hidinput_configure_usage()
689 if (field->flags & HID_MAIN_ITEM_CONSTANT) in hidinput_configure_usage()
693 if (field->report_count < 1) in hidinput_configure_usage()
697 if (field->report_type == HID_OUTPUT_REPORT && in hidinput_configure_usage()
707 field->usages_priorities[usage_index] = in hidinput_configure_usage()
718 field->usages_priorities[usage_index] |= in hidinput_configure_usage()
721 field->usages_priorities[usage_index] |= in hidinput_configure_usage()
722 (0xff - field->slot_idx) << 16; in hidinput_configure_usage()
725 int ret = device->driver->input_mapping(device, hidinput, field, in hidinput_configure_usage()
751 switch (field->application) { in hidinput_configure_usage()
767 if (hidinput_field_in_collection(device, field, in hidinput_configure_usage()
778 switch (field->physical) { in hidinput_configure_usage()
846 if (field->application == HID_GD_SYSTEM_CONTROL) in hidinput_configure_usage()
857 if (field->dpad) { in hidinput_configure_usage()
858 map_abs(field->dpad); in hidinput_configure_usage()
869 if (field->flags & HID_MAIN_ITEM_RELATIVE) in hidinput_configure_usage()
876 if (field->flags & HID_MAIN_ITEM_RELATIVE) { in hidinput_configure_usage()
884 if (field->flags & HID_MAIN_ITEM_RELATIVE) in hidinput_configure_usage()
891 usage->hat_min = field->logical_minimum; in hidinput_configure_usage()
892 usage->hat_max = field->logical_maximum; in hidinput_configure_usage()
901 if (field->application == HID_GD_WIRELESS_RADIO_CTLS) { in hidinput_configure_usage()
904 field->flags |= HID_MAIN_ITEM_RELATIVE; in hidinput_configure_usage()
933 if ((field->application & 0xff) == 0x01) /* Digitizer */ in hidinput_configure_usage()
935 else if ((field->application & 0xff) == 0x02) /* Pen */ in hidinput_configure_usage()
952 switch (field->physical) { in hidinput_configure_usage()
964 if (!field->physical) { in hidinput_configure_usage()
965 switch (field->application) { in hidinput_configure_usage()
981 hidinput_setup_battery(device, HID_INPUT_REPORT, field, false); in hidinput_configure_usage()
1252 hidinput_setup_battery(device, HID_INPUT_REPORT, field, false); in hidinput_configure_usage()
1261 hidinput_setup_battery(device, HID_INPUT_REPORT, field, true); in hidinput_configure_usage()
1332 if (field->report_size == 1) { in hidinput_configure_usage()
1333 if (field->report->type == HID_OUTPUT_REPORT) { in hidinput_configure_usage()
1340 if (field->flags & HID_MAIN_ITEM_RELATIVE) { in hidinput_configure_usage()
1354 device->driver->input_mapped(device, hidinput, field, usage, in hidinput_configure_usage()
1396 int a = field->logical_minimum; in hidinput_configure_usage()
1397 int b = field->logical_maximum; in hidinput_configure_usage()
1400 a = field->logical_minimum = 0; in hidinput_configure_usage()
1401 b = field->logical_maximum = 255; in hidinput_configure_usage()
1404 if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK) in hidinput_configure_usage()
1409 hidinput_calc_abs_res(field, usage->code)); in hidinput_configure_usage()
1423 if (usage->hat_dir && !field->dpad) in hidinput_configure_usage()
1424 field->dpad = usage->code; in hidinput_configure_usage()
1431 if ((usage->type == EV_ABS) && (field->flags & HID_MAIN_ITEM_RELATIVE) && in hidinput_configure_usage()
1509 void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, _… in hidinput_hid_event() argument
1512 struct hid_report *report = field->report; in hidinput_hid_event()
1527 if (!field->hidinput) in hidinput_hid_event()
1530 input = field->hidinput->input; in hidinput_hid_event()
1553 if ((field->flags & HID_MAIN_ITEM_VARIABLE) && in hidinput_hid_event()
1554 field->logical_minimum < field->logical_maximum) { in hidinput_hid_event()
1555 if (field->flags & HID_MAIN_ITEM_NULL_STATE && in hidinput_hid_event()
1556 (value < field->logical_minimum || in hidinput_hid_event()
1557 value > field->logical_maximum)) { in hidinput_hid_event()
1562 field->logical_minimum, in hidinput_hid_event()
1563 field->logical_maximum); in hidinput_hid_event()
1641 int a = field->logical_minimum; in hidinput_hid_event()
1642 int b = field->logical_maximum; in hidinput_hid_event()
1675 if ((field->flags & HID_MAIN_ITEM_RELATIVE) && in hidinput_hid_event()
1691 value = field->logical_maximum - value; in hidinput_hid_event()
1705 if (!(field->flags & (HID_MAIN_ITEM_RELATIVE | in hidinput_hid_event()
1707 (field->flags & HID_MAIN_ITEM_VARIABLE) && in hidinput_hid_event()
1708 usage->usage_index < field->maxusage && in hidinput_hid_event()
1709 value == field->value[usage->usage_index]) in hidinput_hid_event()
1719 if ((field->flags & HID_MAIN_ITEM_RELATIVE) && in hidinput_hid_event()
1739 unsigned int code, struct hid_field **field) in hidinput_find_field() argument
1746 *field = report->field[i]; in hidinput_find_field()
1747 for (j = 0; j < (*field)->maxusage; j++) in hidinput_find_field()
1748 if ((*field)->usage[j].type == type && (*field)->usage[j].code == code) in hidinput_find_field()
1758 struct hid_field *field; in hidinput_get_led_field() local
1765 field = report->field[i]; in hidinput_get_led_field()
1766 for (j = 0; j < field->maxusage; j++) in hidinput_get_led_field()
1767 if (field->usage[j].type == EV_LED) in hidinput_get_led_field()
1768 return field; in hidinput_get_led_field()
1778 struct hid_field *field; in hidinput_count_leds() local
1786 field = report->field[i]; in hidinput_count_leds()
1787 for (j = 0; j < field->maxusage; j++) in hidinput_count_leds()
1788 if (field->usage[j].type == EV_LED && in hidinput_count_leds()
1789 field->value[j]) in hidinput_count_leds()
1801 struct hid_field *field; in hidinput_led_worker() local
1807 field = hidinput_get_led_field(hid); in hidinput_led_worker()
1808 if (!field) in hidinput_led_worker()
1824 report = field->report; in hidinput_led_worker()
1849 struct hid_field *field; in hidinput_input_event() local
1858 if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { in hidinput_input_event()
1863 hid_set_field(field, offset, value); in hidinput_input_event()
1896 report->field[i]->logical_maximum : in __hidinput_change_resolution_multipliers()
1897 report->field[i]->logical_minimum; in __hidinput_change_resolution_multipliers()
1903 if (report->field[i]->report_count != 1) in __hidinput_change_resolution_multipliers()
1906 for (j = 0; j < report->field[i]->maxusage; j++) { in __hidinput_change_resolution_multipliers()
1907 usage = &report->field[i]->usage[j]; in __hidinput_change_resolution_multipliers()
1931 report->field[i]->value[j] = value; in __hidinput_change_resolution_multipliers()
1976 if (rep->field[i]->report_count < 1) in report_features()
1979 for (j = 0; j < rep->field[i]->maxusage; j++) { in report_features()
1980 usage = &rep->field[i]->usage[j]; in report_features()
1985 rep->field[i], false); in report_features()
1988 drv->feature_mapping(hid, rep->field[i], usage); in report_features()
2149 if (report->field[i]->hidinput == hidinput) in hidinput_cleanup_hidinput()
2150 report->field[i]->hidinput = NULL; in hidinput_cleanup_hidinput()
2202 struct hid_field *field; in hidinput_configure_usages() local
2209 field = report->field[i]; in hidinput_configure_usages()
2212 if (field->maxusage < 1) in hidinput_configure_usages()
2218 if (prev_collection_index != field->usage->collection_index) { in hidinput_configure_usages()
2219 prev_collection_index = field->usage->collection_index; in hidinput_configure_usages()
2227 if (slot_collection_index == field->usage->collection_index) { in hidinput_configure_usages()
2228 field->slot_idx = slot_idx; in hidinput_configure_usages()
2233 for (j = 0; j < field->maxusage; j++) { in hidinput_configure_usages()
2234 if (field->usage[j].hid == HID_DG_CONTACTID) { in hidinput_configure_usages()
2235 slot_collection_index = field->usage->collection_index; in hidinput_configure_usages()
2243 report->field[k]->slot_idx = slot_idx; in hidinput_configure_usages()
2250 for (j = 0; j < report->field[i]->maxusage; j++) in hidinput_configure_usages()
2251 hidinput_configure_usage(hidinput, report->field[i], in hidinput_configure_usages()
2252 report->field[i]->usage + j, in hidinput_configure_usages()