case 0x60: name        = "em2820"; ir->get_key = get_key_knc1; ir->c.addr  = addr>>1; ir_type     = IR_TYPE_OTHER; ir_codes    = ir_codes_em2820;
case 0x30: switch(kind){ case IR_TERRATEC_REMOTE: name        = "Terratec IR"; ir->get_key = get_key_knc1; ir_type     = IR_TYPE_OTHER; ir_codes    = ir_codes_em2820; break; default: name        = "KNC One"; ir->get_key = get_key_knc1; ir_type     = IR_TYPE_OTHER; ir_codes    = ir_codes_em2820; }
static int ir_attach(struct i2c_adapter *adap, int addr,		     unsigned short flags, int kind){	IR_KEYTAB_TYPE *ir_codes = NULL;	char *name;	int ir_type;        struct IR *ir;	struct input_dev *input_dev;	ir = kzalloc(sizeof(struct IR), GFP_KERNEL);	input_dev = input_allocate_device();	if (!ir || !input_dev) {		kfree(ir);		input_free_device(input_dev);                return -ENOMEM;	}	ir->c = client_template;	ir->input = input_dev;	i2c_set_clientdata(&ir->c, ir);	ir->c.adapter = adap;	ir->c.addr    = addr;	switch(addr) {	case 0x64:		name        = "Pixelview";		ir->get_key = get_key_pixelview;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_empty;		break;	case 0x4b:		name        = "PV951";		ir->get_key = get_key_pv951;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_pv951;		break;	case 0x18:	case 0x1a:		name        = "Hauppauge";		ir->get_key = get_key_haup;		ir_type     = IR_TYPE_RC5;		ir_codes    = ir_codes_rc5_tv;		break;	case 0x60:		name        = "em2820";		ir->get_key = get_key_knc1;		ir->c.addr  = addr>>1;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_em2820;		break;	case 0x30:		name        = "KNC One";		ir->get_key = get_key_knc1;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_empty;		break;	case 0x7a:		name        = "Purple TV";		ir->get_key = get_key_purpletv;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_purpletv;		break;	default:		/* shouldn't happen */		printk(DEVNAME ": Huh? unknown i2c address (0x%02x)?\n",addr);		kfree(ir);		return -1;	}	/* register i2c device */	i2c_attach_client(&ir->c);	snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (%s)", name);	snprintf(ir->phys, sizeof(ir->phys), "%s/%s/ir0",		 ir->c.adapter->dev.bus_id,		 ir->c.dev.bus_id);	/* init + register input device */	ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);	input_dev->id.bustype	= BUS_I2C;	input_dev->name		= ir->c.name;	input_dev->phys		= ir->phys;	input_register_device(ir->input);	/* start polling via eventd */	INIT_WORK(&ir->work, ir_work, ir);	init_timer(&ir->timer);	ir->timer.function = ir_timer;	ir->timer.data     = (unsigned long)ir;	schedule_work(&ir->work);	return 0;}