init_input_dev(&spitzkbd->input); spitzkbd->input.private = spitzkbd; spitzkbd->input.name = "Spitz Keyboard"; spitzkbd->input.dev = dev; spitzkbd->input.phys = spitzkbd->phys; spitzkbd->input.id.bustype = BUS_HOST; spitzkbd->input.id.vendor = 0x0001; spitzkbd->input.id.product = 0x0001; spitzkbd->input.id.version = 0x0100; spitzkbd->input.evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); spitzkbd->input.keycode = spitzkbd->keycode; spitzkbd->input.keycodesize = sizeof(unsigned char); spitzkbd->input.keycodemax = ARRAY_SIZE(spitzkbd_keycode); 
spitzkbd->input = input_dev;  input_dev->private = spitzkbd; input_dev->name = "Spitz Keyboard"; input_dev->phys = spitzkbd->phys; input_dev->cdev.dev = dev;  input_dev->id.bustype = BUS_HOST; input_dev->id.vendor = 0x0001; input_dev->id.product = 0x0001; input_dev->id.version = 0x0100;  input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); input_dev->keycode = spitzkbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(spitzkbd_keycode); 
static int __init spitzkbd_probe(struct device *dev){	int i;	struct spitzkbd *spitzkbd;	spitzkbd = kzalloc(sizeof(struct spitzkbd), GFP_KERNEL);	if (!spitzkbd)		return -ENOMEM;	dev_set_drvdata(dev,spitzkbd);	strcpy(spitzkbd->phys, "spitzkbd/input0");	spin_lock_init(&spitzkbd->lock);	/* Init Keyboard rescan timer */	init_timer(&spitzkbd->timer);	spitzkbd->timer.function = spitzkbd_timer_callback;	spitzkbd->timer.data = (unsigned long) spitzkbd;	/* Init Hinge Timer */	init_timer(&spitzkbd->htimer);	spitzkbd->htimer.function = spitzkbd_hinge_timer;	spitzkbd->htimer.data = (unsigned long) spitzkbd;	spitzkbd->suspend_jiffies=jiffies;	init_input_dev(&spitzkbd->input);	spitzkbd->input.private = spitzkbd;	spitzkbd->input.name = "Spitz Keyboard";	spitzkbd->input.dev = dev;	spitzkbd->input.phys = spitzkbd->phys;	spitzkbd->input.id.bustype = BUS_HOST;	spitzkbd->input.id.vendor = 0x0001;	spitzkbd->input.id.product = 0x0001;	spitzkbd->input.id.version = 0x0100;	spitzkbd->input.evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW);	spitzkbd->input.keycode = spitzkbd->keycode;	spitzkbd->input.keycodesize = sizeof(unsigned char);	spitzkbd->input.keycodemax = ARRAY_SIZE(spitzkbd_keycode);	memcpy(spitzkbd->keycode, spitzkbd_keycode, sizeof(spitzkbd->keycode));	for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++)		set_bit(spitzkbd->keycode[i], spitzkbd->input.keybit);	clear_bit(0, spitzkbd->input.keybit);	set_bit(SW_0, spitzkbd->input.swbit);	set_bit(SW_1, spitzkbd->input.swbit);	input_register_device(&spitzkbd->input);	mod_timer(&spitzkbd->htimer, jiffies + msecs_to_jiffies(HINGE_SCAN_INTERVAL));	/* Setup sense interrupts - RisingEdge Detect, sense lines as inputs */	for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) {		pxa_gpio_mode(spitz_senses[i] | GPIO_IN);		if (request_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd_interrupt,						SA_INTERRUPT, "Spitzkbd Sense", spitzkbd))			printk(KERN_WARNING "spitzkbd: Can't get Sense IRQ: %d!\n", i);		else			set_irq_type(IRQ_GPIO(spitz_senses[i]),IRQT_RISING);	}	/* Set Strobe lines as outputs - set high */	for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++)		pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH);	pxa_gpio_mode(SPITZ_GPIO_SYNC | GPIO_IN);	pxa_gpio_mode(SPITZ_GPIO_ON_KEY | GPIO_IN);	pxa_gpio_mode(SPITZ_GPIO_SWA | GPIO_IN);	pxa_gpio_mode(SPITZ_GPIO_SWB | GPIO_IN);	request_irq(SPITZ_IRQ_GPIO_SYNC, spitzkbd_interrupt, SA_INTERRUPT, "Spitzkbd Sync", spitzkbd);	request_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd_interrupt, SA_INTERRUPT, "Spitzkbd PwrOn", spitzkbd);	request_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd_hinge_isr, SA_INTERRUPT, "Spitzkbd SWA", spitzkbd);	request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr, SA_INTERRUPT, "Spitzkbd SWB", spitzkbd);	set_irq_type(SPITZ_IRQ_GPIO_SYNC, IRQT_BOTHEDGE);	set_irq_type(SPITZ_IRQ_GPIO_ON_KEY, IRQT_BOTHEDGE);	set_irq_type(SPITZ_IRQ_GPIO_SWA, IRQT_BOTHEDGE);	set_irq_type(SPITZ_IRQ_GPIO_SWB, IRQT_BOTHEDGE);	printk(KERN_INFO "input: Spitz Keyboard Registered\n");	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3c42f0c3dde8feb59fc87df45cadb847d5511c0a/spitzkbd.c/clean/drivers/input/keyboard/spitzkbd.c