Lines Matching refs:tmdc
124 struct tmdc {
232 struct tmdc *tmdc = gameport_get_drvdata(gameport);
236 tmdc->reads++;
238 if ((r = tmdc_read_packet(tmdc->gameport, data)) != tmdc->exists)
242 if (r & (1 << i) & tmdc->exists) {
244 if (tmdc_parse_packet(tmdc->port[i], data[i]))
250 tmdc->bads += bad;
255 struct tmdc *tmdc = input_get_drvdata(dev);
257 gameport_start_polling(tmdc->gameport);
263 struct tmdc *tmdc = input_get_drvdata(dev);
265 gameport_stop_polling(tmdc->gameport);
268 static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data)
276 tmdc->port[idx] = port = kzalloc(sizeof (struct tmdc_port), GFP_KERNEL);
306 snprintf(port->phys, sizeof(port->phys), "%s/input%d", tmdc->gameport->phys, i);
316 input_dev->dev.parent = &tmdc->gameport->dev;
318 input_set_drvdata(input_dev, tmdc);
356 struct tmdc *tmdc;
360 if (!(tmdc = kzalloc(sizeof(struct tmdc), GFP_KERNEL)))
363 tmdc->gameport = gameport;
365 gameport_set_drvdata(gameport, tmdc);
371 if (!(tmdc->exists = tmdc_read_packet(gameport, data))) {
380 if (tmdc->exists & (1 << i)) {
382 err = tmdc_setup_port(tmdc, i, data[i]);
391 if (tmdc->port[i]) {
392 input_unregister_device(tmdc->port[i]->dev);
393 kfree(tmdc->port[i]);
398 kfree(tmdc);
404 struct tmdc *tmdc = gameport_get_drvdata(gameport);
408 if (tmdc->port[i]) {
409 input_unregister_device(tmdc->port[i]->dev);
410 kfree(tmdc->port[i]);
415 kfree(tmdc);
420 .name = "tmdc",