Lines Matching refs:tmdc

104 struct tmdc {  struct
223 struct tmdc *tmdc = gameport_get_drvdata(gameport); in tmdc_poll() local
227 tmdc->reads++; in tmdc_poll()
229 if ((r = tmdc_read_packet(tmdc->gameport, data)) != tmdc->exists) in tmdc_poll()
233 if (r & (1 << i) & tmdc->exists) { in tmdc_poll()
235 if (tmdc_parse_packet(tmdc->port[i], data[i])) in tmdc_poll()
241 tmdc->bads += bad; in tmdc_poll()
246 struct tmdc *tmdc = input_get_drvdata(dev); in tmdc_open() local
248 gameport_start_polling(tmdc->gameport); in tmdc_open()
254 struct tmdc *tmdc = input_get_drvdata(dev); in tmdc_close() local
256 gameport_stop_polling(tmdc->gameport); in tmdc_close()
259 static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data) in tmdc_setup_port() argument
267 tmdc->port[idx] = port = kzalloc(sizeof (struct tmdc_port), GFP_KERNEL); in tmdc_setup_port()
297 snprintf(port->phys, sizeof(port->phys), "%s/input%d", tmdc->gameport->phys, i); in tmdc_setup_port()
307 input_dev->dev.parent = &tmdc->gameport->dev; in tmdc_setup_port()
309 input_set_drvdata(input_dev, tmdc); in tmdc_setup_port()
347 struct tmdc *tmdc; in tmdc_connect() local
351 if (!(tmdc = kzalloc(sizeof(struct tmdc), GFP_KERNEL))) in tmdc_connect()
354 tmdc->gameport = gameport; in tmdc_connect()
356 gameport_set_drvdata(gameport, tmdc); in tmdc_connect()
362 if (!(tmdc->exists = tmdc_read_packet(gameport, data))) { in tmdc_connect()
371 if (tmdc->exists & (1 << i)) { in tmdc_connect()
373 err = tmdc_setup_port(tmdc, i, data[i]); in tmdc_connect()
382 if (tmdc->port[i]) { in tmdc_connect()
383 input_unregister_device(tmdc->port[i]->dev); in tmdc_connect()
384 kfree(tmdc->port[i]); in tmdc_connect()
389 kfree(tmdc); in tmdc_connect()
395 struct tmdc *tmdc = gameport_get_drvdata(gameport); in tmdc_disconnect() local
399 if (tmdc->port[i]) { in tmdc_disconnect()
400 input_unregister_device(tmdc->port[i]->dev); in tmdc_disconnect()
401 kfree(tmdc->port[i]); in tmdc_disconnect()
406 kfree(tmdc); in tmdc_disconnect()