Lines Matching refs:field

143 				for (j = 0; j < report->field[i]->maxusage; j++) {
144 usage = report->field[i]->usage + j;
233 * @field: the HID report field to calculate resolution for
246 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
248 __s32 unit_exponent = field->unit_exponent;
249 __s32 logical_extents = field->logical_maximum -
250 field->logical_minimum;
251 __s32 physical_extents = field->physical_maximum -
252 field->physical_minimum;
273 if (field->unit == 0x11) { /* If centimeters */
276 } else if (field->unit == 0x13) { /* If inches */
294 if (field->unit == 0x14) { /* If degrees */
301 } else if (field->unit != 0x12) { /* If not radians */
524 struct hid_field *field, bool is_percentage)
561 min = field->logical_minimum;
562 max = field->logical_maximum;
575 dev->battery_report_id = field->report->id;
584 field->physical == HID_DG_STYLUS;
659 struct hid_field *field, bool is_percentage)
679 static bool hidinput_field_in_collection(struct hid_device *device, struct hid_field *field,
684 collection = &device->collection[field->usage->collection_index];
689 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
699 field->hidinput = hidinput;
701 if (field->flags & HID_MAIN_ITEM_CONSTANT)
705 if (field->report_count < 1)
709 if (field->report_type == HID_OUTPUT_REPORT &&
719 field->usages_priorities[usage_index] =
730 field->usages_priorities[usage_index] |=
733 field->usages_priorities[usage_index] |=
734 (0xff - field->slot_idx) << 16;
737 int ret = device->driver->input_mapping(device, hidinput, field,
763 switch (field->application) {
779 if (hidinput_field_in_collection(device, field,
790 switch (field->physical) {
858 if (field->application == HID_GD_SYSTEM_CONTROL)
869 if (field->dpad) {
870 map_abs(field->dpad);
881 if (field->flags & HID_MAIN_ITEM_RELATIVE)
888 if (field->flags & HID_MAIN_ITEM_RELATIVE) {
896 if (field->flags & HID_MAIN_ITEM_RELATIVE)
903 usage->hat_min = field->logical_minimum;
904 usage->hat_max = field->logical_maximum;
913 if (field->application == HID_GD_WIRELESS_RADIO_CTLS) {
916 field->flags |= HID_MAIN_ITEM_RELATIVE;
945 if ((field->application & 0xff) == 0x01) /* Digitizer */
947 else if ((field->application & 0xff) == 0x02) /* Pen */
964 switch (field->physical) {
976 if (!field->physical) {
977 switch (field->application) {
993 hidinput_setup_battery(device, HID_INPUT_REPORT, field, false);
1268 hidinput_setup_battery(device, HID_INPUT_REPORT, field, false);
1277 hidinput_setup_battery(device, HID_INPUT_REPORT, field, true);
1348 if (field->report_size == 1) {
1349 if (field->report->type == HID_OUTPUT_REPORT) {
1356 if (field->flags & HID_MAIN_ITEM_RELATIVE) {
1370 device->driver->input_mapped(device, hidinput, field, usage,
1412 int a = field->logical_minimum;
1413 int b = field->logical_maximum;
1416 a = field->logical_minimum = 0;
1417 b = field->logical_maximum = 255;
1420 if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK)
1425 hidinput_calc_abs_res(field, usage->code));
1439 if (usage->hat_dir && !field->dpad)
1440 field->dpad = usage->code;
1447 if ((usage->type == EV_ABS) && (field->flags & HID_MAIN_ITEM_RELATIVE) &&
1525 void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
1528 struct hid_report *report = field->report;
1543 if (!field->hidinput)
1546 input = field->hidinput->input;
1569 if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
1570 field->logical_minimum < field->logical_maximum) {
1571 if (field->flags & HID_MAIN_ITEM_NULL_STATE &&
1572 (value < field->logical_minimum ||
1573 value > field->logical_maximum)) {
1578 field->logical_minimum,
1579 field->logical_maximum);
1657 int a = field->logical_minimum;
1658 int b = field->logical_maximum;
1691 if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
1707 value = field->logical_maximum - value;
1721 if (!(field->flags & (HID_MAIN_ITEM_RELATIVE |
1723 (field->flags & HID_MAIN_ITEM_VARIABLE) &&
1724 usage->usage_index < field->maxusage &&
1725 value == field->value[usage->usage_index])
1735 if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
1755 unsigned int code, struct hid_field **field)
1762 *field = report->field[i];
1763 for (j = 0; j < (*field)->maxusage; j++)
1764 if ((*field)->usage[j].type == type && (*field)->usage[j].code == code)
1774 struct hid_field *field;
1781 field = report->field[i];
1782 for (j = 0; j < field->maxusage; j++)
1783 if (field->usage[j].type == EV_LED)
1784 return field;
1794 struct hid_field *field;
1802 field = report->field[i];
1803 for (j = 0; j < field->maxusage; j++)
1804 if (field->usage[j].type == EV_LED &&
1805 field->value[j])
1817 struct hid_field *field;
1823 field = hidinput_get_led_field(hid);
1824 if (!field)
1828 * field->report is accessed unlocked regarding HID core. So there might
1833 * field (even garbage). So the remote device will always get a valid
1840 report = field->report;
1865 struct hid_field *field;
1874 if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) {
1875 hid_warn(dev, "event field not found\n");
1879 hid_set_field(field, offset, value);
1912 report->field[i]->logical_maximum :
1913 report->field[i]->logical_minimum;
1919 if (report->field[i]->report_count != 1)
1922 for (j = 0; j < report->field[i]->maxusage; j++) {
1923 usage = &report->field[i]->usage[j];
1947 report->field[i]->value[j] = value;
1992 if (rep->field[i]->report_count < 1)
1995 for (j = 0; j < rep->field[i]->maxusage; j++) {
1996 usage = &rep->field[i]->usage[j];
2001 rep->field[i], false);
2004 drv->feature_mapping(hid, rep->field[i], usage);
2165 if (report->field[i]->hidinput == hidinput)
2166 report->field[i]->hidinput = NULL;
2218 struct hid_field *field;
2225 field = report->field[i];
2228 if (field->maxusage < 1)
2234 if (prev_collection_index != field->usage->collection_index) {
2235 prev_collection_index = field->usage->collection_index;
2243 if (slot_collection_index == field->usage->collection_index) {
2244 field->slot_idx = slot_idx;
2248 /* check if the current field has Contact ID */
2249 for (j = 0; j < field->maxusage; j++) {
2250 if (field->usage[j].hid == HID_DG_CONTACTID) {
2251 slot_collection_index = field->usage->collection_index;
2259 report->field[k]->slot_idx = slot_idx;
2266 for (j = 0; j < report->field[i]->maxusage; j++)
2267 hidinput_configure_usage(hidinput, report->field[i],
2268 report->field[i]->usage + j,
2275 * Read all reports and initialize the absolute field values.