gf2k->dev.absmax[gf2k_abs[i]] = (i < 2) ? gf2k->dev.abs[gf2k_abs[i]] * 2 - 32 : gf2k->dev.abs[gf2k_abs[0]] + gf2k->dev.abs[gf2k_abs[1]] - 32; gf2k->dev.absmin[gf2k_abs[i]] = 32; gf2k->dev.absfuzz[gf2k_abs[i]] = 8; gf2k->dev.absflat[gf2k_abs[i]] = (i < 2) ? 24 : 0; 
input_dev->absmax[gf2k_abs[i]] = (i < 2) ? input_dev->abs[gf2k_abs[i]] * 2 - 32 : input_dev->abs[gf2k_abs[0]] + input_dev->abs[gf2k_abs[1]] - 32; input_dev->absmin[gf2k_abs[i]] = 32; input_dev->absfuzz[gf2k_abs[i]] = 8; input_dev->absflat[gf2k_abs[i]] = (i < 2) ? 24 : 0; 
static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv){	struct gf2k *gf2k;	unsigned char data[GF2K_LENGTH];	int i, err;	if (!(gf2k = kzalloc(sizeof(struct gf2k), GFP_KERNEL)))		return -ENOMEM;	gf2k->gameport = gameport;	gameport_set_drvdata(gameport, gf2k);	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);	if (err)		goto fail1;	gf2k_trigger_seq(gameport, gf2k_seq_reset);	msleep(GF2K_TIMEOUT);	gf2k_trigger_seq(gameport, gf2k_seq_digital);	msleep(GF2K_TIMEOUT);	if (gf2k_read_packet(gameport, GF2K_LENGTH, data) < 12) {		err = -ENODEV;		goto fail2;	}	if (!(gf2k->id = GB(7,2,0) | GB(3,3,2) | GB(0,3,5))) {		err = -ENODEV;		goto fail2;	}#ifdef RESET_WORKS	if ((gf2k->id != (GB(19,2,0) | GB(15,3,2) | GB(12,3,5))) ||	    (gf2k->id != (GB(31,2,0) | GB(27,3,2) | GB(24,3,5)))) {		err = -ENODEV;		goto fail2;	}#else	gf2k->id = 6;#endif	if (gf2k->id > GF2K_ID_MAX || !gf2k_axes[gf2k->id]) {		printk(KERN_WARNING "gf2k.c: Not yet supported joystick on %s. [id: %d type:%s]\n",			gameport->phys, gf2k->id, gf2k->id > GF2K_ID_MAX ? "Unknown" : gf2k_names[gf2k->id]);		err = -ENODEV;		goto fail2;	}	gameport_set_poll_handler(gameport, gf2k_poll);	gameport_set_poll_interval(gameport, 20);	sprintf(gf2k->phys, "%s/input0", gameport->phys);	gf2k->length = gf2k_lens[gf2k->id];	init_input_dev(&gf2k->dev);	gf2k->dev.private = gf2k;	gf2k->dev.open = gf2k_open;	gf2k->dev.close = gf2k_close;	gf2k->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	gf2k->dev.name = gf2k_names[gf2k->id];	gf2k->dev.phys = gf2k->phys;	gf2k->dev.id.bustype = BUS_GAMEPORT;	gf2k->dev.id.vendor = GAMEPORT_ID_VENDOR_GENIUS;	gf2k->dev.id.product = gf2k->id;	gf2k->dev.id.version = 0x0100;	for (i = 0; i < gf2k_axes[gf2k->id]; i++)		set_bit(gf2k_abs[i], gf2k->dev.absbit);	for (i = 0; i < gf2k_hats[gf2k->id]; i++) {		set_bit(ABS_HAT0X + i, gf2k->dev.absbit);		gf2k->dev.absmin[ABS_HAT0X + i] = -1;		gf2k->dev.absmax[ABS_HAT0X + i] = 1;	}	for (i = 0; i < gf2k_joys[gf2k->id]; i++)		set_bit(gf2k_btn_joy[i], gf2k->dev.keybit);	for (i = 0; i < gf2k_pads[gf2k->id]; i++)		set_bit(gf2k_btn_pad[i], gf2k->dev.keybit);	gf2k_read_packet(gameport, gf2k->length, data);	gf2k_read(gf2k, data);	for (i = 0; i < gf2k_axes[gf2k->id]; i++) {		gf2k->dev.absmax[gf2k_abs[i]] = (i < 2) ? gf2k->dev.abs[gf2k_abs[i]] * 2 - 32 :			  gf2k->dev.abs[gf2k_abs[0]] + gf2k->dev.abs[gf2k_abs[1]] - 32;		gf2k->dev.absmin[gf2k_abs[i]] = 32;		gf2k->dev.absfuzz[gf2k_abs[i]] = 8;		gf2k->dev.absflat[gf2k_abs[i]] = (i < 2) ? 24 : 0;	}	input_register_device(&gf2k->dev);	printk(KERN_INFO "input: %s on %s\n", gf2k_names[gf2k->id], gameport->phys);	return 0;fail2:	gameport_close(gameport);fail1:	gameport_set_drvdata(gameport, NULL);	kfree(gf2k);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/17dd3f0f7aa729a042af5d3318ff9b3e7781b45b/gf2k.c/buggy/drivers/input/joystick/gf2k.c