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_touchpad_setup(void)
33 struct litest_device *d = litest_create_device(LITEST_SYNAPTICS_TOUCHPAD);
34 litest_set_current_device(d);
37 static struct input_event down[] = {
38 { .type = EV_KEY, .code = BTN_TOUCH, .value = 1 },
39 { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
40 { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
41 { .type = EV_ABS, .code = ABS_PRESSURE, .value = 30 },
42 { .type = EV_ABS, .code = ABS_TOOL_WIDTH, .value = 7 },
43 { .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
44 { .type = -1, .code = -1 },
47 static struct input_event move[] = {
48 { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
49 { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
50 { .type = EV_KEY, .code = BTN_TOUCH, .value = 1 },
51 { .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
52 { .type = -1, .code = -1 },
55 struct input_event up[] = {
56 { .type = EV_KEY, .code = BTN_TOUCH, .value = 0 },
57 { .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
58 { .type = -1, .code = -1 },
61 static struct litest_device_interface interface = {
62 .touch_down_events = down,
63 .touch_move_events = move,
64 .touch_up_events = up,
67 static struct input_absinfo absinfo[] = {
68 { ABS_X, 1472, 5472, 0, 0, 75 },
69 { ABS_Y, 1408, 4448, 0, 0, 129 },
70 { ABS_PRESSURE, 0, 255, 0, 0, 0 },
71 { ABS_TOOL_WIDTH, 0, 15, 0, 0, 0 },
75 static struct input_id input_id = {
81 static int events[] = {
84 EV_KEY, BTN_TOOL_FINGER,
89 struct litest_test_device litest_synaptics_touchpad_device = {
90 .type = LITEST_SYNAPTICS_TOUCHPAD,
91 .features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SINGLE_TOUCH,
92 .shortname = "synaptics ST",
93 .setup = litest_synaptics_touchpad_setup,
94 .interface = &interface,
96 .name = "SynPS/2 Synaptics TouchPad",