35 #include <linux/module.h>
39 #include <linux/input.h>
48 #define INPORT_BASE 0x23c
49 #define INPORT_EXTENT 4
51 #define INPORT_CONTROL_PORT INPORT_BASE + 0
52 #define INPORT_DATA_PORT INPORT_BASE + 1
53 #define INPORT_SIGNATURE_PORT INPORT_BASE + 2
55 #define INPORT_REG_BTNS 0x00
56 #define INPORT_REG_X 0x01
57 #define INPORT_REG_Y 0x02
58 #define INPORT_REG_MODE 0x07
59 #define INPORT_RESET 0x80
61 #ifdef CONFIG_MOUSE_ATIXL
62 #define INPORT_NAME "ATI XL Mouse"
63 #define INPORT_VENDOR 0x0002
64 #define INPORT_SPEED_30HZ 0x01
65 #define INPORT_SPEED_50HZ 0x02
66 #define INPORT_SPEED_100HZ 0x03
67 #define INPORT_SPEED_200HZ 0x04
68 #define INPORT_MODE_BASE INPORT_SPEED_100HZ
69 #define INPORT_MODE_IRQ 0x08
71 #define INPORT_NAME "Microsoft InPort Mouse"
72 #define INPORT_VENDOR 0x0001
73 #define INPORT_MODE_BASE 0x10
74 #define INPORT_MODE_IRQ 0x01
76 #define INPORT_MODE_HOLD 0x20
84 static struct input_dev *inport_dev;
102 input_report_key(inport_dev,
BTN_MIDDLE, buttons & 1);
103 input_report_key(inport_dev,
BTN_LEFT, buttons & 2);
104 input_report_key(inport_dev,
BTN_RIGHT, buttons & 4);
109 input_sync(inport_dev);
113 static int inport_open(
struct input_dev *
dev)
123 static void inport_close(
struct input_dev *dev)
130 static int __init inport_init(
void)
132 unsigned char a,
b,
c;
143 if (a == b || a != c) {
146 goto err_release_region;
149 inport_dev = input_allocate_device();
151 printk(
KERN_ERR "inport.c: Not enough memory for input device\n");
153 goto err_release_region;
157 inport_dev->phys =
"isa023c/input0";
158 inport_dev->id.bustype =
BUS_ISA;
160 inport_dev->id.product = 0x0001;
161 inport_dev->id.version = 0x0100;
168 inport_dev->open = inport_open;
169 inport_dev->close = inport_close;
175 err = input_register_device(inport_dev);
182 input_free_device(inport_dev);
189 static void __exit inport_exit(
void)
191 input_unregister_device(inport_dev);