Lines Matching full:psm
64 static void ps2mult_select_port(struct ps2mult *psm, struct ps2mult_port *port) in ps2mult_select_port() argument
66 struct serio *mx_serio = psm->mx_serio; in ps2mult_select_port()
69 psm->out_port = port; in ps2mult_select_port()
76 struct ps2mult *psm = serio_get_drvdata(mx_port); in ps2mult_serio_write() local
80 guard(spinlock_irqsave)(&psm->lock); in ps2mult_serio_write()
82 if (psm->out_port != port) in ps2mult_serio_write()
83 ps2mult_select_port(psm, port); in ps2mult_serio_write()
100 struct ps2mult *psm = serio_get_drvdata(serio->parent); in ps2mult_serio_start() local
103 guard(spinlock_irqsave)(&psm->lock); in ps2mult_serio_start()
112 struct ps2mult *psm = serio_get_drvdata(serio->parent); in ps2mult_serio_stop() local
115 guard(spinlock_irqsave)(&psm->lock); in ps2mult_serio_stop()
120 static int ps2mult_create_port(struct ps2mult *psm, int i) in ps2mult_create_port() argument
122 struct serio *mx_serio = psm->mx_serio; in ps2mult_create_port()
136 serio->parent = psm->mx_serio; in ps2mult_create_port()
137 serio->port_data = &psm->ports[i]; in ps2mult_create_port()
139 psm->ports[i].serio = serio; in ps2mult_create_port()
144 static void ps2mult_reset(struct ps2mult *psm) in ps2mult_reset() argument
146 guard(spinlock_irqsave)(&psm->lock); in ps2mult_reset()
148 serio_write(psm->mx_serio, PS2MULT_SESSION_END); in ps2mult_reset()
149 serio_write(psm->mx_serio, PS2MULT_SESSION_START); in ps2mult_reset()
151 ps2mult_select_port(psm, &psm->ports[PS2MULT_KBD_PORT]); in ps2mult_reset()
156 struct ps2mult *psm; in ps2mult_connect() local
163 psm = kzalloc(sizeof(*psm), GFP_KERNEL); in ps2mult_connect()
164 if (!psm) in ps2mult_connect()
167 spin_lock_init(&psm->lock); in ps2mult_connect()
168 psm->mx_serio = serio; in ps2mult_connect()
171 psm->ports[i].sel = ps2mult_controls[i]; in ps2mult_connect()
172 error = ps2mult_create_port(psm, i); in ps2mult_connect()
177 psm->in_port = psm->out_port = &psm->ports[PS2MULT_KBD_PORT]; in ps2mult_connect()
179 serio_set_drvdata(serio, psm); in ps2mult_connect()
184 ps2mult_reset(psm); in ps2mult_connect()
187 struct serio *s = psm->ports[i].serio; in ps2mult_connect()
197 kfree(psm->ports[i].serio); in ps2mult_connect()
198 kfree(psm); in ps2mult_connect()
204 struct ps2mult *psm = serio_get_drvdata(serio); in ps2mult_disconnect() local
209 kfree(psm); in ps2mult_disconnect()
216 struct ps2mult *psm = serio_get_drvdata(serio); in ps2mult_reconnect() local
218 ps2mult_reset(psm); in ps2mult_reconnect()
226 struct ps2mult *psm = serio_get_drvdata(serio); in ps2mult_interrupt() local
231 guard(spinlock_irqsave)(&psm->lock); in ps2mult_interrupt()
233 if (psm->escape) { in ps2mult_interrupt()
234 psm->escape = false; in ps2mult_interrupt()
235 in_port = psm->in_port; in ps2mult_interrupt()
244 psm->escape = true; in ps2mult_interrupt()
249 psm->in_port = psm->out_port; in ps2mult_interrupt()
262 psm->in_port = &psm->ports[PS2MULT_KBD_PORT]; in ps2mult_interrupt()
267 psm->in_port = &psm->ports[PS2MULT_MOUSE_PORT]; in ps2mult_interrupt()
271 in_port = psm->in_port; in ps2mult_interrupt()