Lines Matching refs:input

17  * This driver will disable the lizard mode when the input device is opened
18 * and re-enable it when the input device is closed, so as not to break user
22 * the hidraw interface directly to create input devices (XTest, uinput...).
26 * - this input device will be removed, to avoid double input of the same
28 * When the client is closed, this input device will be created again.
37 #include <linux/input.h>
118 struct input_dev __rcu *input;
396 struct input_dev *input;
400 input = rcu_dereference(steam->input);
402 if (input) {
407 input = input_allocate_device();
408 if (!input)
411 input_set_drvdata(input, steam);
412 input->dev.parent = &hdev->dev;
413 input->open = steam_input_open;
414 input->close = steam_input_close;
416 input->name = (steam->quirks & STEAM_QUIRK_WIRELESS) ?
419 input->phys = hdev->phys;
420 input->uniq = steam->serial_no;
421 input->id.bustype = hdev->bus;
422 input->id.vendor = hdev->vendor;
423 input->id.product = hdev->product;
424 input->id.version = hdev->version;
426 input_set_capability(input, EV_KEY, BTN_TR2);
427 input_set_capability(input, EV_KEY, BTN_TL2);
428 input_set_capability(input, EV_KEY, BTN_TR);
429 input_set_capability(input, EV_KEY, BTN_TL);
430 input_set_capability(input, EV_KEY, BTN_Y);
431 input_set_capability(input, EV_KEY, BTN_B);
432 input_set_capability(input, EV_KEY, BTN_X);
433 input_set_capability(input, EV_KEY, BTN_A);
434 input_set_capability(input, EV_KEY, BTN_DPAD_UP);
435 input_set_capability(input, EV_KEY, BTN_DPAD_RIGHT);
436 input_set_capability(input, EV_KEY, BTN_DPAD_LEFT);
437 input_set_capability(input, EV_KEY, BTN_DPAD_DOWN);
438 input_set_capability(input, EV_KEY, BTN_SELECT);
439 input_set_capability(input, EV_KEY, BTN_MODE);
440 input_set_capability(input, EV_KEY, BTN_START);
441 input_set_capability(input, EV_KEY, BTN_GEAR_DOWN);
442 input_set_capability(input, EV_KEY, BTN_GEAR_UP);
443 input_set_capability(input, EV_KEY, BTN_THUMBR);
444 input_set_capability(input, EV_KEY, BTN_THUMBL);
445 input_set_capability(input, EV_KEY, BTN_THUMB);
446 input_set_capability(input, EV_KEY, BTN_THUMB2);
448 input_set_abs_params(input, ABS_HAT2Y, 0, 255, 0, 0);
449 input_set_abs_params(input, ABS_HAT2X, 0, 255, 0, 0);
450 input_set_abs_params(input, ABS_X, -32767, 32767, 0, 0);
451 input_set_abs_params(input, ABS_Y, -32767, 32767, 0, 0);
452 input_set_abs_params(input, ABS_RX, -32767, 32767,
454 input_set_abs_params(input, ABS_RY, -32767, 32767,
456 input_set_abs_params(input, ABS_HAT0X, -32767, 32767,
458 input_set_abs_params(input, ABS_HAT0Y, -32767, 32767,
460 input_abs_set_res(input, ABS_X, STEAM_JOYSTICK_RESOLUTION);
461 input_abs_set_res(input, ABS_Y, STEAM_JOYSTICK_RESOLUTION);
462 input_abs_set_res(input, ABS_RX, STEAM_PAD_RESOLUTION);
463 input_abs_set_res(input, ABS_RY, STEAM_PAD_RESOLUTION);
464 input_abs_set_res(input, ABS_HAT0X, STEAM_PAD_RESOLUTION);
465 input_abs_set_res(input, ABS_HAT0Y, STEAM_PAD_RESOLUTION);
466 input_abs_set_res(input, ABS_HAT2Y, STEAM_TRIGGER_RESOLUTION);
467 input_abs_set_res(input, ABS_HAT2X, STEAM_TRIGGER_RESOLUTION);
469 ret = input_register_device(input);
473 rcu_assign_pointer(steam->input, input);
477 input_free_device(input);
483 struct input_dev *input;
485 input = rcu_dereference(steam->input);
487 if (!input)
489 RCU_INIT_POINTER(steam->input, NULL);
491 input_unregister_device(input);
850 * Some input data in the protocol has the opposite sign.
928 struct input_dev *input, u8 *data)
939 input_report_abs(input, ABS_HAT2Y, data[11]);
940 input_report_abs(input, ABS_HAT2X, data[12]);
955 input_report_abs(input, lpad_touched ? ABS_HAT0X : ABS_X, x);
956 input_report_abs(input, lpad_touched ? ABS_HAT0Y : ABS_Y, y);
959 input_report_abs(input, ABS_X, 0);
960 input_report_abs(input, ABS_Y, 0);
964 input_report_abs(input, ABS_HAT0X, 0);
965 input_report_abs(input, ABS_HAT0Y, 0);
968 input_report_abs(input, ABS_RX, steam_le16(data + 20));
969 input_report_abs(input, ABS_RY, -steam_le16(data + 22));
971 input_event(input, EV_KEY, BTN_TR2, !!(b8 & BIT(0)));
972 input_event(input, EV_KEY, BTN_TL2, !!(b8 & BIT(1)));
973 input_event(input, EV_KEY, BTN_TR, !!(b8 & BIT(2)));
974 input_event(input, EV_KEY, BTN_TL, !!(b8 & BIT(3)));
975 input_event(input, EV_KEY, BTN_Y, !!(b8 & BIT(4)));
976 input_event(input, EV_KEY, BTN_B, !!(b8 & BIT(5)));
977 input_event(input, EV_KEY, BTN_X, !!(b8 & BIT(6)));
978 input_event(input, EV_KEY, BTN_A, !!(b8 & BIT(7)));
979 input_event(input, EV_KEY, BTN_SELECT, !!(b9 & BIT(4)));
980 input_event(input, EV_KEY, BTN_MODE, !!(b9 & BIT(5)));
981 input_event(input, EV_KEY, BTN_START, !!(b9 & BIT(6)));
982 input_event(input, EV_KEY, BTN_GEAR_DOWN, !!(b9 & BIT(7)));
983 input_event(input, EV_KEY, BTN_GEAR_UP, !!(b10 & BIT(0)));
984 input_event(input, EV_KEY, BTN_THUMBR, !!(b10 & BIT(2)));
985 input_event(input, EV_KEY, BTN_THUMBL, !!(b10 & BIT(6)));
986 input_event(input, EV_KEY, BTN_THUMB, lpad_touched || lpad_and_joy);
987 input_event(input, EV_KEY, BTN_THUMB2, !!(b10 & BIT(4)));
988 input_event(input, EV_KEY, BTN_DPAD_UP, !!(b9 & BIT(0)));
989 input_event(input, EV_KEY, BTN_DPAD_RIGHT, !!(b9 & BIT(1)));
990 input_event(input, EV_KEY, BTN_DPAD_LEFT, !!(b9 & BIT(2)));
991 input_event(input, EV_KEY, BTN_DPAD_DOWN, !!(b9 & BIT(3)));
993 input_sync(input);
1032 struct input_dev *input;
1052 * 0x01: input data (60 bytes)
1065 input = rcu_dereference(steam->input);
1066 if (likely(input))
1067 steam_do_input_event(steam, input, data);