ir->input.dev = &pci->dev; 
input_dev->cdev.dev = &pci->dev; 
int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci){	struct cx88_IR *ir;	IR_KEYTAB_TYPE *ir_codes = NULL;	int ir_type = IR_TYPE_OTHER;	ir = kmalloc(sizeof(*ir), GFP_KERNEL);	if (NULL == ir)		return -ENOMEM;	memset(ir, 0, sizeof(*ir));	/* detect & configure */	switch (core->board) {	case CX88_BOARD_DNTV_LIVE_DVB_T:	case CX88_BOARD_KWORLD_DVB_T:		ir_codes = ir_codes_dntv_live_dvb_t;		ir->gpio_addr = MO_GP1_IO;		ir->mask_keycode = 0x1f;		ir->mask_keyup = 0x60;		ir->polling = 50; /* ms */		break;	case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:		ir_codes = ir_codes_cinergy_1400;		ir_type = IR_TYPE_PD;		ir->sampling = 1;		break;	case CX88_BOARD_HAUPPAUGE:	case CX88_BOARD_HAUPPAUGE_DVB_T1:		ir_codes = ir_codes_hauppauge_new;		ir_type = IR_TYPE_RC5;		ir->sampling = 1;		break;	case CX88_BOARD_WINFAST2000XP_EXPERT:		ir_codes = ir_codes_winfast;		ir->gpio_addr = MO_GP0_IO;		ir->mask_keycode = 0x8f8;		ir->mask_keyup = 0x100;		ir->polling = 1; /* ms */		break;	case CX88_BOARD_IODATA_GVBCTV7E:		ir_codes = ir_codes_iodata_bctv7e;		ir->gpio_addr = MO_GP0_IO;		ir->mask_keycode = 0xfd;		ir->mask_keydown = 0x02;		ir->polling = 5; /* ms */		break;	case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO:		ir_codes = ir_codes_pixelview;		ir->gpio_addr = MO_GP1_IO;		ir->mask_keycode = 0x1f;		ir->mask_keyup = 0x80;		ir->polling = 1; /* ms */		break;	case CX88_BOARD_ADSTECH_DVB_T_PCI:		ir_codes = ir_codes_adstech_dvb_t_pci;		ir->gpio_addr = MO_GP1_IO;		ir->mask_keycode = 0xbf;		ir->mask_keyup = 0x40;		ir->polling = 50; /* ms */		break;	case CX88_BOARD_MSI_TVANYWHERE_MASTER:		ir_codes = ir_codes_msi_tvanywhere;		ir->gpio_addr = MO_GP1_IO;		ir->mask_keycode = 0x1f;		ir->mask_keyup = 0x40;		ir->polling = 1; /* ms */		break;	}	if (NULL == ir_codes) {		kfree(ir);		return -ENODEV;	}	/* init input device */	snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)",		 cx88_boards[core->board].name);	snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));	ir_input_init(&ir->input, &ir->ir, ir_type, ir_codes);	ir->input.name = ir->name;	ir->input.phys = ir->phys;	ir->input.id.bustype = BUS_PCI;	ir->input.id.version = 1;	if (pci->subsystem_vendor) {		ir->input.id.vendor = pci->subsystem_vendor;		ir->input.id.product = pci->subsystem_device;	} else {		ir->input.id.vendor = pci->vendor;		ir->input.id.product = pci->device;	}	ir->input.dev = &pci->dev;	/* record handles to ourself */	ir->core = core;	core->ir = ir;	if (ir->polling) {		INIT_WORK(&ir->work, cx88_ir_work, ir);		init_timer(&ir->timer);		ir->timer.function = ir_timer;		ir->timer.data = (unsigned long)ir;		schedule_work(&ir->work);	}	if (ir->sampling) {		core->pci_irqmask |= (1 << 18);	/* IR_SMP_INT */		cx_write(MO_DDS_IO, 0xa80a80);	/* 4 kHz sample rate */		cx_write(MO_DDSCFG_IO, 0x5);	/* enable */	}	/* all done */	input_register_device(&ir->input);	printk("%s: registered IR remote control\n", core->name);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b7df3910c1298fee8ed7b9dfd2da74b85df5539c/cx88-input.c/clean/drivers/media/video/cx88/cx88-input.c