/* sw_init_digital() initializes a SideWinder 3D Pro joystick into digital mode.  */
static void sw_init_digital(struct gameport *gameport)
/* sw_init_digital() initializes a SideWinder 3D Pro joystick into digital mode.  */
static void sw_init_digital(struct gameport *gameport)
{
	int seq[] = { 140, 140+725, 140+300, 0 };
	unsigned long flags;
	int i, t;
        local_irq_save(flags);
	i = 0;
        do {
                gameport_trigger(gameport);
		t = gameport_time(gameport, SW_TIMEOUT * 1000);
		while ((gameport_read(gameport) & 1) && t) t--;
                udelay(seq[i]);
        } while (seq[++i]);
	gameport_trigger(gameport);
	local_irq_restore(flags);
}