diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/alps.c | 7 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 11 | ||||
-rwxr-xr-x | drivers/input/touchscreen/max11801_ts.c | 8 |
3 files changed, 21 insertions, 5 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 99d58764ef03..0b9944346ec3 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -426,7 +426,9 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int /* * First try "E6 report". - * ALPS should return 0,0,10 or 0,0,100 + * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed. + * The bits 0-2 of the first byte will be 1s if some buttons are + * pressed. */ param[0] = 0; if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || @@ -441,7 +443,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int dbg("E6 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); - if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100)) + if ((param[0] & 0xf8) != 0 || param[1] != 0 || + (param[2] != 10 && param[2] != 100)) return NULL; /* diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index e06e045bf907..6ad728f0e287 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -24,6 +24,7 @@ */ #include <linux/module.h> +#include <linux/delay.h> #include <linux/dmi.h> #include <linux/input/mt.h> #include <linux/serio.h> @@ -760,6 +761,16 @@ static int synaptics_reconnect(struct psmouse *psmouse) do { psmouse_reset(psmouse); + if (retry) { + /* + * On some boxes, right after resuming, the touchpad + * needs some time to finish initializing (I assume + * it needs time to calibrate) and start responding + * to Synaptics-specific queries, so let's wait a + * bit. + */ + ssleep(1); + } error = synaptics_detect(psmouse, 0); } while (error && ++retry < 3); diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c index 48ee3600a03b..a1ac2d204295 100755 --- a/drivers/input/touchscreen/max11801_ts.c +++ b/drivers/input/touchscreen/max11801_ts.c @@ -106,6 +106,7 @@ struct max11801_data { }; struct i2c_client *max11801_client; unsigned int max11801_workmode; +u8 aux_buf[AUX_BUFSIZE]; static int max11801_dcm_write_command(struct i2c_client *client, int command) { @@ -115,7 +116,6 @@ static int max11801_dcm_write_command(struct i2c_client *client, int command) static u32 max11801_dcm_sample_aux(struct i2c_client *client) { u8 temp_buf; - u8 aux_buf[AUX_BUFSIZE]; int ret; int aux = 0; u32 sample_data = 0; @@ -124,15 +124,17 @@ static u32 max11801_dcm_sample_aux(struct i2c_client *client) mdelay(5); ret = i2c_smbus_read_i2c_block_data(client, FIFO_RD_AUX_MSB, 1, &temp_buf); - aux_buf[0] = temp_buf; if (ret < 1) printk(KERN_DEBUG "FIFO_RD_AUX_MSB read fails\n"); + else + aux_buf[0] = temp_buf; mdelay(5); ret = i2c_smbus_read_i2c_block_data(client, FIFO_RD_AUX_LSB, 1, &temp_buf); - aux_buf[1] = temp_buf; if (ret < 1) printk(KERN_DEBUG "FIFO_RD_AUX_LSB read fails\n"); + else + aux_buf[1] = temp_buf; aux = (aux_buf[0] << 4) + (aux_buf[1] >> 4); /* |