Lines Matching refs:code
73 return (usage->type == EV_KEY && usage->code == keycode);
141 usage->code : KEY_RESERVED;
162 usage->code : KEY_RESERVED;
163 usage->code = ke->keycode;
166 set_bit(usage->code, dev->keybit);
167 dbg_hid("Assigned keycode %d to HID usage code %x\n",
168 usage->code, usage->hid);
187 * @code: axis code
199 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
216 switch (code) {
571 int max = 0, code;
614 code = ((usage->hid - 1) & HID_USAGE);
618 case HID_GD_POINTER: code += BTN_MOUSE; break;
620 if (code <= 0xf)
621 code += BTN_JOYSTICK;
623 code += BTN_TRIGGER_HAPPY - 0x10;
626 if (code <= 0xf)
627 code += BTN_GAMEPAD;
629 code += BTN_TRIGGER_HAPPY - 0x10;
634 case HID_GD_POINTER: code += BTN_MOUSE; break;
635 case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
636 case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
637 default: code += BTN_MISC;
641 map_key(code);
856 usage->code = MSC_SERIAL;
1187 while (usage->code <= max && test_and_set_bit(usage->code, bit)) {
1189 usage->code = find_next_zero_bit(bit,
1191 usage->code);
1198 if (usage->code > max)
1206 if ((device->quirks & HID_QUIRK_BADPAD) && (usage->code == ABS_X || usage->code == ABS_Y)) {
1212 input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);
1213 else input_set_abs_params(input, usage->code, a, b, 0, 0);
1215 input_abs_set_res(input, usage->code,
1216 hidinput_calc_abs_res(field, usage->code));
1219 if (usage->code == ABS_MT_POSITION_X && input->hint_events_per_packet == 0)
1226 for (i = usage->code; i < usage->code + 2 && i <= max; i++) {
1231 field->dpad = usage->code;
1239 (usage->code == ABS_VOLUME)) {
1253 usage->code = 0;
1260 int code;
1266 if (usage->code == REL_WHEEL_HI_RES)
1267 code = REL_WHEEL;
1269 code = REL_HWHEEL;
1284 input_event(input, EV_REL, code, lo_res);
1285 input_event(input, EV_REL, usage->code, hi_res);
1307 (((*quirks & HID_QUIRK_X_INVERT) && usage->code == ABS_X) ||
1308 ((*quirks & HID_QUIRK_Y_INVERT) && usage->code == ABS_Y))) {
1317 input_event(input, usage->type, usage->code , hid_hat_to_axis[hat_dir].x);
1318 input_event(input, usage->type, usage->code + 1, hid_hat_to_axis[hat_dir].y);
1329 input_event(input, usage->type, (*quirks & HID_QUIRK_INVERT) ? BTN_TOOL_RUBBER : usage->code, 1);
1332 input_event(input, usage->type, usage->code, 0);
1353 if ((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UNKNOWN */
1356 if ((usage->type == EV_REL) && (usage->code == REL_WHEEL_HI_RES ||
1357 usage->code == REL_HWHEEL_HI_RES)) {
1363 (usage->code == ABS_VOLUME)) {
1418 /* report the usage code as scancode if the key status has changed */
1420 (!test_bit(usage->code, input->key)) == value)
1423 input_event(input, usage->type, usage->code, value);
1428 input_event(input, usage->type, usage->code, 0);
1444 int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field)
1453 if ((*field)->usage[j].type == type && (*field)->usage[j].code == code)
1552 unsigned int code, int value)
1559 return input_ff_event(dev, type, code, value);
1564 if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) {