12 #include <linux/module.h>
14 #include <linux/serio.h>
15 #include <linux/errno.h>
18 #include <linux/device.h>
20 #include <linux/slab.h>
29 #define KMI_BASE (kmi->base)
55 static int amba_kmi_write(
struct serio *
io,
unsigned char val)
58 unsigned int timeleft = 10000;
69 static int amba_kmi_open(
struct serio *io)
75 ret = clk_prepare_enable(kmi->
clk);
95 clk_disable_unprepare(kmi->
clk);
100 static void amba_kmi_close(
struct serio *io)
107 clk_disable_unprepare(kmi->
clk);
130 io->
write = amba_kmi_write;
131 io->
open = amba_kmi_open;
132 io->
close = amba_kmi_close;
136 io->
dev.parent = &dev->
dev;
146 if (IS_ERR(kmi->
clk)) {
147 ret = PTR_ERR(kmi->
clk);
180 static int amba_kmi_resume(
struct amba_device *dev)
190 static struct amba_id amba_kmi_idtable[] = {
205 .id_table = amba_kmi_idtable,
206 .probe = amba_kmi_probe,
208 .resume = amba_kmi_resume,