Searched refs:ps2if (Results 1 - 3 of 3) sorted by relevance

/linux-4.4.14/drivers/input/serio/
H A Dsa1111ps2.c46 struct ps2if { struct
64 struct ps2if *ps2if = dev_id; ps2_rxint() local
67 status = sa1111_readl(ps2if->base + PS2STAT); ps2_rxint()
70 sa1111_writel(PS2STAT_STP, ps2if->base + PS2STAT); ps2_rxint()
75 scancode = sa1111_readl(ps2if->base + PS2DATA) & 0xff; ps2_rxint()
80 serio_interrupt(ps2if->io, scancode, flag); ps2_rxint()
82 status = sa1111_readl(ps2if->base + PS2STAT); ps2_rxint()
93 struct ps2if *ps2if = dev_id; ps2_txint() local
96 spin_lock(&ps2if->lock); ps2_txint()
97 status = sa1111_readl(ps2if->base + PS2STAT); ps2_txint()
98 if (ps2if->head == ps2if->tail) { ps2_txint()
102 sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + PS2DATA); ps2_txint()
103 ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1); ps2_txint()
105 spin_unlock(&ps2if->lock); ps2_txint()
116 struct ps2if *ps2if = io->port_data; ps2_write() local
120 spin_lock_irqsave(&ps2if->lock, flags); ps2_write()
125 if (sa1111_readl(ps2if->base + PS2STAT) & PS2STAT_TXE) { ps2_write()
126 sa1111_writel(val, ps2if->base + PS2DATA); ps2_write()
128 if (ps2if->head == ps2if->tail) ps2_write()
129 enable_irq(ps2if->dev->irq[1]); ps2_write()
130 head = (ps2if->head + 1) & (sizeof(ps2if->buf) - 1); ps2_write()
131 if (head != ps2if->tail) { ps2_write()
132 ps2if->buf[ps2if->head] = val; ps2_write()
133 ps2if->head = head; ps2_write()
137 spin_unlock_irqrestore(&ps2if->lock, flags); ps2_write()
143 struct ps2if *ps2if = io->port_data; ps2_open() local
146 ret = sa1111_enable_device(ps2if->dev); ps2_open()
150 ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0, ps2_open()
151 SA1111_DRIVER_NAME(ps2if->dev), ps2if); ps2_open()
154 ps2if->dev->irq[0], ret); ps2_open()
155 sa1111_disable_device(ps2if->dev); ps2_open()
159 ret = request_irq(ps2if->dev->irq[1], ps2_txint, 0, ps2_open()
160 SA1111_DRIVER_NAME(ps2if->dev), ps2if); ps2_open()
163 ps2if->dev->irq[1], ret); ps2_open()
164 free_irq(ps2if->dev->irq[0], ps2if); ps2_open()
165 sa1111_disable_device(ps2if->dev); ps2_open()
169 ps2if->open = 1; ps2_open()
171 enable_irq_wake(ps2if->dev->irq[0]); ps2_open()
173 sa1111_writel(PS2CR_ENA, ps2if->base + PS2CR); ps2_open()
179 struct ps2if *ps2if = io->port_data; ps2_close() local
181 sa1111_writel(0, ps2if->base + PS2CR); ps2_close()
183 disable_irq_wake(ps2if->dev->irq[0]); ps2_close()
185 ps2if->open = 0; ps2_close()
187 free_irq(ps2if->dev->irq[1], ps2if); ps2_close()
188 free_irq(ps2if->dev->irq[0], ps2if); ps2_close()
190 sa1111_disable_device(ps2if->dev); ps2_close()
196 static void ps2_clear_input(struct ps2if *ps2if) ps2_clear_input() argument
201 if ((sa1111_readl(ps2if->base + PS2DATA) & 0xff) == 0xff) ps2_clear_input()
206 static unsigned int ps2_test_one(struct ps2if *ps2if, ps2_test_one() argument
211 sa1111_writel(PS2CR_ENA | mask, ps2if->base + PS2CR); ps2_test_one()
215 val = sa1111_readl(ps2if->base + PS2STAT); ps2_test_one()
223 static int ps2_test(struct ps2if *ps2if) ps2_test() argument
228 stat = ps2_test_one(ps2if, PS2CR_FKC); ps2_test()
234 stat = ps2_test_one(ps2if, 0); ps2_test()
240 stat = ps2_test_one(ps2if, PS2CR_FKD); ps2_test()
246 sa1111_writel(0, ps2if->base + PS2CR); ps2_test()
256 struct ps2if *ps2if; ps2_probe() local
260 ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL); ps2_probe()
262 if (!ps2if || !serio) { ps2_probe()
274 serio->port_data = ps2if; ps2_probe()
276 ps2if->io = serio; ps2_probe()
277 ps2if->dev = dev; ps2_probe()
278 sa1111_set_drvdata(dev, ps2if); ps2_probe()
280 spin_lock_init(&ps2if->lock); ps2_probe()
295 ps2if->base = dev->mapbase; ps2_probe()
297 sa1111_enable_device(ps2if->dev); ps2_probe()
300 sa1111_writel(0, ps2if->base + PS2CLKDIV); ps2_probe()
301 sa1111_writel(127, ps2if->base + PS2PRECNT); ps2_probe()
306 ps2_clear_input(ps2if); ps2_probe()
311 ret = ps2_test(ps2if); ps2_probe()
318 ps2_clear_input(ps2if); ps2_probe()
320 sa1111_disable_device(ps2if->dev); ps2_probe()
321 serio_register_port(ps2if->io); ps2_probe()
325 sa1111_disable_device(ps2if->dev); ps2_probe()
329 kfree(ps2if); ps2_probe()
339 struct ps2if *ps2if = sa1111_get_drvdata(dev); ps2_remove() local
341 serio_unregister_port(ps2if->io); ps2_remove()
345 kfree(ps2if); ps2_remove()
H A Daltera_ps2.c25 struct ps2if { struct
36 struct ps2if *ps2if = dev_id; altera_ps2_rxint() local
40 while ((status = readl(ps2if->base)) & 0xffff0000) { altera_ps2_rxint()
41 serio_interrupt(ps2if->io, status & 0xff, 0); altera_ps2_rxint()
53 struct ps2if *ps2if = io->port_data; altera_ps2_write() local
55 writel(val, ps2if->base); altera_ps2_write()
61 struct ps2if *ps2if = io->port_data; altera_ps2_open() local
64 while (readl(ps2if->base) & 0xffff0000) altera_ps2_open()
67 writel(1, ps2if->base + 4); /* enable rx irq */ altera_ps2_open()
73 struct ps2if *ps2if = io->port_data; altera_ps2_close() local
75 writel(0, ps2if->base + 4); /* disable rx irq */ altera_ps2_close()
83 struct ps2if *ps2if; altera_ps2_probe() local
88 ps2if = devm_kzalloc(&pdev->dev, sizeof(struct ps2if), GFP_KERNEL); altera_ps2_probe()
89 if (!ps2if) altera_ps2_probe()
93 ps2if->base = devm_ioremap_resource(&pdev->dev, res); altera_ps2_probe()
94 if (IS_ERR(ps2if->base)) altera_ps2_probe()
95 return PTR_ERR(ps2if->base); altera_ps2_probe()
102 pdev->name, ps2if); altera_ps2_probe()
118 serio->port_data = ps2if; altera_ps2_probe()
120 ps2if->io = serio; altera_ps2_probe()
122 dev_info(&pdev->dev, "base %p, irq %d\n", ps2if->base, irq); altera_ps2_probe()
124 serio_register_port(ps2if->io); altera_ps2_probe()
125 platform_set_drvdata(pdev, ps2if); altera_ps2_probe()
135 struct ps2if *ps2if = platform_get_drvdata(pdev); altera_ps2_remove() local
137 serio_unregister_port(ps2if->io); altera_ps2_remove()
H A Dpcips2.c48 struct pcips2_data *ps2if = io->port_data; pcips2_write() local
52 stat = inb(ps2if->base + PS2_STATUS); pcips2_write()
56 outb(val, ps2if->base + PS2_DATA); pcips2_write()
63 struct pcips2_data *ps2if = devid; pcips2_interrupt() local
70 status = inb(ps2if->base + PS2_STATUS); pcips2_interrupt()
74 scancode = inb(ps2if->base + PS2_DATA); pcips2_interrupt()
83 serio_interrupt(ps2if->io, scancode, flag); pcips2_interrupt()
88 static void pcips2_flush_input(struct pcips2_data *ps2if) pcips2_flush_input() argument
93 status = inb(ps2if->base + PS2_STATUS); pcips2_flush_input()
96 scancode = inb(ps2if->base + PS2_DATA); pcips2_flush_input()
104 struct pcips2_data *ps2if = io->port_data; pcips2_open() local
107 outb(PS2_CTRL_ENABLE, ps2if->base); pcips2_open()
108 pcips2_flush_input(ps2if); pcips2_open()
110 ret = request_irq(ps2if->dev->irq, pcips2_interrupt, IRQF_SHARED, pcips2_open()
111 "pcips2", ps2if); pcips2_open()
115 outb(val, ps2if->base); pcips2_open()
122 struct pcips2_data *ps2if = io->port_data; pcips2_close() local
124 outb(0, ps2if->base); pcips2_close()
126 free_irq(ps2if->dev->irq, ps2if); pcips2_close()
131 struct pcips2_data *ps2if; pcips2_probe() local
143 ps2if = kzalloc(sizeof(struct pcips2_data), GFP_KERNEL); pcips2_probe()
145 if (!ps2if || !serio) { pcips2_probe()
157 serio->port_data = ps2if; pcips2_probe()
159 ps2if->io = serio; pcips2_probe()
160 ps2if->dev = dev; pcips2_probe()
161 ps2if->base = pci_resource_start(dev, 0); pcips2_probe()
163 pci_set_drvdata(dev, ps2if); pcips2_probe()
165 serio_register_port(ps2if->io); pcips2_probe()
169 kfree(ps2if); pcips2_probe()
180 struct pcips2_data *ps2if = pci_get_drvdata(dev); pcips2_remove() local
182 serio_unregister_port(ps2if->io); pcips2_remove()
183 kfree(ps2if); pcips2_remove()

Completed in 113 milliseconds