Lines Matching refs:input
18 * This driver will disable the lizard mode when the input device is opened
19 * and re-enable it when the input device is closed, so as not to break user
23 * the hidraw interface directly to create input devices (XTest, uinput...).
27 * - this input device will be removed, to avoid double input of the same
29 * When the client is closed, this input device will be created again.
38 #include <linux/input.h>
128 struct input_dev __rcu *input;
479 struct input_dev *input;
483 input = rcu_dereference(steam->input);
485 if (input) {
490 input = input_allocate_device();
491 if (!input)
494 input_set_drvdata(input, steam);
495 input->dev.parent = &hdev->dev;
496 input->open = steam_input_open;
497 input->close = steam_input_close;
499 input->name = (steam->quirks & STEAM_QUIRK_WIRELESS) ? "Wireless Steam Controller" :
502 input->phys = hdev->phys;
503 input->uniq = steam->serial_no;
504 input->id.bustype = hdev->bus;
505 input->id.vendor = hdev->vendor;
506 input->id.product = hdev->product;
507 input->id.version = hdev->version;
509 input_set_capability(input, EV_KEY, BTN_TR2);
510 input_set_capability(input, EV_KEY, BTN_TL2);
511 input_set_capability(input, EV_KEY, BTN_TR);
512 input_set_capability(input, EV_KEY, BTN_TL);
513 input_set_capability(input, EV_KEY, BTN_Y);
514 input_set_capability(input, EV_KEY, BTN_B);
515 input_set_capability(input, EV_KEY, BTN_X);
516 input_set_capability(input, EV_KEY, BTN_A);
517 input_set_capability(input, EV_KEY, BTN_DPAD_UP);
518 input_set_capability(input, EV_KEY, BTN_DPAD_RIGHT);
519 input_set_capability(input, EV_KEY, BTN_DPAD_LEFT);
520 input_set_capability(input, EV_KEY, BTN_DPAD_DOWN);
521 input_set_capability(input, EV_KEY, BTN_SELECT);
522 input_set_capability(input, EV_KEY, BTN_MODE);
523 input_set_capability(input, EV_KEY, BTN_START);
524 input_set_capability(input, EV_KEY, BTN_THUMBR);
525 input_set_capability(input, EV_KEY, BTN_THUMBL);
526 input_set_capability(input, EV_KEY, BTN_THUMB);
527 input_set_capability(input, EV_KEY, BTN_THUMB2);
529 input_set_capability(input, EV_KEY, BTN_BASE);
530 input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY1);
531 input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY2);
532 input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY3);
533 input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY4);
535 input_set_capability(input, EV_KEY, BTN_GEAR_DOWN);
536 input_set_capability(input, EV_KEY, BTN_GEAR_UP);
539 input_set_abs_params(input, ABS_X, -32767, 32767, 0, 0);
540 input_set_abs_params(input, ABS_Y, -32767, 32767, 0, 0);
542 input_set_abs_params(input, ABS_HAT0X, -32767, 32767,
544 input_set_abs_params(input, ABS_HAT0Y, -32767, 32767,
548 input_set_abs_params(input, ABS_HAT2Y, 0, 32767, 0, 0);
549 input_set_abs_params(input, ABS_HAT2X, 0, 32767, 0, 0);
551 input_set_abs_params(input, ABS_RX, -32767, 32767, 0, 0);
552 input_set_abs_params(input, ABS_RY, -32767, 32767, 0, 0);
554 input_set_abs_params(input, ABS_HAT1X, -32767, 32767,
556 input_set_abs_params(input, ABS_HAT1Y, -32767, 32767,
559 input_abs_set_res(input, ABS_X, STEAM_DECK_JOYSTICK_RESOLUTION);
560 input_abs_set_res(input, ABS_Y, STEAM_DECK_JOYSTICK_RESOLUTION);
561 input_abs_set_res(input, ABS_RX, STEAM_DECK_JOYSTICK_RESOLUTION);
562 input_abs_set_res(input, ABS_RY, STEAM_DECK_JOYSTICK_RESOLUTION);
563 input_abs_set_res(input, ABS_HAT1X, STEAM_PAD_RESOLUTION);
564 input_abs_set_res(input, ABS_HAT1Y, STEAM_PAD_RESOLUTION);
565 input_abs_set_res(input, ABS_HAT2Y, STEAM_DECK_TRIGGER_RESOLUTION);
566 input_abs_set_res(input, ABS_HAT2X, STEAM_DECK_TRIGGER_RESOLUTION);
568 input_set_abs_params(input, ABS_HAT2Y, 0, 255, 0, 0);
569 input_set_abs_params(input, ABS_HAT2X, 0, 255, 0, 0);
571 input_set_abs_params(input, ABS_RX, -32767, 32767,
573 input_set_abs_params(input, ABS_RY, -32767, 32767,
576 input_abs_set_res(input, ABS_X, STEAM_JOYSTICK_RESOLUTION);
577 input_abs_set_res(input, ABS_Y, STEAM_JOYSTICK_RESOLUTION);
578 input_abs_set_res(input, ABS_RX, STEAM_PAD_RESOLUTION);
579 input_abs_set_res(input, ABS_RY, STEAM_PAD_RESOLUTION);
580 input_abs_set_res(input, ABS_HAT2Y, STEAM_TRIGGER_RESOLUTION);
581 input_abs_set_res(input, ABS_HAT2X, STEAM_TRIGGER_RESOLUTION);
583 input_abs_set_res(input, ABS_HAT0X, STEAM_PAD_RESOLUTION);
584 input_abs_set_res(input, ABS_HAT0Y, STEAM_PAD_RESOLUTION);
588 input_set_capability(input, EV_FF, FF_RUMBLE);
589 ret = input_ff_create_memless(input, NULL, steam_play_effect);
595 ret = input_register_device(input);
599 rcu_assign_pointer(steam->input, input);
603 input_free_device(input);
609 struct input_dev *input;
611 input = rcu_dereference(steam->input);
613 if (!input)
615 RCU_INIT_POINTER(steam->input, NULL);
617 input_unregister_device(input);
1000 * Some input data in the protocol has the opposite sign.
1078 struct input_dev *input, u8 *data)
1089 input_report_abs(input, ABS_HAT2Y, data[11]);
1090 input_report_abs(input, ABS_HAT2X, data[12]);
1105 input_report_abs(input, lpad_touched ? ABS_HAT0X : ABS_X, x);
1106 input_report_abs(input, lpad_touched ? ABS_HAT0Y : ABS_Y, y);
1109 input_report_abs(input, ABS_X, 0);
1110 input_report_abs(input, ABS_Y, 0);
1114 input_report_abs(input, ABS_HAT0X, 0);
1115 input_report_abs(input, ABS_HAT0Y, 0);
1118 input_report_abs(input, ABS_RX, steam_le16(data + 20));
1119 input_report_abs(input, ABS_RY, -steam_le16(data + 22));
1121 input_event(input, EV_KEY, BTN_TR2, !!(b8 & BIT(0)));
1122 input_event(input, EV_KEY, BTN_TL2, !!(b8 & BIT(1)));
1123 input_event(input, EV_KEY, BTN_TR, !!(b8 & BIT(2)));
1124 input_event(input, EV_KEY, BTN_TL, !!(b8 & BIT(3)));
1125 input_event(input, EV_KEY, BTN_Y, !!(b8 & BIT(4)));
1126 input_event(input, EV_KEY, BTN_B, !!(b8 & BIT(5)));
1127 input_event(input, EV_KEY, BTN_X, !!(b8 & BIT(6)));
1128 input_event(input, EV_KEY, BTN_A, !!(b8 & BIT(7)));
1129 input_event(input, EV_KEY, BTN_SELECT, !!(b9 & BIT(4)));
1130 input_event(input, EV_KEY, BTN_MODE, !!(b9 & BIT(5)));
1131 input_event(input, EV_KEY, BTN_START, !!(b9 & BIT(6)));
1132 input_event(input, EV_KEY, BTN_GEAR_DOWN, !!(b9 & BIT(7)));
1133 input_event(input, EV_KEY, BTN_GEAR_UP, !!(b10 & BIT(0)));
1134 input_event(input, EV_KEY, BTN_THUMBR, !!(b10 & BIT(2)));
1135 input_event(input, EV_KEY, BTN_THUMBL, !!(b10 & BIT(6)));
1136 input_event(input, EV_KEY, BTN_THUMB, lpad_touched || lpad_and_joy);
1137 input_event(input, EV_KEY, BTN_THUMB2, !!(b10 & BIT(4)));
1138 input_event(input, EV_KEY, BTN_DPAD_UP, !!(b9 & BIT(0)));
1139 input_event(input, EV_KEY, BTN_DPAD_RIGHT, !!(b9 & BIT(1)));
1140 input_event(input, EV_KEY, BTN_DPAD_LEFT, !!(b9 & BIT(2)));
1141 input_event(input, EV_KEY, BTN_DPAD_DOWN, !!(b9 & BIT(3)));
1143 input_sync(input);
1245 struct input_dev *input, u8 *data)
1261 input_report_abs(input, ABS_HAT0X, steam_le16(data + 16));
1262 input_report_abs(input, ABS_HAT0Y, steam_le16(data + 18));
1264 input_report_abs(input, ABS_HAT0X, 0);
1265 input_report_abs(input, ABS_HAT0Y, 0);
1269 input_report_abs(input, ABS_HAT1X, steam_le16(data + 20));
1270 input_report_abs(input, ABS_HAT1Y, steam_le16(data + 22));
1272 input_report_abs(input, ABS_HAT1X, 0);
1273 input_report_abs(input, ABS_HAT1Y, 0);
1276 input_report_abs(input, ABS_X, steam_le16(data + 48));
1277 input_report_abs(input, ABS_Y, -steam_le16(data + 50));
1278 input_report_abs(input, ABS_RX, steam_le16(data + 52));
1279 input_report_abs(input, ABS_RY, -steam_le16(data + 54));
1281 input_report_abs(input, ABS_HAT2Y, steam_le16(data + 44));
1282 input_report_abs(input, ABS_HAT2X, steam_le16(data + 46));
1284 input_event(input, EV_KEY, BTN_TR2, !!(b8 & BIT(0)));
1285 input_event(input, EV_KEY, BTN_TL2, !!(b8 & BIT(1)));
1286 input_event(input, EV_KEY, BTN_TR, !!(b8 & BIT(2)));
1287 input_event(input, EV_KEY, BTN_TL, !!(b8 & BIT(3)));
1288 input_event(input, EV_KEY, BTN_Y, !!(b8 & BIT(4)));
1289 input_event(input, EV_KEY, BTN_B, !!(b8 & BIT(5)));
1290 input_event(input, EV_KEY, BTN_X, !!(b8 & BIT(6)));
1291 input_event(input, EV_KEY, BTN_A, !!(b8 & BIT(7)));
1292 input_event(input, EV_KEY, BTN_SELECT, !!(b9 & BIT(4)));
1293 input_event(input, EV_KEY, BTN_MODE, !!(b9 & BIT(5)));
1294 input_event(input, EV_KEY, BTN_START, !!(b9 & BIT(6)));
1295 input_event(input, EV_KEY, BTN_TRIGGER_HAPPY3, !!(b9 & BIT(7)));
1296 input_event(input, EV_KEY, BTN_TRIGGER_HAPPY4, !!(b10 & BIT(0)));
1297 input_event(input, EV_KEY, BTN_THUMBL, !!(b10 & BIT(6)));
1298 input_event(input, EV_KEY, BTN_THUMBR, !!(b11 & BIT(2)));
1299 input_event(input, EV_KEY, BTN_DPAD_UP, !!(b9 & BIT(0)));
1300 input_event(input, EV_KEY, BTN_DPAD_RIGHT, !!(b9 & BIT(1)));
1301 input_event(input, EV_KEY, BTN_DPAD_LEFT, !!(b9 & BIT(2)));
1302 input_event(input, EV_KEY, BTN_DPAD_DOWN, !!(b9 & BIT(3)));
1303 input_event(input, EV_KEY, BTN_THUMB, !!(b10 & BIT(1)));
1304 input_event(input, EV_KEY, BTN_THUMB2, !!(b10 & BIT(2)));
1305 input_event(input, EV_KEY, BTN_TRIGGER_HAPPY1, !!(b13 & BIT(1)));
1306 input_event(input, EV_KEY, BTN_TRIGGER_HAPPY2, !!(b13 & BIT(2)));
1307 input_event(input, EV_KEY, BTN_BASE, !!(b14 & BIT(2)));
1309 input_sync(input);
1348 struct input_dev *input;
1368 * 0x01: input data (60 bytes)
1371 * 0x09: Steam Deck input data (56 bytes)
1382 input = rcu_dereference(steam->input);
1383 if (likely(input))
1384 steam_do_input_event(steam, input, data);
1391 input = rcu_dereference(steam->input);
1392 if (likely(input))
1393 steam_do_deck_input_event(steam, input, data);