Lines Matching +full:io +full:- +full:multiplex

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (c) 1999-2004 Vojtech Pavlik
26 #include <asm/io.h>
61 enum i8042_controller_reset_mode *arg = kp->arg; in i8042_set_reset()
88 MODULE_PARM_DESC(direct, "Put keyboard port into non-translated mode.");
126 …enable (may reveal sensitive data) of normally sanitize-filtered kbd data traffic debug log [pre-c…
202 ret = -EBUSY; in i8042_install_filter()
223 ret = -EINVAL; in i8042_remove_filter()
249 return -(i == I8042_CTL_TIMEOUT); in i8042_wait_read()
260 return -(i == I8042_CTL_TIMEOUT); in i8042_wait_write()
281 dbg("%02x <- i8042 (flush, %s)\n", in i8042_flush()
284 retval = -EIO; in i8042_flush()
299 * encoded in bits 8-11 of the command number.
307 return -1; in __i8042_command()
313 dbg("%02x -> i8042 (command)\n", command & 0xff); in __i8042_command()
319 dbg(" -- i8042 (wait write timeout)\n"); in __i8042_command()
322 dbg("%02x -> i8042 (parameter)\n", param[i]); in __i8042_command()
329 dbg(" -- i8042 (wait read timeout)\n"); in __i8042_command()
335 dbg(" -- i8042 (auxerr)\n"); in __i8042_command()
336 return -1; in __i8042_command()
340 dbg("%02x <- i8042 (return)\n", param[i]); in __i8042_command()
352 return -1; in i8042_command()
374 dbg("%02x -> i8042 (kbd-data)\n", c); in i8042_kbd_write()
389 struct i8042_port *port = serio->port_data; in i8042_aux_write()
391 return i8042_command(&c, port->mux == -1 ? in i8042_aux_write()
393 I8042_CMD_MUX_SEND + port->mux); in i8042_aux_write()
399 * and then re-enabling it.
443 struct i8042_port *port = serio->port_data; in i8042_start()
445 device_set_wakeup_capable(&serio->dev, true); in i8042_start()
448 * On platforms using suspend-to-idle, allow the keyboard to in i8042_start()
451 * behavior on many platforms using suspend-to-RAM (ACPI S3) in i8042_start()
456 device_set_wakeup_enable(&serio->dev, true); in i8042_start()
460 port->exists = true; in i8042_start()
467 * i8042_stop() marks serio port as non-existing so i8042_interrupt
473 struct i8042_port *port = serio->port_data; in i8042_stop()
476 port->exists = false; in i8042_stop()
477 port->serio = NULL; in i8042_stop()
502 i8042_suppress_kbd_ack--; in i8042_filter()
503 dbg("Extra keyboard ACK - filtered out\n"); in i8042_filter()
517 * i8042_interrupt() is the most important function in this driver -
594 serio = port->exists ? port->serio : NULL; in i8042_interrupt()
596 filter_dbg(port->driver_bound, data, "<- i8042 (interrupt, %d, %d%s%s)\n", in i8042_interrupt()
625 return -EIO; in i8042_enable_kbd_port()
644 return -EIO; in i8042_enable_aux_port()
674 static int i8042_set_mux_mode(bool multiplex, unsigned char *mux_version) in i8042_set_mux_mode() argument
685 * Internal loopback test - send three bytes, they should come back from the in i8042_set_mux_mode()
691 return -1; in i8042_set_mux_mode()
692 param = val = multiplex ? 0x56 : 0xf6; in i8042_set_mux_mode()
694 return -1; in i8042_set_mux_mode()
695 param = val = multiplex ? 0xa4 : 0xa5; in i8042_set_mux_mode()
697 return -1; in i8042_set_mux_mode()
704 return -1; in i8042_set_mux_mode()
723 return -1; in i8042_check_mux()
736 return -EIO; in i8042_check_mux()
760 dbg("%02x <- i8042 (aux_test_irq, %s)\n", in i8042_aux_test_irq()
773 * i8042_toggle_aux - enables or disables AUX port on i8042 via command and
784 return -1; in i8042_toggle_aux()
791 return -1; in i8042_toggle_aux()
797 return -1; in i8042_toggle_aux()
807 int retval = -1; in i8042_check_aux()
820 * Internal loopback test - filters out AT-type i8042's. Unfortunately in i8042_check_aux()
830 * External connection test - filters out AT-soldered PS/2 i8042's in i8042_check_aux()
831 * 0x00 - no error, 0x01-0x03 - clock/data stuck, 0xff - general error in i8042_check_aux()
832 * 0xfa - no error on some notebooks which ignore the spec in i8042_check_aux()
839 return -1; in i8042_check_aux()
850 * Bit assignment test - filters out PS/2 i8042's in AT mode in i8042_check_aux()
859 return -1; in i8042_check_aux()
913 dbg(" -- i8042 (aux irq test timeout)\n"); in i8042_check_aux()
915 retval = -1; in i8042_check_aux()
928 retval = -1; in i8042_check_aux()
940 return -ENODEV; in i8042_controller_check()
959 return -ENODEV; in i8042_controller_selftest()
981 return -EIO; in i8042_controller_selftest()
987 * most importantly, sets it into non-xlated mode if that's
1004 return -EIO; in i8042_controller_init()
1012 return i8042_probe_defer ? -EPROBE_DEFER : -EIO; in i8042_controller_init()
1063 return -EIO; in i8042_controller_init()
1139 dbg("%02x -> i8042 (panic blink)\n", 0xed); in i8042_panic_blink()
1146 dbg("%02x -> i8042 (panic blink)\n", led); in i8042_panic_blink()
1202 return -EIO; in i8042_controller_resume()
1242 if (serio && device_may_wakeup(&serio->dev)) in i8042_pm_suspend()
1265 if (serio && device_may_wakeup(&serio->dev)) in i8042_pm_resume()
1334 return -ENOMEM; in i8042_create_kbd_port()
1336 serio->id.type = i8042_direct ? SERIO_8042 : SERIO_8042_XL; in i8042_create_kbd_port()
1337 serio->write = i8042_dumbkbd ? NULL : i8042_kbd_write; in i8042_create_kbd_port()
1338 serio->start = i8042_start; in i8042_create_kbd_port()
1339 serio->stop = i8042_stop; in i8042_create_kbd_port()
1340 serio->close = i8042_port_close; in i8042_create_kbd_port()
1341 serio->ps2_cmd_mutex = &i8042_mutex; in i8042_create_kbd_port()
1342 serio->port_data = port; in i8042_create_kbd_port()
1343 serio->dev.parent = &i8042_platform_device->dev; in i8042_create_kbd_port()
1344 strscpy(serio->name, "i8042 KBD port", sizeof(serio->name)); in i8042_create_kbd_port()
1345 strscpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys)); in i8042_create_kbd_port()
1346 strscpy(serio->firmware_id, i8042_kbd_firmware_id, in i8042_create_kbd_port()
1347 sizeof(serio->firmware_id)); in i8042_create_kbd_port()
1348 set_primary_fwnode(&serio->dev, i8042_kbd_fwnode); in i8042_create_kbd_port()
1350 port->serio = serio; in i8042_create_kbd_port()
1351 port->irq = I8042_KBD_IRQ; in i8042_create_kbd_port()
1364 return -ENOMEM; in i8042_create_aux_port()
1366 serio->id.type = SERIO_8042; in i8042_create_aux_port()
1367 serio->write = i8042_aux_write; in i8042_create_aux_port()
1368 serio->start = i8042_start; in i8042_create_aux_port()
1369 serio->stop = i8042_stop; in i8042_create_aux_port()
1370 serio->ps2_cmd_mutex = &i8042_mutex; in i8042_create_aux_port()
1371 serio->port_data = port; in i8042_create_aux_port()
1372 serio->dev.parent = &i8042_platform_device->dev; in i8042_create_aux_port()
1374 strscpy(serio->name, "i8042 AUX port", sizeof(serio->name)); in i8042_create_aux_port()
1375 strscpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys)); in i8042_create_aux_port()
1376 strscpy(serio->firmware_id, i8042_aux_firmware_id, in i8042_create_aux_port()
1377 sizeof(serio->firmware_id)); in i8042_create_aux_port()
1378 serio->close = i8042_port_close; in i8042_create_aux_port()
1380 snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); in i8042_create_aux_port()
1381 snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1); in i8042_create_aux_port()
1382 strscpy(serio->firmware_id, i8042_aux_firmware_id, in i8042_create_aux_port()
1383 sizeof(serio->firmware_id)); in i8042_create_aux_port()
1386 port->serio = serio; in i8042_create_aux_port()
1387 port->mux = idx; in i8042_create_aux_port()
1388 port->irq = I8042_AUX_IRQ; in i8042_create_aux_port()
1420 serio->name, in i8042_register_ports()
1457 return -ENODEV; in i8042_setup_aux()
1460 error = i8042_create_aux_port(-1); in i8042_setup_aux()
1524 struct i8042_port *port = serio->port_data; in i8042_kbd_bind_notifier()
1531 port->driver_bound = true; in i8042_kbd_bind_notifier()
1535 port->driver_bound = false; in i8042_kbd_bind_notifier()
1563 if (error && error != -ENODEV && error != -EBUSY) in i8042_probe()
1620 return (err == -ENODEV) ? 0 : err; in i8042_init()
1633 i8042_platform_device = platform_device_alloc("i8042", -1); in i8042_init()
1635 err = -ENOMEM; in i8042_init()