Lines Matching refs:udraw

76 struct udraw {  struct
112 struct udraw *udraw = hid_get_drvdata(hdev); in udraw_raw_event() argument
129 input_report_key(udraw->joy_input_dev, BTN_WEST, data[0] & 1); in udraw_raw_event()
130 input_report_key(udraw->joy_input_dev, BTN_SOUTH, !!(data[0] & 2)); in udraw_raw_event()
131 input_report_key(udraw->joy_input_dev, BTN_EAST, !!(data[0] & 4)); in udraw_raw_event()
132 input_report_key(udraw->joy_input_dev, BTN_NORTH, !!(data[0] & 8)); in udraw_raw_event()
134 input_report_key(udraw->joy_input_dev, BTN_SELECT, !!(data[1] & 1)); in udraw_raw_event()
135 input_report_key(udraw->joy_input_dev, BTN_START, !!(data[1] & 2)); in udraw_raw_event()
136 input_report_key(udraw->joy_input_dev, BTN_MODE, !!(data[1] & 16)); in udraw_raw_event()
172 input_report_abs(udraw->joy_input_dev, ABS_X, x); in udraw_raw_event()
173 input_report_abs(udraw->joy_input_dev, ABS_Y, y); in udraw_raw_event()
175 input_sync(udraw->joy_input_dev); in udraw_raw_event()
188 udraw->last_one_finger_x = x; in udraw_raw_event()
189 udraw->last_one_finger_y = y; in udraw_raw_event()
190 udraw->last_two_finger_x = -1; in udraw_raw_event()
191 udraw->last_two_finger_y = -1; in udraw_raw_event()
201 if (udraw->last_two_finger_x == -1) { in udraw_raw_event()
203 udraw->last_two_finger_x = x; in udraw_raw_event()
204 udraw->last_two_finger_y = y; in udraw_raw_event()
206 x = udraw->last_one_finger_x; in udraw_raw_event()
207 y = udraw->last_one_finger_y; in udraw_raw_event()
213 x = x - (udraw->last_two_finger_x in udraw_raw_event()
214 - udraw->last_one_finger_x); in udraw_raw_event()
215 y = y - (udraw->last_two_finger_y in udraw_raw_event()
216 - udraw->last_one_finger_y); in udraw_raw_event()
222 input_report_key(udraw->touch_input_dev, BTN_TOUCH, 1); in udraw_raw_event()
223 input_report_key(udraw->touch_input_dev, BTN_TOOL_FINGER, in udraw_raw_event()
225 input_report_key(udraw->touch_input_dev, BTN_TOOL_DOUBLETAP, in udraw_raw_event()
228 input_report_abs(udraw->touch_input_dev, ABS_X, x); in udraw_raw_event()
229 input_report_abs(udraw->touch_input_dev, ABS_Y, y); in udraw_raw_event()
231 input_report_key(udraw->touch_input_dev, BTN_TOUCH, 0); in udraw_raw_event()
232 input_report_key(udraw->touch_input_dev, BTN_TOOL_FINGER, 0); in udraw_raw_event()
233 input_report_key(udraw->touch_input_dev, BTN_TOOL_DOUBLETAP, 0); in udraw_raw_event()
235 input_sync(udraw->touch_input_dev); in udraw_raw_event()
244 input_report_key(udraw->pen_input_dev, BTN_TOUCH, (level != 0)); in udraw_raw_event()
245 input_report_key(udraw->pen_input_dev, BTN_TOOL_PEN, 1); in udraw_raw_event()
246 input_report_abs(udraw->pen_input_dev, ABS_PRESSURE, level); in udraw_raw_event()
247 input_report_abs(udraw->pen_input_dev, ABS_X, x); in udraw_raw_event()
248 input_report_abs(udraw->pen_input_dev, ABS_Y, y); in udraw_raw_event()
250 input_report_key(udraw->pen_input_dev, BTN_TOUCH, 0); in udraw_raw_event()
251 input_report_key(udraw->pen_input_dev, BTN_TOOL_PEN, 0); in udraw_raw_event()
252 input_report_abs(udraw->pen_input_dev, ABS_PRESSURE, 0); in udraw_raw_event()
254 input_sync(udraw->pen_input_dev); in udraw_raw_event()
263 input_report_abs(udraw->accel_input_dev, ABS_X, x); in udraw_raw_event()
264 input_report_abs(udraw->accel_input_dev, ABS_Y, y); in udraw_raw_event()
265 input_report_abs(udraw->accel_input_dev, ABS_Z, z); in udraw_raw_event()
266 input_sync(udraw->accel_input_dev); in udraw_raw_event()
274 struct udraw *udraw = input_get_drvdata(dev); in udraw_open() local
276 return hid_hw_open(udraw->hdev); in udraw_open()
281 struct udraw *udraw = input_get_drvdata(dev); in udraw_close() local
283 hid_hw_close(udraw->hdev); in udraw_close()
310 static bool udraw_setup_touch(struct udraw *udraw, in udraw_setup_touch() argument
332 udraw->touch_input_dev = input_dev; in udraw_setup_touch()
337 static bool udraw_setup_pen(struct udraw *udraw, in udraw_setup_pen() argument
360 udraw->pen_input_dev = input_dev; in udraw_setup_pen()
365 static bool udraw_setup_accel(struct udraw *udraw, in udraw_setup_accel() argument
383 udraw->accel_input_dev = input_dev; in udraw_setup_accel()
388 static bool udraw_setup_joypad(struct udraw *udraw, in udraw_setup_joypad() argument
410 udraw->joy_input_dev = input_dev; in udraw_setup_joypad()
417 struct udraw *udraw; in udraw_probe() local
420 udraw = devm_kzalloc(&hdev->dev, sizeof(struct udraw), GFP_KERNEL); in udraw_probe()
421 if (!udraw) in udraw_probe()
424 udraw->hdev = hdev; in udraw_probe()
425 udraw->last_two_finger_x = -1; in udraw_probe()
426 udraw->last_two_finger_y = -1; in udraw_probe()
428 hid_set_drvdata(hdev, udraw); in udraw_probe()
436 if (!udraw_setup_joypad(udraw, hdev) || in udraw_probe()
437 !udraw_setup_touch(udraw, hdev) || in udraw_probe()
438 !udraw_setup_pen(udraw, hdev) || in udraw_probe()
439 !udraw_setup_accel(udraw, hdev)) { in udraw_probe()
444 ret = input_register_device(udraw->joy_input_dev) || in udraw_probe()
445 input_register_device(udraw->touch_input_dev) || in udraw_probe()
446 input_register_device(udraw->pen_input_dev) || in udraw_probe()
447 input_register_device(udraw->accel_input_dev); in udraw_probe()