• Home
  • Raw
  • Download

Lines Matching refs:kbd

68 	struct spear_kbd *kbd = dev_id;  in spear_kbd_interrupt()  local
69 struct input_dev *input = kbd->input; in spear_kbd_interrupt()
73 sts = readb(kbd->io_base + STATUS_REG); in spear_kbd_interrupt()
77 if (kbd->last_key != KEY_RESERVED) { in spear_kbd_interrupt()
78 input_report_key(input, kbd->last_key, 0); in spear_kbd_interrupt()
79 kbd->last_key = KEY_RESERVED; in spear_kbd_interrupt()
83 val = readb(kbd->io_base + DATA_REG); in spear_kbd_interrupt()
84 key = kbd->keycodes[val]; in spear_kbd_interrupt()
90 kbd->last_key = key; in spear_kbd_interrupt()
93 writeb(0, kbd->io_base + STATUS_REG); in spear_kbd_interrupt()
100 struct spear_kbd *kbd = input_get_drvdata(dev); in spear_kbd_open() local
104 kbd->last_key = KEY_RESERVED; in spear_kbd_open()
106 error = clk_enable(kbd->clk); in spear_kbd_open()
112 (kbd->mode << KEY_MATRIX_SHIFT); in spear_kbd_open()
113 writew(val, kbd->io_base + MODE_REG); in spear_kbd_open()
114 writeb(1, kbd->io_base + STATUS_REG); in spear_kbd_open()
117 val = readw(kbd->io_base + MODE_REG); in spear_kbd_open()
119 writew(val, kbd->io_base + MODE_REG); in spear_kbd_open()
126 struct spear_kbd *kbd = input_get_drvdata(dev); in spear_kbd_close() local
130 val = readw(kbd->io_base + MODE_REG); in spear_kbd_close()
132 writew(val, kbd->io_base + MODE_REG); in spear_kbd_close()
134 clk_disable(kbd->clk); in spear_kbd_close()
136 kbd->last_key = KEY_RESERVED; in spear_kbd_close()
143 struct spear_kbd *kbd; in spear_kbd_probe() local
172 kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); in spear_kbd_probe()
174 if (!kbd || !input_dev) { in spear_kbd_probe()
180 kbd->input = input_dev; in spear_kbd_probe()
181 kbd->irq = irq; in spear_kbd_probe()
182 kbd->mode = pdata->mode; in spear_kbd_probe()
184 kbd->res = request_mem_region(res->start, resource_size(res), in spear_kbd_probe()
186 if (!kbd->res) { in spear_kbd_probe()
192 kbd->io_base = ioremap(res->start, resource_size(res)); in spear_kbd_probe()
193 if (!kbd->io_base) { in spear_kbd_probe()
199 kbd->clk = clk_get(&pdev->dev, NULL); in spear_kbd_probe()
200 if (IS_ERR(kbd->clk)) { in spear_kbd_probe()
201 error = PTR_ERR(kbd->clk); in spear_kbd_probe()
220 input_dev->keycode = kbd->keycodes; in spear_kbd_probe()
221 input_dev->keycodesize = sizeof(kbd->keycodes[0]); in spear_kbd_probe()
222 input_dev->keycodemax = ARRAY_SIZE(kbd->keycodes); in spear_kbd_probe()
227 input_set_drvdata(input_dev, kbd); in spear_kbd_probe()
229 error = request_irq(irq, spear_kbd_interrupt, 0, "keyboard", kbd); in spear_kbd_probe()
242 platform_set_drvdata(pdev, kbd); in spear_kbd_probe()
247 free_irq(kbd->irq, kbd); in spear_kbd_probe()
249 clk_put(kbd->clk); in spear_kbd_probe()
251 iounmap(kbd->io_base); in spear_kbd_probe()
256 kfree(kbd); in spear_kbd_probe()
263 struct spear_kbd *kbd = platform_get_drvdata(pdev); in spear_kbd_remove() local
265 free_irq(kbd->irq, kbd); in spear_kbd_remove()
266 input_unregister_device(kbd->input); in spear_kbd_remove()
267 clk_put(kbd->clk); in spear_kbd_remove()
268 iounmap(kbd->io_base); in spear_kbd_remove()
269 release_mem_region(kbd->res->start, resource_size(kbd->res)); in spear_kbd_remove()
270 kfree(kbd); in spear_kbd_remove()
282 struct spear_kbd *kbd = platform_get_drvdata(pdev); in spear_kbd_suspend() local
283 struct input_dev *input_dev = kbd->input; in spear_kbd_suspend()
288 clk_enable(kbd->clk); in spear_kbd_suspend()
291 enable_irq_wake(kbd->irq); in spear_kbd_suspend()
301 struct spear_kbd *kbd = platform_get_drvdata(pdev); in spear_kbd_resume() local
302 struct input_dev *input_dev = kbd->input; in spear_kbd_resume()
307 disable_irq_wake(kbd->irq); in spear_kbd_resume()
310 clk_enable(kbd->clk); in spear_kbd_resume()