Re: [PATCH] Disable i8042 checks on Intel Apple Macs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Torokhov
Date: Monday, January 25, 2010 - 4:28 pm

On Mon, Jan 25, 2010 at 03:05:31PM -0800, H. Peter Anvin wrote:

/*
 * i8042_flush() flushes all data that may be in the keyboard and mouse
 * buffers
 * of the i8042 down the toilet.
 */

static int i8042_flush(void)
{
        unsigned long flags;
        unsigned char data, str;
        int i = 0;

        spin_lock_irqsave(&i8042_lock, flags);

        while (((str = i8042_read_status()) & I8042_STR_OBF) && (i < I8042_BUFFER_SIZE)) {
                udelay(50);
                data = i8042_read_data();
                i++;
                dbg("%02x <- i8042 (flush, %s)", data,
                        str & I8042_STR_AUXDATA ? "aux" : "kbd");
        }

        spin_unlock_irqrestore(&i8042_lock, flags);

        return i;
}

...

static int i8042_controller_check(void)
{
        if (i8042_flush() == I8042_BUFFER_SIZE) {
                printk(KERN_ERR "i8042.c: No controller found.\n");
                return -ENODEV;
        }

        return 0;
}

-- 
Dmitry
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Wed Jan 20, 11:23 am)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Justin P. Mattock, (Wed Jan 20, 12:14 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Wed Jan 20, 12:37 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Justin P. Mattock, (Wed Jan 20, 12:54 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Robert Hancock, (Wed Jan 20, 5:41 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Wed Jan 20, 6:31 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Robert Hancock, (Wed Jan 20, 7:19 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Dmitry Torokhov, (Thu Jan 21, 11:55 am)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Robert Hancock, (Thu Jan 21, 2:39 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Thu Jan 21, 2:42 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Justin P. Mattock, (Thu Jan 21, 2:49 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Dmitry Torokhov, (Thu Jan 21, 3:17 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Robert Hancock, (Thu Jan 21, 5:26 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Robert Hancock, (Thu Jan 21, 5:29 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Justin P. Mattock, (Thu Jan 21, 6:20 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Thu Jan 21, 7:09 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Robert Hancock, (Thu Jan 21, 7:30 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Justin P. Mattock, (Thu Jan 21, 7:31 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Thu Jan 21, 7:53 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, H. Peter Anvin, (Fri Jan 22, 10:46 am)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Fri Jan 22, 11:15 am)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Robert Hancock, (Fri Jan 22, 3:33 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, H. Peter Anvin, (Fri Jan 22, 3:49 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Vojtech Pavlik, (Mon Jan 25, 9:34 am)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, H. Peter Anvin, (Mon Jan 25, 2:32 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Dmitry Torokhov, (Mon Jan 25, 3:15 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, H. Peter Anvin, (Mon Jan 25, 3:18 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Dmitry Torokhov, (Mon Jan 25, 3:30 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, H. Peter Anvin, (Mon Jan 25, 4:05 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Dmitry Torokhov, (Mon Jan 25, 4:28 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, H. Peter Anvin, (Mon Jan 25, 4:31 pm)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Tue May 4, 10:06 am)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Dmitry Torokhov, (Tue May 4, 10:23 am)
Re: [PATCH] Disable i8042 checks on Intel Apple Macs, Bastien Nocera, (Tue May 4, 10:37 am)