aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mousedev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-07 14:29:51 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-07 14:29:51 -0500
commitb9abaa3fb7328851bdeaad19e694048f0ff71d9a (patch)
treede56cda929b837c6b2e421b57c723939ec7df5da /drivers/input/mousedev.c
parent8995b161eb142b843094dd614b80e4cce1d66352 (diff)
parent736ce43295682d060f2b93624b4a339f9af6aab1 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Diffstat (limited to 'drivers/input/mousedev.c')
-rw-r--r--drivers/input/mousedev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 2d0af44ac4b9..81fd7a97a93d 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -40,15 +40,15 @@ MODULE_LICENSE("GPL");
40#endif 40#endif
41 41
42static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X; 42static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X;
43module_param(xres, uint, 0); 43module_param(xres, uint, 0644);
44MODULE_PARM_DESC(xres, "Horizontal screen resolution"); 44MODULE_PARM_DESC(xres, "Horizontal screen resolution");
45 45
46static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y; 46static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y;
47module_param(yres, uint, 0); 47module_param(yres, uint, 0644);
48MODULE_PARM_DESC(yres, "Vertical screen resolution"); 48MODULE_PARM_DESC(yres, "Vertical screen resolution");
49 49
50static unsigned tap_time = 200; 50static unsigned tap_time = 200;
51module_param(tap_time, uint, 0); 51module_param(tap_time, uint, 0644);
52MODULE_PARM_DESC(tap_time, "Tap time for touchpads in absolute mode (msecs)"); 52MODULE_PARM_DESC(tap_time, "Tap time for touchpads in absolute mode (msecs)");
53 53
54struct mousedev_hw_data { 54struct mousedev_hw_data {
@@ -155,7 +155,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev,
155 switch (code) { 155 switch (code) {
156 case ABS_X: 156 case ABS_X:
157 size = dev->absmax[ABS_X] - dev->absmin[ABS_X]; 157 size = dev->absmax[ABS_X] - dev->absmin[ABS_X];
158 if (size == 0) size = xres; 158 if (size == 0) size = xres ? : 1;
159 if (value > dev->absmax[ABS_X]) value = dev->absmax[ABS_X]; 159 if (value > dev->absmax[ABS_X]) value = dev->absmax[ABS_X];
160 if (value < dev->absmin[ABS_X]) value = dev->absmin[ABS_X]; 160 if (value < dev->absmin[ABS_X]) value = dev->absmin[ABS_X];
161 mousedev->packet.x = ((value - dev->absmin[ABS_X]) * xres) / size; 161 mousedev->packet.x = ((value - dev->absmin[ABS_X]) * xres) / size;
@@ -164,7 +164,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev,
164 164
165 case ABS_Y: 165 case ABS_Y:
166 size = dev->absmax[ABS_Y] - dev->absmin[ABS_Y]; 166 size = dev->absmax[ABS_Y] - dev->absmin[ABS_Y];
167 if (size == 0) size = yres; 167 if (size == 0) size = yres ? : 1;
168 if (value > dev->absmax[ABS_Y]) value = dev->absmax[ABS_Y]; 168 if (value > dev->absmax[ABS_Y]) value = dev->absmax[ABS_Y];
169 if (value < dev->absmin[ABS_Y]) value = dev->absmin[ABS_Y]; 169 if (value < dev->absmin[ABS_Y]) value = dev->absmin[ABS_Y];
170 mousedev->packet.y = yres - ((value - dev->absmin[ABS_Y]) * yres) / size; 170 mousedev->packet.y = yres - ((value - dev->absmin[ABS_Y]) * yres) / size;