32 #include <linux/module.h>
33 #include <linux/kernel.h>
34 #include <linux/errno.h>
36 #include <linux/input.h>
39 #include <linux/pci.h>
49 #define PC110PAD_OFF 0x30
50 #define PC110PAD_ON 0x38
52 static int pc110pad_irq = 10;
53 static int pc110pad_io = 0x15e0;
55 static struct input_dev *pc110pad_dev;
56 static int pc110pad_data[3];
57 static int pc110pad_count;
64 outb(handshake | 1, pc110pad_io + 2);
66 outb(handshake & ~1, pc110pad_io + 2);
70 pc110pad_data[pc110pad_count++] =
value;
72 if (pc110pad_count < 3)
76 pc110pad_data[0] & 0x01);
77 input_report_abs(pc110pad_dev,
ABS_X,
78 pc110pad_data[1] | ((pc110pad_data[0] << 3) & 0x80) | ((pc110pad_data[0] << 1) & 0x100));
79 input_report_abs(pc110pad_dev,
ABS_Y,
80 pc110pad_data[2] | ((pc110pad_data[0] << 4) & 0x80));
81 input_sync(pc110pad_dev);
87 static void pc110pad_close(
struct input_dev *
dev)
92 static int pc110pad_open(
struct input_dev *
dev)
94 pc110pad_interrupt(0,
NULL);
95 pc110pad_interrupt(0,
NULL);
96 pc110pad_interrupt(0,
NULL);
109 static int __init pc110pad_init(
void)
118 pc110pad_io, pc110pad_io + 4);
124 if (
request_irq(pc110pad_irq, pc110pad_interrupt, 0,
"pc110pad",
NULL)) {
125 printk(
KERN_ERR "pc110pad: Unable to get irq %d.\n", pc110pad_irq);
127 goto err_release_region;
130 pc110pad_dev = input_allocate_device();
137 pc110pad_dev->name =
"IBM PC110 TouchPad";
138 pc110pad_dev->phys =
"isa15e0/input0";
139 pc110pad_dev->id.bustype =
BUS_ISA;
140 pc110pad_dev->id.vendor = 0x0003;
141 pc110pad_dev->id.product = 0x0001;
142 pc110pad_dev->id.version = 0x0100;
148 input_abs_set_max(pc110pad_dev,
ABS_X, 0x1ff);
149 input_abs_set_max(pc110pad_dev,
ABS_Y, 0x0ff);
151 pc110pad_dev->open = pc110pad_open;
152 pc110pad_dev->close = pc110pad_close;
154 err = input_register_device(pc110pad_dev);
161 input_free_device(pc110pad_dev);
170 static void __exit pc110pad_exit(
void)
174 input_unregister_device(pc110pad_dev);