Lines Matching refs:gameport
29 struct gameport *gameport; member
37 static unsigned char cobra_read_packet(struct gameport *gameport, unsigned int *data) in cobra_read_packet() argument
45 int strobe = gameport_time(gameport, COBRA_MAX_STROBE); in cobra_read_packet()
54 u = gameport_read(gameport); in cobra_read_packet()
58 v = gameport_read(gameport); in cobra_read_packet()
91 static void cobra_poll(struct gameport *gameport) in cobra_poll() argument
93 struct cobra *cobra = gameport_get_drvdata(gameport); in cobra_poll()
100 if ((r = cobra_read_packet(gameport, data)) != cobra->exists) { in cobra_poll()
125 gameport_start_polling(cobra->gameport); in cobra_open()
133 gameport_stop_polling(cobra->gameport); in cobra_close()
136 static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv) in cobra_connect() argument
148 cobra->gameport = gameport; in cobra_connect()
150 gameport_set_drvdata(gameport, cobra); in cobra_connect()
152 err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW); in cobra_connect()
156 cobra->exists = cobra_read_packet(gameport, data); in cobra_connect()
161 " Contact vojtech@ucw.cz\n", i, gameport->phys, (data[i] >> 2) & 7); in cobra_connect()
170 gameport_set_poll_handler(gameport, cobra_poll); in cobra_connect()
171 gameport_set_poll_interval(gameport, 20); in cobra_connect()
184 "%s/input%d", gameport->phys, i); in cobra_connect()
192 input_dev->dev.parent = &gameport->dev; in cobra_connect()
216 fail2: gameport_close(gameport); in cobra_connect()
217 fail1: gameport_set_drvdata(gameport, NULL); in cobra_connect()
222 static void cobra_disconnect(struct gameport *gameport) in cobra_disconnect() argument
224 struct cobra *cobra = gameport_get_drvdata(gameport); in cobra_disconnect()
230 gameport_close(gameport); in cobra_disconnect()
231 gameport_set_drvdata(gameport, NULL); in cobra_disconnect()