13 #include <linux/module.h>
16 #include <linux/input.h>
17 #include <linux/pci.h>
18 #include <linux/slab.h>
20 #include <linux/serio.h>
25 #define PS2_STATUS (1)
28 #define PS2_CTRL_CLK (1<<0)
29 #define PS2_CTRL_DAT (1<<1)
30 #define PS2_CTRL_TXIRQ (1<<2)
31 #define PS2_CTRL_ENABLE (1<<3)
32 #define PS2_CTRL_RXIRQ (1<<4)
34 #define PS2_STAT_CLK (1<<0)
35 #define PS2_STAT_DAT (1<<1)
36 #define PS2_STAT_PARITY (1<<2)
37 #define PS2_STAT_RXFULL (1<<5)
38 #define PS2_STAT_TXBUSY (1<<6)
39 #define PS2_STAT_TXEMPTY (1<<7)
47 static int pcips2_write(
struct serio *
io,
unsigned char val)
65 unsigned char status, scancode;
76 if (status == 0xff && scancode == 0xff)
89 static void pcips2_flush_input(
struct pcips2_data *ps2if)
91 unsigned char status, scancode;
95 if (!(status & PS2_STAT_RXFULL))
98 if (status == 0xff && scancode == 0xff)
103 static int pcips2_open(
struct serio *io)
109 pcips2_flush_input(ps2if);
121 static void pcips2_close(
struct serio *io)
145 serio = kzalloc(
sizeof(
struct serio),
GFP_KERNEL);
146 if (!ps2if || !serio) {
153 serio->
write = pcips2_write;
154 serio->
open = pcips2_open;
155 serio->
close = pcips2_close;
159 serio->
dev.parent = &dev->
dev;
164 pci_set_drvdata(dev, ps2if);
184 pci_set_drvdata(dev,
NULL);
197 .class_mask = 0xffff00,
205 .class_mask = 0xffff00,
213 .id_table = pcips2_ids,
214 .probe = pcips2_probe,