Lines Matching refs:grip

113 static int register_slot(int i, struct grip_mp *grip);
358 static int get_and_decode_packet(struct grip_mp *grip, int flags) in get_and_decode_packet() argument
368 flags = multiport_io(grip->gameport, flags, 0, &packet); in get_and_decode_packet()
369 grip->reads++; in get_and_decode_packet()
375 grip->bads++; in get_and_decode_packet()
385 port = grip->port[slot]; in get_and_decode_packet()
424 if (register_slot(slot, grip)) { in get_and_decode_packet()
449 static int slots_valid(struct grip_mp *grip) in slots_valid() argument
453 flags = get_and_decode_packet(grip, 0); in slots_valid()
458 if (grip->port[slot]->mode == GRIP_MODE_RESET) in slots_valid()
460 if (grip->port[slot]->mode != GRIP_MODE_NONE) in slots_valid()
477 static int multiport_init(struct grip_mp *grip) in multiport_init() argument
482 dig_mode = dig_mode_start(grip->gameport, &packet); in multiport_init()
484 dig_mode = dig_mode_start(grip->gameport, &packet); in multiport_init()
497 if (slots_valid(grip)) { in multiport_init()
510 static void report_slot(struct grip_mp *grip, int slot) in report_slot() argument
512 struct grip_port *port = grip->port[slot]; in report_slot()
538 struct grip_mp *grip = gameport_get_drvdata(gameport); in grip_poll() local
544 flags = get_and_decode_packet(grip, flags); in grip_poll()
553 if (grip->port[i]->dirty) in grip_poll()
554 report_slot(grip, i); in grip_poll()
563 struct grip_mp *grip = input_get_drvdata(dev); in grip_open() local
565 gameport_start_polling(grip->gameport); in grip_open()
575 struct grip_mp *grip = input_get_drvdata(dev); in grip_close() local
577 gameport_stop_polling(grip->gameport); in grip_close()
584 static int register_slot(int slot, struct grip_mp *grip) in register_slot() argument
586 struct grip_port *port = grip->port[slot]; in register_slot()
600 input_dev->dev.parent = &grip->gameport->dev; in register_slot()
602 input_set_drvdata(input_dev, grip); in register_slot()
625 report_slot(grip, slot); in register_slot()
632 struct grip_mp *grip; in grip_connect() local
635 if (!(grip = kzalloc(sizeof(struct grip_mp), GFP_KERNEL))) in grip_connect()
638 grip->gameport = gameport; in grip_connect()
640 gameport_set_drvdata(gameport, grip); in grip_connect()
649 if (!multiport_init(grip)) { in grip_connect()
654 if (!grip->port[0]->mode && !grip->port[1]->mode && !grip->port[2]->mode && !grip->port[3]->mode) { in grip_connect()
664 kfree(grip); in grip_connect()
670 struct grip_mp *grip = gameport_get_drvdata(gameport); in grip_disconnect() local
674 if (grip->port[i]->registered) in grip_disconnect()
675 input_unregister_device(grip->port[i]->dev); in grip_disconnect()
678 kfree(grip); in grip_disconnect()