25 #include <linux/errno.h>
27 #include <linux/kernel.h>
28 #include <linux/module.h>
29 #include <linux/pci.h>
31 #include <linux/slab.h>
32 #include <linux/gameport.h>
34 #define PCI_VENDOR_ID_FORTEMEDIA 0x1319
35 #define PCI_DEVICE_ID_FM801_GP 0x0802
49 w =
inw(gameport->
io + 2);
50 *buttons = (~w >> 14) & 0x03;
51 axes[0] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
52 w =
inw(gameport->
io + 4);
53 axes[1] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
54 w =
inw(gameport->
io + 6);
55 *buttons |= ((~w >> 14) & 0x03) << 2;
56 axes[2] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
57 w =
inw(gameport->
io + 8);
58 axes[3] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
84 struct gameport *
port;
88 port = gameport_allocate_port();
99 port->
open = fm801_gp_open;
103 gameport_set_name(port,
"FM801");
105 port->
dev.parent = &pci->
dev;
112 port->
io, port->
io + 0x0f);
114 goto err_out_disable_dev;
117 pci_set_drvdata(pci, gp);
119 outb(0x60, port->
io + 0x0d);
120 gameport_register_port(port);
127 gameport_free_port(port);
134 struct fm801_gp *gp = pci_get_drvdata(pci);
150 .name =
"FM801_gameport",
151 .id_table = fm801_gp_id_table,
152 .probe = fm801_gp_probe,