Lines Matching +full:rx +full:- +full:delay +full:- +full:ps

1 // SPDX-License-Identifier: GPL-2.0-only
13 #include <linux/delay.h>
24 MODULE_AUTHOR("Vivien Chappelier <vivien.chappelier@linux-mips.org");
57 struct mace_ps2port *port = ((struct maceps2_data *)dev->port_data)->port; in maceps2_write()
61 if (port->status & PS2_STATUS_TX_EMPTY) { in maceps2_write()
62 port->tx = val; in maceps2_write()
66 } while (timeout--); in maceps2_write()
68 return -1; in maceps2_write()
74 struct mace_ps2port *port = ((struct maceps2_data *)dev->port_data)->port; in maceps2_interrupt()
77 if (port->status & PS2_STATUS_RX_FULL) { in maceps2_interrupt()
78 byte = port->rx; in maceps2_interrupt()
87 struct maceps2_data *data = (struct maceps2_data *)dev->port_data; in maceps2_open()
89 if (request_irq(data->irq, maceps2_interrupt, 0, "PS2 port", dev)) { in maceps2_open()
90 printk(KERN_ERR "Could not allocate PS/2 IRQ\n"); in maceps2_open()
91 return -EBUSY; in maceps2_open()
95 data->port->control = PS2_CONTROL_TX_CLOCK_DISABLE | PS2_CONTROL_RESET; in maceps2_open()
99 data->port->control = PS2_CONTROL_RX_CLOCK_ENABLE | in maceps2_open()
108 struct maceps2_data *data = (struct maceps2_data *)dev->port_data; in maceps2_close()
110 data->port->control = PS2_CONTROL_TX_CLOCK_DISABLE | PS2_CONTROL_RESET; in maceps2_close()
112 free_irq(data->irq, dev); in maceps2_close()
122 serio->id.type = SERIO_8042; in maceps2_allocate_port()
123 serio->write = maceps2_write; in maceps2_allocate_port()
124 serio->open = maceps2_open; in maceps2_allocate_port()
125 serio->close = maceps2_close; in maceps2_allocate_port()
126 snprintf(serio->name, sizeof(serio->name), "MACE PS/2 port%d", idx); in maceps2_allocate_port()
127 snprintf(serio->phys, sizeof(serio->phys), "mace/serio%d", idx); in maceps2_allocate_port()
128 serio->port_data = &port_data[idx]; in maceps2_allocate_port()
129 serio->dev.parent = &maceps2_device->dev; in maceps2_allocate_port()
142 return -ENOMEM; in maceps2_probe()
175 maceps2_device = platform_device_alloc("maceps2", -1); in maceps2_init()
177 error = -ENOMEM; in maceps2_init()
181 port_data[0].port = &mace->perif.ps2.keyb; in maceps2_init()
183 port_data[1].port = &mace->perif.ps2.mouse; in maceps2_init()