Lines Matching refs:locomokbd
58 struct locomokbd { struct
112 static void locomokbd_scankeyboard(struct locomokbd *locomokbd) in locomokbd_scankeyboard() argument
117 unsigned long membase = locomokbd->base; in locomokbd_scankeyboard()
119 spin_lock_irqsave(&locomokbd->lock, flags); in locomokbd_scankeyboard()
135 key = locomokbd->keycode[scancode]; in locomokbd_scankeyboard()
137 input_report_key(locomokbd->input, key, pressed); in locomokbd_scankeyboard()
148 locomokbd->suspend_jiffies + HZ)) in locomokbd_scankeyboard()
150 if (locomokbd->count_cancel++ in locomokbd_scankeyboard()
153 input_event(locomokbd->input, EV_PWR, in locomokbd_scankeyboard()
155 locomokbd->suspend_jiffies = jiffies; in locomokbd_scankeyboard()
157 locomokbd->count_cancel = 0; in locomokbd_scankeyboard()
163 input_sync(locomokbd->input); in locomokbd_scankeyboard()
167 mod_timer(&locomokbd->timer, jiffies + SCAN_INTERVAL); in locomokbd_scankeyboard()
169 locomokbd->count_cancel = 0; in locomokbd_scankeyboard()
171 spin_unlock_irqrestore(&locomokbd->lock, flags); in locomokbd_scankeyboard()
179 struct locomokbd *locomokbd = dev_id; in locomokbd_interrupt() local
182 r = locomo_readl(locomokbd->base + LOCOMO_KIC); in locomokbd_interrupt()
186 locomo_writel(r & ~0x0100, locomokbd->base + LOCOMO_KIC); /* Ack */ in locomokbd_interrupt()
191 locomokbd_scankeyboard(locomokbd); in locomokbd_interrupt()
200 struct locomokbd *locomokbd = from_timer(locomokbd, t, timer); in locomokbd_timer_callback() local
202 locomokbd_scankeyboard(locomokbd); in locomokbd_timer_callback()
207 struct locomokbd *locomokbd = input_get_drvdata(dev); in locomokbd_open() local
210 r = locomo_readl(locomokbd->base + LOCOMO_KIC) | 0x0010; in locomokbd_open()
211 locomo_writel(r, locomokbd->base + LOCOMO_KIC); in locomokbd_open()
217 struct locomokbd *locomokbd = input_get_drvdata(dev); in locomokbd_close() local
220 r = locomo_readl(locomokbd->base + LOCOMO_KIC) & ~0x0010; in locomokbd_close()
221 locomo_writel(r, locomokbd->base + LOCOMO_KIC); in locomokbd_close()
226 struct locomokbd *locomokbd; in locomokbd_probe() local
230 locomokbd = kzalloc(sizeof(struct locomokbd), GFP_KERNEL); in locomokbd_probe()
232 if (!locomokbd || !input_dev) { in locomokbd_probe()
246 locomo_set_drvdata(dev, locomokbd); in locomokbd_probe()
248 locomokbd->base = (unsigned long) dev->mapbase; in locomokbd_probe()
250 spin_lock_init(&locomokbd->lock); in locomokbd_probe()
252 timer_setup(&locomokbd->timer, locomokbd_timer_callback, 0); in locomokbd_probe()
254 locomokbd->suspend_jiffies = jiffies; in locomokbd_probe()
256 locomokbd->input = input_dev; in locomokbd_probe()
257 strcpy(locomokbd->phys, "locomokbd/input0"); in locomokbd_probe()
260 input_dev->phys = locomokbd->phys; in locomokbd_probe()
271 input_dev->keycode = locomokbd->keycode; in locomokbd_probe()
275 input_set_drvdata(input_dev, locomokbd); in locomokbd_probe()
277 memcpy(locomokbd->keycode, locomokbd_keycode, sizeof(locomokbd->keycode)); in locomokbd_probe()
279 set_bit(locomokbd->keycode[i], input_dev->keybit); in locomokbd_probe()
283 err = request_irq(dev->irq[0], locomokbd_interrupt, 0, "locomokbd", locomokbd); in locomokbd_probe()
289 err = input_register_device(locomokbd->input); in locomokbd_probe()
296 free_irq(dev->irq[0], locomokbd); in locomokbd_probe()
302 kfree(locomokbd); in locomokbd_probe()
309 struct locomokbd *locomokbd = locomo_get_drvdata(dev); in locomokbd_remove() local
311 free_irq(dev->irq[0], locomokbd); in locomokbd_remove()
313 del_timer_sync(&locomokbd->timer); in locomokbd_remove()
315 input_unregister_device(locomokbd->input); in locomokbd_remove()
320 kfree(locomokbd); in locomokbd_remove()