Lines Matching refs:code

119 	return (usage->type == EV_KEY && usage->code == keycode);
187 usage->code : KEY_RESERVED;
208 usage->code : KEY_RESERVED;
210 usage->code = ke->keycode;
213 set_bit(usage->code, dev->keybit);
214 dbg_hid("Assigned keycode %d to HID usage code %x\n",
215 usage->code, usage->hid);
234 * @code: axis code
246 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
263 switch (code) {
693 int max = 0, code;
759 code = ((usage->hid - 1) & HID_USAGE);
763 case HID_GD_POINTER: code += BTN_MOUSE; break;
765 if (code <= 0xf)
766 code += BTN_JOYSTICK;
768 code += BTN_TRIGGER_HAPPY - 0x10;
771 if (code <= 0xf)
772 code += BTN_GAMEPAD;
774 code += BTN_TRIGGER_HAPPY - 0x10;
780 if (code <= 0x1d)
781 code += KEY_MACRO1;
783 code += BTN_TRIGGER_HAPPY - 0x1e;
790 case HID_GD_POINTER: code += BTN_MOUSE; break;
791 case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
792 case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
793 default: code += BTN_MISC;
797 map_key(code);
1394 while (usage->code <= max && test_and_set_bit(usage->code, bit)) {
1396 usage->code = find_next_zero_bit(bit,
1398 usage->code);
1405 if (usage->code > max)
1413 if ((device->quirks & HID_QUIRK_BADPAD) && (usage->code == ABS_X || usage->code == ABS_Y)) {
1419 input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);
1420 else input_set_abs_params(input, usage->code, a, b, 0, 0);
1422 input_abs_set_res(input, usage->code,
1423 hidinput_calc_abs_res(field, usage->code));
1426 if (usage->code == ABS_MT_POSITION_X && input->hint_events_per_packet == 0)
1433 for (i = usage->code; i < usage->code + 2 && i <= max; i++) {
1438 field->dpad = usage->code;
1446 (usage->code == ABS_VOLUME)) {
1460 usage->code = 0;
1467 int code;
1473 if (usage->code == REL_WHEEL_HI_RES)
1474 code = REL_WHEEL;
1476 code = REL_HWHEEL;
1491 input_event(input, EV_REL, code, lo_res);
1492 input_event(input, EV_REL, usage->code, hi_res);
1551 input_event(input, usage->type, usage->code , hid_hat_to_axis[hat_dir].x);
1552 input_event(input, usage->type, usage->code + 1, hid_hat_to_axis[hat_dir].y);
1630 report->tool = usage->code;
1635 hid_report_release_tool(report, input, usage->code);
1676 if (usage->code == 0) /* Key 0 is "unassigned", not KEY_UNKNOWN */
1681 if (usage->code == REL_WHEEL_HI_RES ||
1682 usage->code == REL_HWHEEL_HI_RES) {
1690 usage->code == ABS_VOLUME) {
1703 } else if (((*quirks & HID_QUIRK_X_INVERT) && usage->code == ABS_X) ||
1704 ((*quirks & HID_QUIRK_Y_INVERT) && usage->code == ABS_Y))
1726 /* report the usage code as scancode if the key status has changed */
1728 (!test_bit(usage->code, input->key)) == value)
1731 input_event(input, usage->type, usage->code, value);
1736 input_event(input, usage->type, usage->code, 0);
1753 unsigned int code, struct hid_field **field)
1762 if ((*field)->usage[j].type == type && (*field)->usage[j].code == code)
1860 unsigned int code, int value)
1867 return input_ff_event(dev, type, code, value);
1872 if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) {