Lines Matching +full:- +full:gp
1 // SPDX-License-Identifier: GPL-2.0-or-later
33 w = inw(gameport->io + 2); in fm801_gp_cooked_read()
35 axes[0] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); in fm801_gp_cooked_read()
36 w = inw(gameport->io + 4); in fm801_gp_cooked_read()
37 axes[1] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); in fm801_gp_cooked_read()
38 w = inw(gameport->io + 6); in fm801_gp_cooked_read()
40 axes[2] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); in fm801_gp_cooked_read()
41 w = inw(gameport->io + 8); in fm801_gp_cooked_read()
42 axes[3] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); in fm801_gp_cooked_read()
43 outw(0xff, gameport->io); /* reset */ in fm801_gp_cooked_read()
59 return -1; in fm801_gp_open()
67 struct fm801_gp *gp; in fm801_gp_probe() local
71 gp = kzalloc(sizeof(*gp), GFP_KERNEL); in fm801_gp_probe()
73 if (!gp || !port) { in fm801_gp_probe()
74 printk(KERN_ERR "fm801-gp: Memory allocation failed\n"); in fm801_gp_probe()
75 error = -ENOMEM; in fm801_gp_probe()
83 port->open = fm801_gp_open; in fm801_gp_probe()
85 port->cooked_read = fm801_gp_cooked_read; in fm801_gp_probe()
89 port->dev.parent = &pci->dev; in fm801_gp_probe()
90 port->io = pci_resource_start(pci, 0); in fm801_gp_probe()
92 gp->gameport = port; in fm801_gp_probe()
93 gp->res_port = request_region(port->io, 0x10, "FM801 GP"); in fm801_gp_probe()
94 if (!gp->res_port) { in fm801_gp_probe()
95 printk(KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n", in fm801_gp_probe()
96 port->io, port->io + 0x0f); in fm801_gp_probe()
97 error = -EBUSY; in fm801_gp_probe()
101 pci_set_drvdata(pci, gp); in fm801_gp_probe()
103 outb(0x60, port->io + 0x0d); /* enable joystick 1 and 2 */ in fm801_gp_probe()
112 kfree(gp); in fm801_gp_probe()
118 struct fm801_gp *gp = pci_get_drvdata(pci); in fm801_gp_remove() local
120 gameport_unregister_port(gp->gameport); in fm801_gp_remove()
121 release_resource(gp->res_port); in fm801_gp_remove()
122 kfree(gp); in fm801_gp_remove()