Commit df56a4a6 authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge bk://dtor.bkbits.net/for-2.6.11

into silver.ucw.cz:/home/vojtech/bk/dmitry
parents 98563d04 048e58a4
...@@ -234,6 +234,7 @@ static void atkbd_report_key(struct input_dev *dev, struct pt_regs *regs, int co ...@@ -234,6 +234,7 @@ static void atkbd_report_key(struct input_dev *dev, struct pt_regs *regs, int co
input_regs(dev, regs); input_regs(dev, regs);
if (value == 3) { if (value == 3) {
input_report_key(dev, code, 1); input_report_key(dev, code, 1);
input_sync(dev);
input_report_key(dev, code, 0); input_report_key(dev, code, 0);
} else } else
input_event(dev, EV_KEY, code, value); input_event(dev, EV_KEY, code, value);
...@@ -352,6 +353,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, ...@@ -352,6 +353,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
"to make it known.\n", "to make it known.\n",
code & 0x80 ? "e0" : "", code & 0x7f); code & 0x80 ? "e0" : "", code & 0x7f);
} }
input_sync(&atkbd->dev);
break; break;
case ATKBD_SCR_1: case ATKBD_SCR_1:
scroll = 1 - atkbd->release * 2; scroll = 1 - atkbd->release * 2;
......
...@@ -458,12 +458,11 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -458,12 +458,11 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} }
/* /*
* i8042_enable_mux_mode checks whether the controller has an active * i8042_set_mux_mode checks whether the controller has an active
* multiplexor and puts the chip into Multiplexed (as opposed to * multiplexor and puts the chip into Multiplexed (1) or Legacy (0) mode.
* Legacy) mode.
*/ */
static int i8042_enable_mux_mode(struct i8042_values *values, unsigned char *mux_version) static int i8042_set_mux_mode(unsigned int mode, unsigned char *mux_version)
{ {
unsigned char param; unsigned char param;
...@@ -482,11 +481,11 @@ static int i8042_enable_mux_mode(struct i8042_values *values, unsigned char *mux ...@@ -482,11 +481,11 @@ static int i8042_enable_mux_mode(struct i8042_values *values, unsigned char *mux
param = 0xf0; param = 0xf0;
if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0x0f) if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0x0f)
return -1; return -1;
param = 0x56; param = mode ? 0x56 : 0xf6;
if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0xa9) if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0xa9)
return -1; return -1;
param = 0xa4; param = mode ? 0xa4 : 0xa5;
if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param == 0x5b) if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param == (mode ? 0x5b : 0x5a))
return -1; return -1;
if (mux_version) if (mux_version)
...@@ -540,11 +539,11 @@ static int __init i8042_check_mux(struct i8042_values *values) ...@@ -540,11 +539,11 @@ static int __init i8042_check_mux(struct i8042_values *values)
{ {
unsigned char mux_version; unsigned char mux_version;
if (i8042_enable_mux_mode(values, &mux_version)) if (i8042_set_mux_mode(1, &mux_version))
return -1; return -1;
/* Workaround for broken chips which seem to support MUX, but in reality don't. */ /* Workaround for interference with USB Legacy emulation */
/* They all report version 10.12 */ /* that causes a v10.12 MUX to be found. */
if (mux_version == 0xAC) if (mux_version == 0xAC)
return -1; return -1;
...@@ -774,12 +773,21 @@ static int i8042_controller_init(void) ...@@ -774,12 +773,21 @@ static int i8042_controller_init(void)
*/ */
void i8042_controller_reset(void) void i8042_controller_reset(void)
{ {
if (i8042_reset) { unsigned char param;
unsigned char param;
/*
* Reset the controller if requested.
*/
if (i8042_reset)
if (i8042_command(&param, I8042_CMD_CTL_TEST)) if (i8042_command(&param, I8042_CMD_CTL_TEST))
printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n"); printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n");
}
/*
* Disable MUX mode if present.
*/
i8042_set_mux_mode(0, NULL);
/* /*
* Restore the original control register setting. * Restore the original control register setting.
...@@ -888,7 +896,7 @@ static int i8042_resume(struct device *dev, u32 level) ...@@ -888,7 +896,7 @@ static int i8042_resume(struct device *dev, u32 level)
} }
if (i8042_mux_present) if (i8042_mux_present)
if (i8042_enable_mux_mode(&i8042_aux_values, NULL) || if (i8042_set_mux_mode(1, NULL) ||
i8042_enable_mux_ports(&i8042_aux_values)) { i8042_enable_mux_ports(&i8042_aux_values)) {
printk(KERN_WARNING "i8042: failed to resume active multiplexor, mouse won't work.\n"); printk(KERN_WARNING "i8042: failed to resume active multiplexor, mouse won't work.\n");
} }
......
...@@ -403,11 +403,12 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct ...@@ -403,11 +403,12 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
if (!input) if (!input)
return; return;
input_regs(input, regs);
input_event(input, EV_MSC, MSC_SCAN, usage->hid);
if (!usage->type) if (!usage->type)
return; return;
input_regs(input, regs);
if (((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005)) if (((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005))
|| ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) { || ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) {
if (value) hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON; if (value) hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
...@@ -574,13 +575,16 @@ int hidinput_connect(struct hid_device *hid) ...@@ -574,13 +575,16 @@ int hidinput_connect(struct hid_device *hid)
hidinput->input.id.product = le16_to_cpu(dev->descriptor.idProduct); hidinput->input.id.product = le16_to_cpu(dev->descriptor.idProduct);
hidinput->input.id.version = le16_to_cpu(dev->descriptor.bcdDevice); hidinput->input.id.version = le16_to_cpu(dev->descriptor.bcdDevice);
hidinput->input.dev = &hid->intf->dev; hidinput->input.dev = &hid->intf->dev;
set_bit(EV_MSC, hidinput->input.evbit);
set_bit(MSC_SCAN, hidinput->input.mscbit);
} }
for (i = 0; i < report->maxfield; i++) for (i = 0; i < report->maxfield; i++)
for (j = 0; j < report->field[i]->maxusage; j++) for (j = 0; j < report->field[i]->maxusage; j++)
hidinput_configure_usage(hidinput, report->field[i], hidinput_configure_usage(hidinput, report->field[i],
report->field[i]->usage + j); report->field[i]->usage + j);
if (hid->quirks & HID_QUIRK_MULTI_INPUT) { if (hid->quirks & HID_QUIRK_MULTI_INPUT) {
/* This will leave hidinput NULL, so that it /* This will leave hidinput NULL, so that it
* allocates another one if we have more inputs on * allocates another one if we have more inputs on
......
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