Lines Matching full:serio
17 #include <linux/serio.h>
158 struct serio *serio; member
183 struct serio *serio);
198 struct serio *serio)) in i8042_install_filter() argument
211 struct serio *port)) in i8042_remove_filter()
343 static int i8042_kbd_write(struct serio *port, unsigned char c) in i8042_kbd_write()
363 static int i8042_aux_write(struct serio *serio, unsigned char c) in i8042_aux_write() argument
365 struct i8042_port *port = serio->port_data; in i8042_aux_write()
378 static void i8042_port_close(struct serio *serio) in i8042_port_close() argument
384 if (serio == i8042_ports[I8042_AUX_PORT_NO].serio) { in i8042_port_close()
413 * i8042_start() is called by serio core when port is about to finish
417 static int i8042_start(struct serio *serio) in i8042_start() argument
419 struct i8042_port *port = serio->port_data; in i8042_start()
421 device_set_wakeup_capable(&serio->dev, true); in i8042_start()
431 serio == i8042_ports[I8042_KBD_PORT_NO].serio) { in i8042_start()
432 device_set_wakeup_enable(&serio->dev, true); in i8042_start()
442 * i8042_stop() marks serio port as non-existing so i8042_interrupt
444 * The function is called by serio core as part of unregister procedure.
446 static void i8042_stop(struct serio *serio) in i8042_stop() argument
448 struct i8042_port *port = serio->port_data; in i8042_stop()
452 port->serio = NULL; in i8042_stop()
457 * our serio port before we return from this function. in i8042_stop()
472 struct serio *serio) in i8042_filter() argument
483 if (i8042_platform_filter && i8042_platform_filter(data, str, serio)) { in i8042_filter()
504 * rest assume that the data came from the same serio last byte
548 * it reads the data from the i8042, determines its destination serio
556 struct serio *serio; in i8042_handle_data() local
582 serio = port->exists ? port->serio : NULL; in i8042_handle_data()
590 filtered = i8042_filter(data, str, serio); in i8042_handle_data()
593 if (likely(serio && !filtered)) in i8042_handle_data()
594 serio_interrupt(serio, data, dfl); in i8042_handle_data()
1205 } else if (i8042_ports[I8042_AUX_PORT_NO].serio) { in i8042_controller_resume()
1209 if (i8042_ports[I8042_KBD_PORT_NO].serio) in i8042_controller_resume()
1229 /* Set up serio interrupts for system wakeup. */ in i8042_pm_suspend()
1231 struct serio *serio = i8042_ports[i].serio; in i8042_pm_suspend() local
1233 if (serio && device_may_wakeup(&serio->dev)) in i8042_pm_suspend()
1254 struct serio *serio = i8042_ports[i].serio; in i8042_pm_resume() local
1256 if (serio && device_may_wakeup(&serio->dev)) in i8042_pm_resume()
1320 struct serio *serio; in i8042_create_kbd_port() local
1323 serio = kzalloc(sizeof(*serio), GFP_KERNEL); in i8042_create_kbd_port()
1324 if (!serio) in i8042_create_kbd_port()
1327 serio->id.type = i8042_direct ? SERIO_8042 : SERIO_8042_XL; in i8042_create_kbd_port()
1328 serio->write = i8042_dumbkbd ? NULL : i8042_kbd_write; in i8042_create_kbd_port()
1329 serio->start = i8042_start; in i8042_create_kbd_port()
1330 serio->stop = i8042_stop; in i8042_create_kbd_port()
1331 serio->close = i8042_port_close; in i8042_create_kbd_port()
1332 serio->ps2_cmd_mutex = &i8042_mutex; in i8042_create_kbd_port()
1333 serio->port_data = port; in i8042_create_kbd_port()
1334 serio->dev.parent = &i8042_platform_device->dev; in i8042_create_kbd_port()
1335 strscpy(serio->name, "i8042 KBD port", sizeof(serio->name)); in i8042_create_kbd_port()
1336 strscpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys)); in i8042_create_kbd_port()
1337 strscpy(serio->firmware_id, i8042_kbd_firmware_id, in i8042_create_kbd_port()
1338 sizeof(serio->firmware_id)); in i8042_create_kbd_port()
1339 set_primary_fwnode(&serio->dev, i8042_kbd_fwnode); in i8042_create_kbd_port()
1341 port->serio = serio; in i8042_create_kbd_port()
1349 struct serio *serio; in i8042_create_aux_port() local
1353 serio = kzalloc(sizeof(*serio), GFP_KERNEL); in i8042_create_aux_port()
1354 if (!serio) in i8042_create_aux_port()
1357 serio->id.type = SERIO_8042; in i8042_create_aux_port()
1358 serio->write = i8042_aux_write; in i8042_create_aux_port()
1359 serio->start = i8042_start; in i8042_create_aux_port()
1360 serio->stop = i8042_stop; in i8042_create_aux_port()
1361 serio->ps2_cmd_mutex = &i8042_mutex; in i8042_create_aux_port()
1362 serio->port_data = port; in i8042_create_aux_port()
1363 serio->dev.parent = &i8042_platform_device->dev; in i8042_create_aux_port()
1365 strscpy(serio->name, "i8042 AUX port", sizeof(serio->name)); in i8042_create_aux_port()
1366 strscpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys)); in i8042_create_aux_port()
1367 strscpy(serio->firmware_id, i8042_aux_firmware_id, in i8042_create_aux_port()
1368 sizeof(serio->firmware_id)); in i8042_create_aux_port()
1369 serio->close = i8042_port_close; in i8042_create_aux_port()
1371 snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); in i8042_create_aux_port()
1372 snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1); in i8042_create_aux_port()
1373 strscpy(serio->firmware_id, i8042_aux_firmware_id, in i8042_create_aux_port()
1374 sizeof(serio->firmware_id)); in i8042_create_aux_port()
1377 port->serio = serio; in i8042_create_aux_port()
1386 kfree(i8042_ports[I8042_KBD_PORT_NO].serio); in i8042_free_kbd_port()
1387 i8042_ports[I8042_KBD_PORT_NO].serio = NULL; in i8042_free_kbd_port()
1395 kfree(i8042_ports[i].serio); in i8042_free_aux_ports()
1396 i8042_ports[i].serio = NULL; in i8042_free_aux_ports()
1405 struct serio *serio = i8042_ports[i].serio; in i8042_register_ports() local
1407 if (!serio) in i8042_register_ports()
1410 printk(KERN_INFO "serio: %s at %#lx,%#lx irq %d\n", in i8042_register_ports()
1411 serio->name, in i8042_register_ports()
1415 serio_register_port(serio); in i8042_register_ports()
1424 if (i8042_ports[i].serio) { in i8042_unregister_ports()
1425 serio_unregister_port(i8042_ports[i].serio); in i8042_unregister_ports()
1426 i8042_ports[i].serio = NULL; in i8042_unregister_ports()
1514 struct serio *serio = to_serio_port(dev); in i8042_kbd_bind_notifier() local
1515 struct i8042_port *port = serio->port_data; in i8042_kbd_bind_notifier()
1517 if (serio != i8042_ports[I8042_KBD_PORT_NO].serio) in i8042_kbd_bind_notifier()
1564 * Ok, everything is ready, let's register all serio ports in i8042_probe()