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