input_report_key(dev + i, gc_snes_btn[j], s & data[gc_snes_bytes[j]]); 
input_report_key(gc->dev[i], gc_snes_btn[j], s & data[gc_snes_bytes[j]]); 
static void gc_timer(unsigned long private){	struct gc *gc = (void *) private;	struct input_dev *dev = gc->dev;	unsigned char data[GC_MAX_LENGTH];	unsigned char data_psx[5][GC_PSX_BYTES];	int i, j, s;/* * N64 pads - must be read first, any read confuses them for 200 us */	if (gc->pads[GC_N64]) {		gc_n64_read_packet(gc, data);		for (i = 0; i < 5; i++) {			s = gc_status_bit[i];			if (s & gc->pads[GC_N64] & ~(data[8] | data[9])) {				signed char axes[2];				axes[0] = axes[1] = 0;				for (j = 0; j < 8; j++) {					if (data[23 - j] & s) axes[0] |= 1 << j;					if (data[31 - j] & s) axes[1] |= 1 << j;				}				input_report_abs(dev + i, ABS_X,  axes[0]);				input_report_abs(dev + i, ABS_Y, -axes[1]);				input_report_abs(dev + i, ABS_HAT0X, !(s & data[6]) - !(s & data[7]));				input_report_abs(dev + i, ABS_HAT0Y, !(s & data[4]) - !(s & data[5]));				for (j = 0; j < 10; j++)					input_report_key(dev + i, gc_n64_btn[j], s & data[gc_n64_bytes[j]]);				input_sync(dev + i);			}		}	}/* * NES and SNES pads */	if (gc->pads[GC_NES] || gc->pads[GC_SNES]) {		gc_nes_read_packet(gc, gc->pads[GC_SNES] ? GC_SNES_LENGTH : GC_NES_LENGTH, data);		for (i = 0; i < 5; i++) {			s = gc_status_bit[i];			if (s & (gc->pads[GC_NES] | gc->pads[GC_SNES])) {				input_report_abs(dev + i, ABS_X, !(s & data[6]) - !(s & data[7]));				input_report_abs(dev + i, ABS_Y, !(s & data[4]) - !(s & data[5]));			}			if (s & gc->pads[GC_NES])				for (j = 0; j < 4; j++)					input_report_key(dev + i, gc_snes_btn[j], s & data[gc_nes_bytes[j]]);			if (s & gc->pads[GC_SNES])				for (j = 0; j < 8; j++)					input_report_key(dev + i, gc_snes_btn[j], s & data[gc_snes_bytes[j]]);			input_sync(dev + i);		}	}/* * Multi and Multi2 joysticks */	if (gc->pads[GC_MULTI] || gc->pads[GC_MULTI2]) {		gc_multi_read_packet(gc, gc->pads[GC_MULTI2] ? GC_MULTI2_LENGTH : GC_MULTI_LENGTH, data);		for (i = 0; i < 5; i++) {			s = gc_status_bit[i];			if (s & (gc->pads[GC_MULTI] | gc->pads[GC_MULTI2])) {				input_report_abs(dev + i, ABS_X,  !(s & data[2]) - !(s & data[3]));				input_report_abs(dev + i, ABS_Y,  !(s & data[0]) - !(s & data[1]));				input_report_key(dev + i, BTN_TRIGGER, s & data[4]);			}			if (s & gc->pads[GC_MULTI2])				input_report_key(dev + i, BTN_THUMB, s & data[5]);			input_sync(dev + i);		}	}/* * PSX controllers */	if (gc->pads[GC_PSX] || gc->pads[GC_DDR]) {		gc_psx_read_packet(gc, data_psx, data);		for (i = 0; i < 5; i++) {			switch (data[i]) {				case GC_PSX_RUMBLE:					input_report_key(dev + i, BTN_THUMBL, ~data_psx[i][0] & 0x04);					input_report_key(dev + i, BTN_THUMBR, ~data_psx[i][0] & 0x02);				case GC_PSX_NEGCON:				case GC_PSX_ANALOG:					if(gc->pads[GC_DDR] & gc_status_bit[i]) {						for(j = 0; j < 4; j++)							input_report_key(dev + i, gc_psx_ddr_btn[j], ~data_psx[i][0] & (0x10 << j));					} else {						for (j = 0; j < 4; j++)							input_report_abs(dev + i, gc_psx_abs[j+2], data_psx[i][j + 2]);						input_report_abs(dev + i, ABS_X, 128 + !(data_psx[i][0] & 0x20) * 127 - !(data_psx[i][0] & 0x80) * 128);						input_report_abs(dev + i, ABS_Y, 128 + !(data_psx[i][0] & 0x40) * 127 - !(data_psx[i][0] & 0x10) * 128);					}					for (j = 0; j < 8; j++)						input_report_key(dev + i, gc_psx_btn[j], ~data_psx[i][1] & (1 << j));					input_report_key(dev + i, BTN_START,  ~data_psx[i][0] & 0x08);					input_report_key(dev + i, BTN_SELECT, ~data_psx[i][0] & 0x01);					input_sync(dev + i);					break;				case GC_PSX_NORMAL:					if(gc->pads[GC_DDR] & gc_status_bit[i]) {						for(j = 0; j < 4; j++)							input_report_key(dev + i, gc_psx_ddr_btn[j], ~data_psx[i][0] & (0x10 << j));					} else {						input_report_abs(dev + i, ABS_X, 128 + !(data_psx[i][0] & 0x20) * 127 - !(data_psx[i][0] & 0x80) * 128);						input_report_abs(dev + i, ABS_Y, 128 + !(data_psx[i][0] & 0x40) * 127 - !(data_psx[i][0] & 0x10) * 128);						/* for some reason if the extra axes are left unset they drift */						/* for (j = 0; j < 4; j++)							input_report_abs(dev + i, gc_psx_abs[j+2], 128);						 * This needs to be debugged properly,						 * maybe fuzz processing needs to be done in input_sync()						 *				 --vojtech						 */					}					for (j = 0; j < 8; j++)						input_report_key(dev + i, gc_psx_btn[j], ~data_psx[i][1] & (1 << j));					input_report_key(dev + i, BTN_START,  ~data_psx[i][0] & 0x08);					input_report_key(dev + i, BTN_SELECT, ~data_psx[i][0] & 0x01);					input_sync(dev + i);					break;				case 0: /* not a pad, ignore */					break;			}		}	}	mod_timer(&gc->timer, jiffies + GC_REFRESH_TIME);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/17dd3f0f7aa729a042af5d3318ff9b3e7781b45b/gamecon.c/clean/drivers/input/joystick/gamecon.c