summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQuanxian Wang <quanxian.wang@intel.com>2013-09-23 13:13:27 +0800
committerQuanxian Wang <quanxian.wang@intel.com>2013-09-23 13:13:27 +0800
commit4081ab8ed869d3392aa84c68608d5fb8dfa103f8 (patch)
tree462620c78eab43ad99c43b0b402faabda337acb4 /src
parentf9408a00e1dcc320bf8f5a4a3b2a37822fc9ca14 (diff)
downloadweston-4081ab8ed869d3392aa84c68608d5fb8dfa103f8.tar.gz
weston-4081ab8ed869d3392aa84c68608d5fb8dfa103f8.tar.bz2
weston-4081ab8ed869d3392aa84c68608d5fb8dfa103f8.zip
We have the calibrator for touch and delete touch quirk
Change-Id: Ic6f324e6a1a89c5df3253efc1d939794415583bf
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c57
-rw-r--r--src/evdev.h7
-rw-r--r--src/udev-seat.c11
3 files changed, 14 insertions, 61 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 571fb0b6..f7b8032f 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -141,38 +141,19 @@ evdev_process_absolute_motion(struct evdev_device *device,
switch (e->code) {
case ABS_X:
- if (device->quirks & EVDEV_QUIRK_SWAP_AXES) {
- device->abs.y =
- (e->value - device->abs.min_y) * screen_height /
- (device->abs.max_y - device->abs.min_y) +
- device->output->y;
- } else if (device->quirks & EVDEV_QUIRK_SWAP_XAXIS) {
- device->abs.x =
- (device->abs.max_x - (e->value - device->abs.min_x)) * screen_width /
- (device->abs.max_x - device->abs.min_x) +
- device->output->x;
- } else {
- /* Normally Process Y */
- device->abs.x =
- (e->value - device->abs.min_x) * screen_width /
- (device->abs.max_x - device->abs.min_x) +
- device->output->x;
- }
+ /* Normally Process Y */
+ device->abs.x =
+ (e->value - device->abs.min_x) * screen_width /
+ (device->abs.max_x - device->abs.min_x) +
+ device->output->x;
device->pending_events |= EVDEV_ABSOLUTE_MOTION;
break;
case ABS_Y:
- if (device->quirks & EVDEV_QUIRK_SWAP_AXES) {
- device->abs.x =
- (e->value - device->abs.min_x) * screen_width /
- (device->abs.max_x - device->abs.min_x) +
- device->output->x;
- } else {
- /* Normally Process Y */
- device->abs.y =
- (e->value - device->abs.min_y) * screen_height /
- (device->abs.max_y - device->abs.min_y) +
- device->output->y;
- }
+ /* Normally Process Y */
+ device->abs.y =
+ (e->value - device->abs.min_y) * screen_height /
+ (device->abs.max_y - device->abs.min_y) +
+ device->output->y;
device->pending_events |= EVDEV_ABSOLUTE_MOTION;
break;
}
@@ -495,22 +476,12 @@ evdev_handle_device(struct evdev_device *device)
TEST_BIT(abs_bits, ABS_MT_POSITION_Y)) {
ioctl(device->fd, EVIOCGABS(ABS_MT_POSITION_X),
&absinfo);
- if (device->quirks & EVDEV_QUIRK_SWAP_AXES) {
- device->abs.min_y = absinfo.minimum;
- device->abs.max_y = absinfo.maximum;
- } else {
- device->abs.min_x = absinfo.minimum;
- device->abs.max_x = absinfo.maximum;
- }
+ device->abs.min_x = absinfo.minimum;
+ device->abs.max_x = absinfo.maximum;
ioctl(device->fd, EVIOCGABS(ABS_MT_POSITION_Y),
&absinfo);
- if (device->quirks & EVDEV_QUIRK_SWAP_AXES) {
- device->abs.min_x = absinfo.minimum;
- device->abs.max_x = absinfo.maximum;
- } else {
- device->abs.min_y = absinfo.minimum;
- device->abs.max_y = absinfo.maximum;
- }
+ device->abs.min_y = absinfo.minimum;
+ device->abs.max_y = absinfo.maximum;
device->is_mt = 1;
device->caps |= EVDEV_TOUCH;
diff --git a/src/evdev.h b/src/evdev.h
index 2eec5e5e..524fa229 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -47,12 +47,6 @@ enum evdev_device_capability {
EVDEV_TOUCH = (1 << 4),
};
-enum evdev_device_quirks {
- EVDEV_QUIRK_NONE = 0,
- EVDEV_QUIRK_SWAP_AXES = (1 << 0),
- EVDEV_QUIRK_SWAP_XAXIS = (2 << 0),
-};
-
struct evdev_device {
struct weston_seat *seat;
struct wl_list link;
@@ -83,7 +77,6 @@ struct evdev_device {
enum evdev_event_type pending_events;
enum evdev_device_capability caps;
- uint32_t quirks;
int is_mt;
};
diff --git a/src/udev-seat.c b/src/udev-seat.c
index 3c49f895..771d9bcf 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -40,16 +40,6 @@ udev_seat_create(struct weston_compositor *c, const char *seat_name);
static void
udev_seat_destroy(struct udev_seat *seat);
-static void
-device_parse_quirks(struct evdev_device *evdev_device,
- struct udev_device *udev_device)
-{
- if (udev_device_get_property_value(udev_device, "WL_QUIRK_SWAP_AXES"))
- evdev_device->quirks |= EVDEV_QUIRK_SWAP_AXES;
- else if (udev_device_get_property_value(udev_device, "WL_QUIRK_SWAP_XAXIS"))
- evdev_device->quirks |= EVDEV_QUIRK_SWAP_XAXIS;
-}
-
static int
device_added(struct udev_device *udev_device, struct udev_input *input)
{
@@ -124,7 +114,6 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
device->abs.calibration[5]);
}
- device_parse_quirks(device, udev_device);
wl_list_insert(seat->devices_list.prev, &device->link);
if (seat->base.output && seat->base.pointer)