aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mousedev.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-12-11 12:41:03 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2005-12-11 12:41:03 -0500
commit84c12b2410ea3b88523270064222fbf505dbf15e (patch)
tree7c72f2cd5409730b9e8aa861110e20c64ebc3c7e /drivers/input/mousedev.c
parent3a51f7c40437077ac4a463307e9a4ae6b78755a8 (diff)
Input: mousedev - make module parameters visible in sysfs
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
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;