2 * Copyright © 2013 Red Hat, Inc.
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
28 #include "litest-int.h"
31 litest_synaptics_clickpad_setup(void)
33 struct litest_device *d = litest_create_device(LITEST_SYNAPTICS_CLICKPAD);
34 litest_set_current_device(d);
37 static struct input_event down[] = {
38 { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
39 { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
40 { .type = EV_ABS, .code = ABS_PRESSURE, .value = 30 },
41 { .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
42 { .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN },
43 { .type = EV_ABS, .code = ABS_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
44 { .type = EV_ABS, .code = ABS_MT_POSITION_Y, .value = LITEST_AUTO_ASSIGN },
45 { .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
46 { .type = -1, .code = -1 },
49 static struct input_event move[] = {
50 { .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
51 { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
52 { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
53 { .type = EV_ABS, .code = ABS_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
54 { .type = EV_ABS, .code = ABS_MT_POSITION_Y, .value = LITEST_AUTO_ASSIGN },
55 { .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
56 { .type = -1, .code = -1 },
59 static struct litest_device_interface interface = {
60 .touch_down_events = down,
61 .touch_move_events = move,
64 static struct input_id input_id = {
70 static int events[] = {
72 EV_KEY, BTN_TOOL_FINGER,
73 EV_KEY, BTN_TOOL_QUINTTAP,
75 EV_KEY, BTN_TOOL_DOUBLETAP,
76 EV_KEY, BTN_TOOL_TRIPLETAP,
77 EV_KEY, BTN_TOOL_QUADTAP,
78 INPUT_PROP_MAX, INPUT_PROP_POINTER,
79 INPUT_PROP_MAX, INPUT_PROP_BUTTONPAD,
83 static struct input_absinfo absinfo[] = {
84 { ABS_X, 1472, 5472, 0, 0, 75 },
85 { ABS_Y, 1408, 4448, 0, 0, 129 },
86 { ABS_PRESSURE, 0, 255, 0, 0, 0 },
87 { ABS_TOOL_WIDTH, 0, 15, 0, 0, 0 },
88 { ABS_MT_SLOT, 0, 1, 0, 0, 0 },
89 { ABS_MT_POSITION_X, 1472, 5472, 0, 0, 75 },
90 { ABS_MT_POSITION_Y, 1408, 4448, 0, 0, 129 },
91 { ABS_MT_TRACKING_ID, 0, 65535, 0, 0, 0 },
92 { ABS_MT_PRESSURE, 0, 255, 0, 0, 0 },
96 struct litest_test_device litest_synaptics_clickpad_device = {
97 .type = LITEST_SYNAPTICS_CLICKPAD,
98 .features = LITEST_TOUCHPAD | LITEST_CLICKPAD | LITEST_BUTTON,
99 .shortname = "synaptics",
100 .setup = litest_synaptics_clickpad_setup,
101 .interface = &interface,
103 .name = "SynPS/2 Synaptics TouchPad",