Commit f355ae1c authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-input.bkbits.net/linux-input

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 77ade2a9 fd17b576
......@@ -44,7 +44,7 @@ static unsigned char atkbd_set2_keycode[512] = {
0, 49, 48, 35, 34, 21, 7, 0, 0, 0, 50, 36, 22, 8, 9, 0,
0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0,
122, 89, 40,120, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 0,
85, 86, 90, 91, 92, 93, 14, 94, 95, 79, 43, 75, 71,121, 0,123,
85, 86, 90, 91, 92, 93, 14, 94, 95, 79,183, 75, 71,121, 0,123,
82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99,
252, 0, 0, 65, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
......@@ -280,6 +280,7 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co
param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
| (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0)
| (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0)
| (test_bit(LED_MISC, dev->led) ? 0x10 : 0)
| (test_bit(LED_MUTE, dev->led) ? 0x20 : 0);
atkbd_command(atkbd, param, ATKBD_CMD_EX_SETLEDS);
}
......@@ -309,8 +310,8 @@ static int atkbd_set_3(struct atkbd *atkbd)
/*
* For known special keyboards we can go ahead and set the correct set.
* We check for NCD PS/2 Sun, NorthGate OmniKey 101 and IBM RapidAccess
* keyboards.
* We check for NCD PS/2 Sun, NorthGate OmniKey 101 and
* IBM RapidAccess / IBM EzButton / Chicony KBP-8993 keyboards.
*/
if (atkbd->id == 0xaca1) {
......@@ -319,14 +320,17 @@ static int atkbd_set_3(struct atkbd *atkbd)
return 3;
}
if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
atkbd->id = param[0] << 8 | param[1];
return 2;
}
if (atkbd_set != 2)
if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
atkbd->id = param[0] << 8 | param[1];
return 2;
}
param[0] = 0x71;
if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE))
return 4;
if (atkbd_set == 4) {
param[0] = 0x71;
if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE))
return 4;
}
/*
* Try to set the set we want.
......@@ -505,7 +509,7 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
}
if (atkbd->set == 4) {
atkbd->dev.ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) | BIT(LED_SLEEP) | BIT(LED_MUTE);
atkbd->dev.ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) | BIT(LED_SLEEP) | BIT(LED_MUTE) | BIT(LED_MISC);
sprintf(atkbd->name, "AT Set 2 Extended keyboard");
} else
sprintf(atkbd->name, "AT Set %d keyboard", atkbd->set);
......
......@@ -218,43 +218,25 @@ static int uinput_write(struct file *file, const char *buffer, size_t count, lof
static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
{
struct uinput_device *udev;
struct uinput_device *udev = file->private_data;
int retval = 0;
DECLARE_WAITQUEUE(waitq, current);
udev = (struct uinput_device *)file->private_data;
if (udev->head == udev->tail && (udev->state & UIST_CREATED) && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
if (udev->head == udev->tail) {
add_wait_queue(&udev->waitq, &waitq);
current->state = TASK_INTERRUPTIBLE;
while (udev->head == udev->tail) {
if (!(udev->state & UIST_CREATED)) {
retval = -ENODEV;
break;
}
if (file->f_flags & O_NONBLOCK) {
retval = -EAGAIN;
break;
}
if (signal_pending(current)) {
retval = -ERESTARTSYS;
break;
}
schedule();
}
current->state = TASK_RUNNING;
remove_wait_queue(&udev->waitq, &waitq);
}
retval = wait_event_interruptible(udev->waitq,
udev->head != udev->tail && (udev->state & UIST_CREATED));
if (retval)
return retval;
if (!(udev->state & UIST_CREATED))
return -ENODEV;
while (udev->head != udev->tail && retval + sizeof(struct uinput_device) <= count) {
if (copy_to_user(buffer + retval, &(udev->buff[udev->tail]),
sizeof(struct input_event)))
return -EFAULT;
udev->tail = (udev->tail + 1)%(UINPUT_BUFFER_SIZE - 1);
sizeof(struct input_event))) return -EFAULT;
udev->tail = (udev->tail + 1) % (UINPUT_BUFFER_SIZE - 1);
retval += sizeof(struct input_event);
}
......
......@@ -21,10 +21,6 @@
#include <linux/serio.h>
#include <linux/sched.h>
#undef DEBUG
#include "i8042.h"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("i8042 keyboard and mouse controller driver");
MODULE_LICENSE("GPL");
......@@ -41,6 +37,9 @@ static int i8042_reset;
static int i8042_direct;
static int i8042_dumbkbd;
#undef DEBUG
#include "i8042.h"
spinlock_t i8042_lock = SPIN_LOCK_UNLOCKED;
struct i8042_values {
......@@ -161,7 +160,7 @@ static int i8042_command(unsigned char *param, int command)
param[i] = ~i8042_read_data();
else
param[i] = i8042_read_data();
dbg("%02x <- i8042 (return)\n", param[i]);
dbg("%02x <- i8042 (return)", param[i]);
}
spin_unlock_irqrestore(&i8042_lock, flags);
......@@ -287,7 +286,6 @@ static void i8042_close(struct serio *port)
*/
static struct i8042_values i8042_kbd_values = {
.irq = I8042_KBD_IRQ,
.irqen = I8042_CTR_KBDINT,
.disable = I8042_CTR_KBDDIS,
.name = "KBD",
......@@ -306,7 +304,6 @@ static struct serio i8042_kbd_port =
};
static struct i8042_values i8042_aux_values = {
.irq = I8042_AUX_IRQ,
.irqen = I8042_CTR_AUXINT,
.disable = I8042_CTR_AUXDIS,
.name = "AUX",
......@@ -655,24 +652,26 @@ static int __init i8042_check_aux(struct i8042_values *values)
i8042_flush();
/*
* Internal loopback test - filters out AT-type i8042's
* Internal loopback test - filters out AT-type i8042's. Unfortunately
* SiS screwed up and their 5597 doesn't support the LOOP command even
* though it has an AUX port.
*/
param = 0x5a;
if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0xa5)
return -1;
if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0xa5) {
/*
* External connection test - filters out AT-soldered PS/2 i8042's
* 0x00 - no error, 0x01-0x03 - clock/data stuck, 0xff - general error
* 0xfa - no error on some notebooks which ignore the spec
* We ignore general error, since some chips report it even under normal
* operation.
* Because it's common for chipsets to return error on perfectly functioning
* AUX ports, we test for this only when the LOOP command failed.
*/
if (i8042_command(&param, I8042_CMD_AUX_TEST)
|| (param && param != 0xfa && param != 0xff))
return -1;
if (i8042_command(&param, I8042_CMD_AUX_TEST)
|| (param && param != 0xfa && param != 0xff))
return -1;
}
/*
* Bit assignment test - filters out PS/2 i8042's in AT mode
......@@ -810,6 +809,9 @@ int __init i8042_init(void)
if (i8042_platform_init())
return -EBUSY;
i8042_aux_values.irq = I8042_AUX_IRQ;
i8042_kbd_values.irq = I8042_KBD_IRQ;
if (i8042_controller_init())
return -ENODEV;
......
......@@ -104,7 +104,7 @@
#ifdef DEBUG
static unsigned long i8042_start;
#define dbg_init() do { i8042_start = jiffies; } while (0);
#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "[%d]\n" ,\
#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format " [%d]\n" ,\
## arg, (int) (jiffies - i8042_start))
#else
#define dbg_init() do { } while (0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment