Commit 6967ded8 authored by Vojtech Pavlik's avatar Vojtech Pavlik Committed by Vojtech Pavlik

input: Bail out in atkbd.c if scancode set is changed, don't

       reinitialize scancode map. This is even more anoying than
       a new keyboard device in the unlikely case of set change.
parent c5b529b3
...@@ -741,7 +741,6 @@ static int atkbd_reconnect(struct serio *serio) ...@@ -741,7 +741,6 @@ static int atkbd_reconnect(struct serio *serio)
{ {
struct atkbd *atkbd = serio->private; struct atkbd *atkbd = serio->private;
struct serio_dev *dev = serio->dev; struct serio_dev *dev = serio->dev;
int i;
if (!dev) { if (!dev) {
printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n"); printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
...@@ -751,36 +750,11 @@ static int atkbd_reconnect(struct serio *serio) ...@@ -751,36 +750,11 @@ static int atkbd_reconnect(struct serio *serio)
if (atkbd->write) { if (atkbd->write) {
if (atkbd_probe(atkbd)) if (atkbd_probe(atkbd))
return -1; return -1;
if (atkbd->set != atkbd_set_3(atkbd))
atkbd->set = atkbd_set_3(atkbd); return -1;
atkbd_enable(atkbd); atkbd_enable(atkbd);
} else {
atkbd->set = 2;
atkbd->id = 0xab00;
}
/*
* Here we probably should check if the keyboard has the same set that
* it had before and bail out if it's different. But this will most likely
* cause new keyboard device be created... and for the user it will look
* like keyboard is lost
*/
if (atkbd->translated) {
for (i = 0; i < 128; i++) {
atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]];
atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];
}
} else if (atkbd->set == 2) {
memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
} else {
memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
} }
for (i = 0; i < 512; i++)
if (atkbd->keycode[i] && atkbd->keycode[i] < 255)
set_bit(atkbd->keycode[i], atkbd->dev.keybit);
return 0; return 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