ir_input_init(&ir->dev, &ir->ir, ir_type, ir_codes); ir->dev.name = ir->name; ir->dev.phys = ir->phys; ir->dev.id.bustype = BUS_PCI; ir->dev.id.version = 1; 
ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); input_dev->name = ir->name; input_dev->phys = ir->phys; input_dev->id.bustype = BUS_PCI; input_dev->id.version = 1; 
int saa7134_input_init1(struct saa7134_dev *dev){	struct saa7134_ir *ir;	IR_KEYTAB_TYPE *ir_codes = NULL;	u32 mask_keycode = 0;	u32 mask_keydown = 0;	u32 mask_keyup   = 0;	int polling      = 0;	int ir_type      = IR_TYPE_OTHER;	if (!dev->has_remote)		return -ENODEV;	if (disable_ir)		return -ENODEV;	/* detect & configure */	switch (dev->board) {	case SAA7134_BOARD_FLYVIDEO2000:	case SAA7134_BOARD_FLYVIDEO3000:        case SAA7134_BOARD_FLYTVPLATINUM_FM:		ir_codes     = flyvideo_codes;		mask_keycode = 0xEC00000;		mask_keydown = 0x0040000;		break;	case SAA7134_BOARD_CINERGY400:	case SAA7134_BOARD_CINERGY600:	case SAA7134_BOARD_CINERGY600_MK3:		ir_codes     = cinergy_codes;		mask_keycode = 0x00003f;		mask_keyup   = 0x040000;		break;	case SAA7134_BOARD_ECS_TVP3XP:	case SAA7134_BOARD_ECS_TVP3XP_4CB5:		ir_codes     = eztv_codes;		mask_keycode = 0x00017c;		mask_keyup   = 0x000002;		polling      = 50; // ms		break;	case SAA7134_BOARD_KWORLD_XPERT:	case SAA7134_BOARD_AVACSSMARTTV:		ir_codes     = avacssmart_codes;		mask_keycode = 0x00001F;		mask_keyup   = 0x000020;		polling      = 50; // ms		break;	case SAA7134_BOARD_MD2819:	case SAA7134_BOARD_KWORLD_VSTREAM_XPERT:	case SAA7134_BOARD_AVERMEDIA_305:	case SAA7134_BOARD_AVERMEDIA_307:	case SAA7134_BOARD_AVERMEDIA_STUDIO_305:	case SAA7134_BOARD_AVERMEDIA_STUDIO_307:	case SAA7134_BOARD_AVERMEDIA_GO_007_FM:		ir_codes     = md2819_codes;		mask_keycode = 0x0007C8;		mask_keydown = 0x000010;		polling      = 50; // ms		/* Set GPIO pin2 to high to enable the IR controller */		saa_setb(SAA7134_GPIO_GPMODE0, 0x4);		saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4);		break;	case SAA7134_BOARD_MANLI_MTV001:	case SAA7134_BOARD_MANLI_MTV002:		ir_codes     = manli_codes;		mask_keycode = 0x001f00;		mask_keyup   = 0x004000;		mask_keydown = 0x002000;		polling      = 50; // ms		break;	case SAA7134_BOARD_VIDEOMATE_TV_PVR:	case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII:		ir_codes     = videomate_tv_pvr_codes;		mask_keycode = 0x00003F;		mask_keyup   = 0x400000;		polling      = 50; // ms		break;	}	if (NULL == ir_codes) {		printk("%s: Oops: IR config error [card=%d]\n",		       dev->name, dev->board);		return -ENODEV;	}	ir = kmalloc(sizeof(*ir),GFP_KERNEL);	if (NULL == ir)		return -ENOMEM;	memset(ir,0,sizeof(*ir));	/* init hardware-specific stuff */	ir->mask_keycode = mask_keycode;	ir->mask_keydown = mask_keydown;	ir->mask_keyup   = mask_keyup;        ir->polling      = polling;	/* init input device */	snprintf(ir->name, sizeof(ir->name), "saa7134 IR (%s)",		 saa7134_boards[dev->board].name);	snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",		 pci_name(dev->pci));	ir_input_init(&ir->dev, &ir->ir, ir_type, ir_codes);	ir->dev.name = ir->name;	ir->dev.phys = ir->phys;	ir->dev.id.bustype = BUS_PCI;	ir->dev.id.version = 1;	if (dev->pci->subsystem_vendor) {		ir->dev.id.vendor  = dev->pci->subsystem_vendor;		ir->dev.id.product = dev->pci->subsystem_device;	} else {		ir->dev.id.vendor  = dev->pci->vendor;		ir->dev.id.product = dev->pci->device;	}	ir->dev.dev = &dev->pci->dev;	/* all done */	dev->remote = ir;	if (ir->polling) {		init_timer(&ir->timer);		ir->timer.function = saa7134_input_timer;		ir->timer.data     = (unsigned long)dev;		ir->timer.expires  = jiffies + HZ;		add_timer(&ir->timer);	}	input_register_device(&dev->remote->dev);	printk("%s: registered input device for IR\n",dev->name);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b7df3910c1298fee8ed7b9dfd2da74b85df5539c/saa7134-input.c/buggy/drivers/media/video/saa7134/saa7134-input.c