Lines Matching refs:tmdc
107 struct tmdc {
226 struct tmdc *tmdc = gameport_get_drvdata(gameport);
230 tmdc->reads++;
232 if ((r = tmdc_read_packet(tmdc->gameport, data)) != tmdc->exists)
236 if (r & (1 << i) & tmdc->exists) {
238 if (tmdc_parse_packet(tmdc->port[i], data[i]))
244 tmdc->bads += bad;
249 struct tmdc *tmdc = input_get_drvdata(dev);
251 gameport_start_polling(tmdc->gameport);
257 struct tmdc *tmdc = input_get_drvdata(dev);
259 gameport_stop_polling(tmdc->gameport);
262 static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data)
270 tmdc->port[idx] = port = kzalloc(sizeof (struct tmdc_port), GFP_KERNEL);
300 snprintf(port->phys, sizeof(port->phys), "%s/input%d", tmdc->gameport->phys, i);
310 input_dev->dev.parent = &tmdc->gameport->dev;
312 input_set_drvdata(input_dev, tmdc);
350 struct tmdc *tmdc;
354 if (!(tmdc = kzalloc(sizeof(struct tmdc), GFP_KERNEL)))
357 tmdc->gameport = gameport;
359 gameport_set_drvdata(gameport, tmdc);
365 if (!(tmdc->exists = tmdc_read_packet(gameport, data))) {
374 if (tmdc->exists & (1 << i)) {
376 err = tmdc_setup_port(tmdc, i, data[i]);
385 if (tmdc->port[i]) {
386 input_unregister_device(tmdc->port[i]->dev);
387 kfree(tmdc->port[i]);
392 kfree(tmdc);
398 struct tmdc *tmdc = gameport_get_drvdata(gameport);
402 if (tmdc->port[i]) {
403 input_unregister_device(tmdc->port[i]->dev);
404 kfree(tmdc->port[i]);
409 kfree(tmdc);
414 .name = "tmdc",