Lines Matching refs:field
97 struct hid_field *field; in hid_register_field() local
104 field = kzalloc((sizeof(struct hid_field) + in hid_register_field()
107 if (!field) in hid_register_field()
110 field->index = report->maxfield++; in hid_register_field()
111 report->field[field->index] = field; in hid_register_field()
112 field->usage = (struct hid_usage *)(field + 1); in hid_register_field()
113 field->value = (s32 *)(field->usage + usages); in hid_register_field()
114 field->new_value = (s32 *)(field->value + usages); in hid_register_field()
115 field->usages_priorities = (s32 *)(field->new_value + usages); in hid_register_field()
116 field->report = report; in hid_register_field()
118 return field; in hid_register_field()
264 struct hid_field *field; in hid_add_field() local
311 field = hid_register_field(report, usages); in hid_add_field()
312 if (!field) in hid_add_field()
315 field->physical = hid_lookup_collection(parser, HID_COLLECTION_PHYSICAL); in hid_add_field()
316 field->logical = hid_lookup_collection(parser, HID_COLLECTION_LOGICAL); in hid_add_field()
317 field->application = application; in hid_add_field()
324 field->usage[i].hid = parser->local.usage[j]; in hid_add_field()
325 field->usage[i].collection_index = in hid_add_field()
327 field->usage[i].usage_index = i; in hid_add_field()
328 field->usage[i].resolution_multiplier = 1; in hid_add_field()
331 field->maxusage = usages; in hid_add_field()
332 field->flags = flags; in hid_add_field()
333 field->report_offset = offset; in hid_add_field()
334 field->report_type = report_type; in hid_add_field()
335 field->report_size = parser->global.report_size; in hid_add_field()
336 field->report_count = parser->global.report_count; in hid_add_field()
337 field->logical_minimum = parser->global.logical_minimum; in hid_add_field()
338 field->logical_maximum = parser->global.logical_maximum; in hid_add_field()
339 field->physical_minimum = parser->global.physical_minimum; in hid_add_field()
340 field->physical_maximum = parser->global.physical_maximum; in hid_add_field()
341 field->unit_exponent = parser->global.unit_exponent; in hid_add_field()
342 field->unit = parser->global.unit; in hid_add_field()
670 kfree(report->field[n]); in hid_free_report()
1016 if (report->field[field_index]->report_count < report_counts) { in hid_validate_values()
1065 struct hid_field *field, in hid_apply_multiplier_to_field() argument
1079 for (i = 0; i < field->maxusage; i++) { in hid_apply_multiplier_to_field()
1080 usage = &field->usage[i]; in hid_apply_multiplier_to_field()
1099 struct hid_field *field; in hid_apply_multiplier() local
1132 field = rep->field[i]; in hid_apply_multiplier()
1133 hid_apply_multiplier_to_field(hid, field, in hid_apply_multiplier()
1174 if (rep->field[i]->report_count < 1) in hid_setup_resolution_multiplier()
1177 for (j = 0; j < rep->field[i]->maxusage; j++) { in hid_setup_resolution_multiplier()
1178 usage = &rep->field[i]->usage[j]; in hid_setup_resolution_multiplier()
1181 rep->field[i]); in hid_setup_resolution_multiplier()
1518 static void hid_process_event(struct hid_device *hid, struct hid_field *field, in hid_process_event() argument
1528 ret = hdrv->event(hid, field, usage, value); in hid_process_event()
1538 hidinput_hid_event(hid, field, usage, value); in hid_process_event()
1540 hid->hiddev_hid_event(hid, field, usage, value); in hid_process_event()
1546 static inline int hid_array_value_is_valid(struct hid_field *field, in hid_array_value_is_valid() argument
1549 __s32 min = field->logical_minimum; in hid_array_value_is_valid()
1557 value <= field->logical_maximum && in hid_array_value_is_valid()
1558 value - min < field->maxusage; in hid_array_value_is_valid()
1566 struct hid_field *field, in hid_input_fetch_field() argument
1570 unsigned count = field->report_count; in hid_input_fetch_field()
1571 unsigned offset = field->report_offset; in hid_input_fetch_field()
1572 unsigned size = field->report_size; in hid_input_fetch_field()
1573 __s32 min = field->logical_minimum; in hid_input_fetch_field()
1576 value = field->new_value; in hid_input_fetch_field()
1578 field->ignored = false; in hid_input_fetch_field()
1588 if (!(field->flags & HID_MAIN_ITEM_VARIABLE) && in hid_input_fetch_field()
1589 hid_array_value_is_valid(field, value[n]) && in hid_input_fetch_field()
1590 field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) { in hid_input_fetch_field()
1591 field->ignored = true; in hid_input_fetch_field()
1602 struct hid_field *field, in hid_input_var_field() argument
1605 unsigned int count = field->report_count; in hid_input_var_field()
1606 __s32 *value = field->new_value; in hid_input_var_field()
1611 field, in hid_input_var_field()
1612 &field->usage[n], in hid_input_var_field()
1616 memcpy(field->value, value, count * sizeof(__s32)); in hid_input_var_field()
1625 struct hid_field *field, in hid_input_array_field() argument
1629 unsigned int count = field->report_count; in hid_input_array_field()
1630 __s32 min = field->logical_minimum; in hid_input_array_field()
1633 value = field->new_value; in hid_input_array_field()
1636 if (field->ignored) in hid_input_array_field()
1640 if (hid_array_value_is_valid(field, field->value[n]) && in hid_input_array_field()
1641 search(value, field->value[n], count)) in hid_input_array_field()
1643 field, in hid_input_array_field()
1644 &field->usage[field->value[n] - min], in hid_input_array_field()
1648 if (hid_array_value_is_valid(field, value[n]) && in hid_input_array_field()
1649 search(field->value, value[n], count)) in hid_input_array_field()
1651 field, in hid_input_array_field()
1652 &field->usage[value[n] - min], in hid_input_array_field()
1657 memcpy(field->value, value, count * sizeof(__s32)); in hid_input_array_field()
1672 struct hid_field *field; in hid_process_report() local
1676 hid_input_fetch_field(hid, report->field[a], data); in hid_process_report()
1683 field = entry->field; in hid_process_report()
1685 if (field->flags & HID_MAIN_ITEM_VARIABLE) in hid_process_report()
1687 field, in hid_process_report()
1688 &field->usage[entry->index], in hid_process_report()
1689 field->new_value[entry->index], in hid_process_report()
1692 hid_input_array_field(hid, field, interrupt); in hid_process_report()
1697 field = report->field[a]; in hid_process_report()
1699 if (field->flags & HID_MAIN_ITEM_VARIABLE) in hid_process_report()
1700 memcpy(field->value, field->new_value, in hid_process_report()
1701 field->report_count * sizeof(__s32)); in hid_process_report()
1706 field = report->field[a]; in hid_process_report()
1708 if (field->flags & HID_MAIN_ITEM_VARIABLE) in hid_process_report()
1709 hid_input_var_field(hid, field, interrupt); in hid_process_report()
1711 hid_input_array_field(hid, field, interrupt); in hid_process_report()
1726 struct hid_field *field, in __hid_insert_field_entry() argument
1731 entry->field = field; in __hid_insert_field_entry()
1733 entry->priority = field->usages_priorities[usage_index]; in __hid_insert_field_entry()
1756 struct hid_field *field; in hid_report_process_ordering() local
1763 field = report->field[a]; in hid_report_process_ordering()
1765 if (field->flags & HID_MAIN_ITEM_VARIABLE) in hid_report_process_ordering()
1766 count += field->report_count; in hid_report_process_ordering()
1787 field = report->field[a]; in hid_report_process_ordering()
1789 if (field->flags & HID_MAIN_ITEM_VARIABLE) { in hid_report_process_ordering()
1790 for (u = 0; u < field->report_count; u++) { in hid_report_process_ordering()
1793 field, u); in hid_report_process_ordering()
1798 field, 0); in hid_report_process_ordering()
1818 struct hid_field *field, __u8 *data) in hid_output_field() argument
1820 unsigned count = field->report_count; in hid_output_field()
1821 unsigned offset = field->report_offset; in hid_output_field()
1822 unsigned size = field->report_size; in hid_output_field()
1826 if (field->logical_minimum < 0) /* signed values */ in hid_output_field()
1828 s32ton(field->value[n], size)); in hid_output_field()
1831 field->value[n]); in hid_output_field()
1860 hid_output_field(report->device, report->field[n], data); in hid_output_report()
1886 int hid_set_field(struct hid_field *field, unsigned offset, __s32 value) in hid_set_field() argument
1890 if (!field) in hid_set_field()
1893 size = field->report_size; in hid_set_field()
1895 hid_dump_input(field->report->device, field->usage + offset, value); in hid_set_field()
1897 if (offset >= field->report_count) { in hid_set_field()
1898 hid_err(field->report->device, "offset (%d) exceeds report_count (%d)\n", in hid_set_field()
1899 offset, field->report_count); in hid_set_field()
1902 if (field->logical_minimum < 0) { in hid_set_field()
1904 hid_err(field->report->device, "value %d is out of range\n", value); in hid_set_field()
1908 field->value[offset] = value; in hid_set_field()