input_register_device(&analog->dev); 
input_register_device(analog->dev); 
static void analog_init_device(struct analog_port *port, struct analog *analog, int index){	int i, j, t, v, w, x, y, z;	analog_name(analog);	sprintf(analog->phys, "%s/input%d", port->gameport->phys, index);	analog->buttons = (analog->mask & ANALOG_GAMEPAD) ? analog_pad_btn : analog_joy_btn;	init_input_dev(&analog->dev);	analog->dev.name = analog->name;	analog->dev.phys = analog->phys;	analog->dev.id.bustype = BUS_GAMEPORT;	analog->dev.id.vendor = GAMEPORT_ID_VENDOR_ANALOG;	analog->dev.id.product = analog->mask >> 4;	analog->dev.id.version = 0x0100;	analog->dev.open = analog_open;	analog->dev.close = analog_close;	analog->dev.private = port;	analog->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	for (i = j = 0; i < 4; i++)		if (analog->mask & (1 << i)) {			t = analog_axes[j];			x = port->axes[i];			y = (port->axes[0] + port->axes[1]) >> 1;			z = y - port->axes[i];			z = z > 0 ? z : -z;			v = (x >> 3);			w = (x >> 3);			set_bit(t, analog->dev.absbit);			if ((i == 2 || i == 3) && (j == 2 || j == 3) && (z > (y >> 3)))				x = y;			if (analog->mask & ANALOG_SAITEK) {				if (i == 2) x = port->axes[i];				v = x - (x >> 2);				w = (x >> 4);			}			analog->dev.absmax[t] = (x << 1) - v;			analog->dev.absmin[t] = v;			analog->dev.absfuzz[t] = port->fuzz;			analog->dev.absflat[t] = w;			j++;		}	for (i = j = 0; i < 3; i++)		if (analog->mask & analog_exts[i])			for (x = 0; x < 2; x++) {				t = analog_hats[j++];				set_bit(t, analog->dev.absbit);				analog->dev.absmax[t] = 1;				analog->dev.absmin[t] = -1;			}	for (i = j = 0; i < 4; i++)		if (analog->mask & (0x10 << i))			set_bit(analog->buttons[j++], analog->dev.keybit);	if (analog->mask & ANALOG_BTNS_CHF)		for (i = 0; i < 2; i++)			set_bit(analog->buttons[j++], analog->dev.keybit);	if (analog->mask & ANALOG_HBTN_CHF)		for (i = 0; i < 4; i++)			set_bit(analog->buttons[j++], analog->dev.keybit);	for (i = 0; i < 4; i++)		if (analog->mask & (ANALOG_BTN_TL << i))			set_bit(analog_pads[i], analog->dev.keybit);	analog_decode(analog, port->axes, port->initial, port->buttons);	input_register_device(&analog->dev);	printk(KERN_INFO "input: %s at %s", analog->name, port->gameport->phys);	if (port->cooked)		printk(" [ADC port]\n");	else		printk(" [%s timer, %d %sHz clock, %d ns res]\n", TIME_NAME,		port->speed > 10000 ? (port->speed + 800) / 1000 : port->speed,		port->speed > 10000 ? "M" : "k",		port->speed > 10000 ? (port->loop * 1000) / (port->speed / 1000)				    : (port->loop * 1000000) / port->speed);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/17dd3f0f7aa729a042af5d3318ff9b3e7781b45b/analog.c/buggy/drivers/input/joystick/analog.c