diff options
author | Markus Armbruster <armbru@redhat.com> | 2008-05-26 18:31:08 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-27 04:11:36 -0400 |
commit | 6ba0e7b36c7cc1745b3cbeda244d14edae3ad058 (patch) | |
tree | 191836ccdf8d53a3ec9f1c91a0317bf6fff96433 | |
parent | 9e124fe16ff24746d6de5a2ad685266d7bce0e08 (diff) |
xen pvfb: Pointer z-axis (mouse wheel) support
Add z-axis motion to pointer events. Backward compatible, because
there's space for the z-axis in union xenkbd_in_event, and old
backends zero it.
Derived from
http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/57dfe0098000
http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/1edfea26a2a9
http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/c3ff0b26f664
Signed-off-by: Pat Campbell <plc@novell.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/input/xen-kbdfront.c | 8 | ||||
-rw-r--r-- | include/xen/interface/io/kbdif.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c index 0f47f4697cdf..9da4452786fa 100644 --- a/drivers/input/xen-kbdfront.c +++ b/drivers/input/xen-kbdfront.c | |||
@@ -66,6 +66,9 @@ static irqreturn_t input_handler(int rq, void *dev_id) | |||
66 | case XENKBD_TYPE_MOTION: | 66 | case XENKBD_TYPE_MOTION: |
67 | input_report_rel(dev, REL_X, event->motion.rel_x); | 67 | input_report_rel(dev, REL_X, event->motion.rel_x); |
68 | input_report_rel(dev, REL_Y, event->motion.rel_y); | 68 | input_report_rel(dev, REL_Y, event->motion.rel_y); |
69 | if (event->motion.rel_z) | ||
70 | input_report_rel(dev, REL_WHEEL, | ||
71 | -event->motion.rel_z); | ||
69 | break; | 72 | break; |
70 | case XENKBD_TYPE_KEY: | 73 | case XENKBD_TYPE_KEY: |
71 | dev = NULL; | 74 | dev = NULL; |
@@ -84,6 +87,9 @@ static irqreturn_t input_handler(int rq, void *dev_id) | |||
84 | case XENKBD_TYPE_POS: | 87 | case XENKBD_TYPE_POS: |
85 | input_report_abs(dev, ABS_X, event->pos.abs_x); | 88 | input_report_abs(dev, ABS_X, event->pos.abs_x); |
86 | input_report_abs(dev, ABS_Y, event->pos.abs_y); | 89 | input_report_abs(dev, ABS_Y, event->pos.abs_y); |
90 | if (event->pos.rel_z) | ||
91 | input_report_rel(dev, REL_WHEEL, | ||
92 | -event->pos.rel_z); | ||
87 | break; | 93 | break; |
88 | } | 94 | } |
89 | if (dev) | 95 | if (dev) |
@@ -152,7 +158,7 @@ static int __devinit xenkbd_probe(struct xenbus_device *dev, | |||
152 | ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS); | 158 | ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS); |
153 | for (i = BTN_LEFT; i <= BTN_TASK; i++) | 159 | for (i = BTN_LEFT; i <= BTN_TASK; i++) |
154 | set_bit(i, ptr->keybit); | 160 | set_bit(i, ptr->keybit); |
155 | ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y); | 161 | ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL); |
156 | input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0); | 162 | input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0); |
157 | input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0); | 163 | input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0); |
158 | 164 | ||
diff --git a/include/xen/interface/io/kbdif.h b/include/xen/interface/io/kbdif.h index fb97f4284ffd..8066c7849fbe 100644 --- a/include/xen/interface/io/kbdif.h +++ b/include/xen/interface/io/kbdif.h | |||
@@ -49,6 +49,7 @@ struct xenkbd_motion { | |||
49 | uint8_t type; /* XENKBD_TYPE_MOTION */ | 49 | uint8_t type; /* XENKBD_TYPE_MOTION */ |
50 | int32_t rel_x; /* relative X motion */ | 50 | int32_t rel_x; /* relative X motion */ |
51 | int32_t rel_y; /* relative Y motion */ | 51 | int32_t rel_y; /* relative Y motion */ |
52 | int32_t rel_z; /* relative Z motion (wheel) */ | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | struct xenkbd_key { | 55 | struct xenkbd_key { |
@@ -61,6 +62,7 @@ struct xenkbd_position { | |||
61 | uint8_t type; /* XENKBD_TYPE_POS */ | 62 | uint8_t type; /* XENKBD_TYPE_POS */ |
62 | int32_t abs_x; /* absolute X position (in FB pixels) */ | 63 | int32_t abs_x; /* absolute X position (in FB pixels) */ |
63 | int32_t abs_y; /* absolute Y position (in FB pixels) */ | 64 | int32_t abs_y; /* absolute Y position (in FB pixels) */ |
65 | int32_t rel_z; /* relative Z motion (wheel) */ | ||
64 | }; | 66 | }; |
65 | 67 | ||
66 | #define XENKBD_IN_EVENT_SIZE 40 | 68 | #define XENKBD_IN_EVENT_SIZE 40 |