43 #include <linux/module.h>
45 #include <linux/input.h>
49 #include <asm/setup.h>
50 #include <asm/uaccess.h>
59 static int mouse_threshold[2] = {2, 2};
62 #ifdef FIXED_ATARI_JOYSTICK
66 static struct input_dev *atamouse_dev;
68 static void atamouse_interrupt(
char *
buf)
72 buttons = (buf[0] & 1) | ((buf[0] & 2) << 1);
73 #ifdef FIXED_ATARI_JOYSTICK
82 input_report_rel(atamouse_dev,
REL_X, dx);
83 input_report_rel(atamouse_dev,
REL_Y, dy);
85 input_report_key(atamouse_dev,
BTN_LEFT, buttons & 0x4);
86 input_report_key(atamouse_dev,
BTN_MIDDLE, buttons & 0x2);
87 input_report_key(atamouse_dev,
BTN_RIGHT, buttons & 0x1);
89 input_sync(atamouse_dev);
94 static int atamouse_open(
struct input_dev *
dev)
96 #ifdef FIXED_ATARI_JOYSTICK
107 static void atamouse_close(
struct input_dev *
dev)
113 static int __init atamouse_init(
void)
124 atamouse_dev = input_allocate_device();
128 atamouse_dev->name =
"Atari mouse";
129 atamouse_dev->phys =
"atamouse/input0";
130 atamouse_dev->id.bustype =
BUS_HOST;
131 atamouse_dev->id.vendor = 0x0001;
132 atamouse_dev->id.product = 0x0002;
133 atamouse_dev->id.version = 0x0100;
140 atamouse_dev->open = atamouse_open;
141 atamouse_dev->close = atamouse_close;
143 error = input_register_device(atamouse_dev);
145 input_free_device(atamouse_dev);
152 static void __exit atamouse_exit(
void)
154 input_unregister_device(atamouse_dev);