i8042.c (5a84d159061d914c8dd4aa372ac6e9529c2be453) i8042.c (3ca5de6dd4ec5a139b2b8f00dce3e4726ca91af1)
1/*
2 * i8042 keyboard and mouse controller driver for Linux
3 *
4 * Copyright (c) 1999-2004 Vojtech Pavlik
5 */
6
7/*
8 * This program is free software; you can redistribute it and/or modify it

--- 539 unchanged lines hidden (view full) ---

548
549/*
550 * Internal loopback test - filters out AT-type i8042's. Unfortunately
551 * SiS screwed up and their 5597 doesn't support the LOOP command even
552 * though it has an AUX port.
553 */
554
555 param = 0x5a;
1/*
2 * i8042 keyboard and mouse controller driver for Linux
3 *
4 * Copyright (c) 1999-2004 Vojtech Pavlik
5 */
6
7/*
8 * This program is free software; you can redistribute it and/or modify it

--- 539 unchanged lines hidden (view full) ---

548
549/*
550 * Internal loopback test - filters out AT-type i8042's. Unfortunately
551 * SiS screwed up and their 5597 doesn't support the LOOP command even
552 * though it has an AUX port.
553 */
554
555 param = 0x5a;
556 if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0x5a) {
556 retval = i8042_command(&param, I8042_CMD_AUX_LOOP);
557 if (retval || param != 0x5a) {
557
558/*
559 * External connection test - filters out AT-soldered PS/2 i8042's
560 * 0x00 - no error, 0x01-0x03 - clock/data stuck, 0xff - general error
561 * 0xfa - no error on some notebooks which ignore the spec
562 * Because it's common for chipsets to return error on perfectly functioning
563 * AUX ports, we test for this only when the LOOP command failed.
564 */
565
566 if (i8042_command(&param, I8042_CMD_AUX_TEST) ||
567 (param && param != 0xfa && param != 0xff))
568 return -1;
569
558
559/*
560 * External connection test - filters out AT-soldered PS/2 i8042's
561 * 0x00 - no error, 0x01-0x03 - clock/data stuck, 0xff - general error
562 * 0xfa - no error on some notebooks which ignore the spec
563 * Because it's common for chipsets to return error on perfectly functioning
564 * AUX ports, we test for this only when the LOOP command failed.
565 */
566
567 if (i8042_command(&param, I8042_CMD_AUX_TEST) ||
568 (param && param != 0xfa && param != 0xff))
569 return -1;
570
570 aux_loop_broken = 1;
571/*
572 * If AUX_LOOP completed without error but returned unexpected data
573 * mark it as broken
574 */
575 if (!retval)
576 aux_loop_broken = 1;
571 }
572
573/*
574 * Bit assignment test - filters out PS/2 i8042's in AT mode
575 */
576
577 if (i8042_command(&param, I8042_CMD_AUX_DISABLE))
578 return -1;

--- 631 unchanged lines hidden ---
577 }
578
579/*
580 * Bit assignment test - filters out PS/2 i8042's in AT mode
581 */
582
583 if (i8042_command(&param, I8042_CMD_AUX_DISABLE))
584 return -1;

--- 631 unchanged lines hidden ---