Lines Matching defs:input

24 #include <linux/input.h>
192 static int psxpad_spi_poll_open(struct input_dev *input)
194 struct psxpad *pad = input_get_drvdata(input);
201 static void psxpad_spi_poll_close(struct input_dev *input)
203 struct psxpad *pad = input_get_drvdata(input);
208 static void psxpad_spi_poll(struct input_dev *input)
210 struct psxpad *pad = input_get_drvdata(input);
232 input_report_abs(input, ABS_X, REVERSE_BIT(pad->response[7]));
233 input_report_abs(input, ABS_Y, REVERSE_BIT(pad->response[8]));
234 input_report_abs(input, ABS_RX, REVERSE_BIT(pad->response[5]));
235 input_report_abs(input, ABS_RY, REVERSE_BIT(pad->response[6]));
236 input_report_key(input, BTN_DPAD_UP, b_rsp3 & BIT(3));
237 input_report_key(input, BTN_DPAD_DOWN, b_rsp3 & BIT(1));
238 input_report_key(input, BTN_DPAD_LEFT, b_rsp3 & BIT(0));
239 input_report_key(input, BTN_DPAD_RIGHT, b_rsp3 & BIT(2));
240 input_report_key(input, BTN_X, b_rsp4 & BIT(3));
241 input_report_key(input, BTN_A, b_rsp4 & BIT(2));
242 input_report_key(input, BTN_B, b_rsp4 & BIT(1));
243 input_report_key(input, BTN_Y, b_rsp4 & BIT(0));
244 input_report_key(input, BTN_TL, b_rsp4 & BIT(5));
245 input_report_key(input, BTN_TR, b_rsp4 & BIT(4));
246 input_report_key(input, BTN_TL2, b_rsp4 & BIT(7));
247 input_report_key(input, BTN_TR2, b_rsp4 & BIT(6));
248 input_report_key(input, BTN_THUMBL, b_rsp3 & BIT(6));
249 input_report_key(input, BTN_THUMBR, b_rsp3 & BIT(5));
250 input_report_key(input, BTN_SELECT, b_rsp3 & BIT(7));
251 input_report_key(input, BTN_START, b_rsp3 & BIT(4));
259 input_report_abs(input, ABS_X, 0x80);
260 input_report_abs(input, ABS_Y, 0x80);
261 input_report_abs(input, ABS_RX, 0x80);
262 input_report_abs(input, ABS_RY, 0x80);
263 input_report_key(input, BTN_DPAD_UP, b_rsp3 & BIT(3));
264 input_report_key(input, BTN_DPAD_DOWN, b_rsp3 & BIT(1));
265 input_report_key(input, BTN_DPAD_LEFT, b_rsp3 & BIT(0));
266 input_report_key(input, BTN_DPAD_RIGHT, b_rsp3 & BIT(2));
267 input_report_key(input, BTN_X, b_rsp4 & BIT(3));
268 input_report_key(input, BTN_A, b_rsp4 & BIT(2));
269 input_report_key(input, BTN_B, b_rsp4 & BIT(1));
270 input_report_key(input, BTN_Y, b_rsp4 & BIT(0));
271 input_report_key(input, BTN_TL, b_rsp4 & BIT(5));
272 input_report_key(input, BTN_TR, b_rsp4 & BIT(4));
273 input_report_key(input, BTN_TL2, b_rsp4 & BIT(7));
274 input_report_key(input, BTN_TR2, b_rsp4 & BIT(6));
275 input_report_key(input, BTN_THUMBL, false);
276 input_report_key(input, BTN_THUMBR, false);
277 input_report_key(input, BTN_SELECT, b_rsp3 & BIT(7));
278 input_report_key(input, BTN_START, b_rsp3 & BIT(4));
282 input_sync(input);
297 dev_err(&spi->dev, "failed to allocate input device\n");
301 /* input poll device settings */
305 /* input device settings */
309 snprintf(pad->phys, sizeof(pad->phys), "%s/input", dev_name(&spi->dev));
364 /* register input poll device */
368 "failed to register input device: %d\n", err);