Lines Matching full:kmi
18 #include <linux/amba/kmi.h>
24 #define KMI_BASE (kmi->base)
37 struct amba_kmi_port *kmi = dev_id; in amba_kmi_int() local
42 serio_interrupt(kmi->io, readb(KMIDATA), 0); in amba_kmi_int()
52 struct amba_kmi_port *kmi = io->port_data; in amba_kmi_write() local
66 struct amba_kmi_port *kmi = io->port_data; in amba_kmi_open() local
70 ret = clk_prepare_enable(kmi->clk); in amba_kmi_open()
74 divisor = clk_get_rate(kmi->clk) / 8000000 - 1; in amba_kmi_open()
78 ret = request_irq(kmi->irq, amba_kmi_int, IRQF_SHARED, "kmi-pl050", in amba_kmi_open()
79 kmi); in amba_kmi_open()
81 printk(KERN_ERR "kmi: failed to claim IRQ%d\n", kmi->irq); in amba_kmi_open()
91 clk_disable_unprepare(kmi->clk); in amba_kmi_open()
98 struct amba_kmi_port *kmi = io->port_data; in amba_kmi_close() local
102 free_irq(kmi->irq, kmi); in amba_kmi_close()
103 clk_disable_unprepare(kmi->clk); in amba_kmi_close()
109 struct amba_kmi_port *kmi; in amba_kmi_probe() local
117 kmi = kzalloc(sizeof(*kmi), GFP_KERNEL); in amba_kmi_probe()
119 if (!kmi || !io) { in amba_kmi_probe()
131 io->port_data = kmi; in amba_kmi_probe()
134 kmi->io = io; in amba_kmi_probe()
135 kmi->base = ioremap(dev->res.start, resource_size(&dev->res)); in amba_kmi_probe()
136 if (!kmi->base) { in amba_kmi_probe()
141 kmi->clk = clk_get(&dev->dev, "KMIREFCLK"); in amba_kmi_probe()
142 if (IS_ERR(kmi->clk)) { in amba_kmi_probe()
143 ret = PTR_ERR(kmi->clk); in amba_kmi_probe()
147 kmi->irq = dev->irq[0]; in amba_kmi_probe()
148 amba_set_drvdata(dev, kmi); in amba_kmi_probe()
150 serio_register_port(kmi->io); in amba_kmi_probe()
154 iounmap(kmi->base); in amba_kmi_probe()
156 kfree(kmi); in amba_kmi_probe()
164 struct amba_kmi_port *kmi = amba_get_drvdata(dev); in amba_kmi_remove() local
166 serio_unregister_port(kmi->io); in amba_kmi_remove()
167 clk_put(kmi->clk); in amba_kmi_remove()
168 iounmap(kmi->base); in amba_kmi_remove()
169 kfree(kmi); in amba_kmi_remove()
175 struct amba_kmi_port *kmi = dev_get_drvdata(dev); in amba_kmi_resume() local
178 serio_reconnect(kmi->io); in amba_kmi_resume()
197 .name = "kmi-pl050",
208 MODULE_DESCRIPTION("AMBA KMI controller driver");