Commit 654b7d2a authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: do a full reset of Synaptics touchpad if extended protocol

       probes failed, otherwise trackpoint on the pass-through port
       may stop working (reset-disable isn't enough to revive it)    
parent 34051083
...@@ -287,6 +287,24 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command) ...@@ -287,6 +287,24 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
return 0; return 0;
} }
/*
* psmouse_reset() resets the mouse into power-on state.
*/
int psmouse_reset(struct psmouse *psmouse)
{
unsigned char param[2];
if (psmouse_command(psmouse, param, PSMOUSE_CMD_RESET_BAT))
return -1;
if (param[0] != PSMOUSE_RET_BAT && param[1] != PSMOUSE_RET_ID)
return -1;
return 0;
}
/* /*
* Genius NetMouse magic init. * Genius NetMouse magic init.
*/ */
...@@ -416,6 +434,7 @@ static int psmouse_extensions(struct psmouse *psmouse) ...@@ -416,6 +434,7 @@ static int psmouse_extensions(struct psmouse *psmouse)
* pass through port it could get disabled while probing for protocol * pass through port it could get disabled while probing for protocol
* extensions. * extensions.
*/ */
psmouse_reset(psmouse);
psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS); psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS);
} }
...@@ -540,8 +559,8 @@ static void psmouse_activate(struct psmouse *psmouse) ...@@ -540,8 +559,8 @@ static void psmouse_activate(struct psmouse *psmouse)
static void psmouse_cleanup(struct serio *serio) static void psmouse_cleanup(struct serio *serio)
{ {
struct psmouse *psmouse = serio->private; struct psmouse *psmouse = serio->private;
unsigned char param[2];
psmouse_command(psmouse, param, PSMOUSE_CMD_RESET_BAT); psmouse_reset(psmouse);
} }
/* /*
......
...@@ -65,6 +65,7 @@ struct psmouse { ...@@ -65,6 +65,7 @@ struct psmouse {
#define PSMOUSE_SYNAPTICS 7 #define PSMOUSE_SYNAPTICS 7
int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command); int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
int psmouse_reset(struct psmouse *psmouse);
extern int psmouse_smartscroll; extern int psmouse_smartscroll;
extern unsigned int psmouse_rate; extern unsigned int psmouse_rate;
......
...@@ -92,17 +92,6 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode) ...@@ -92,17 +92,6 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
return 0; return 0;
} }
static int synaptics_reset(struct psmouse *psmouse)
{
unsigned char r[2];
if (psmouse_command(psmouse, r, PSMOUSE_CMD_RESET_BAT))
return -1;
if (r[0] == PSMOUSE_RET_BAT && r[1] == PSMOUSE_RET_ID)
return 0;
return -1;
}
/* /*
* Read the model-id bytes from the touchpad * Read the model-id bytes from the touchpad
* see also SYN_MODEL_* macros * see also SYN_MODEL_* macros
...@@ -197,7 +186,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse) ...@@ -197,7 +186,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
{ {
int retries = 0; int retries = 0;
while ((retries++ < 3) && synaptics_reset(psmouse)) while ((retries++ < 3) && psmouse_reset(psmouse))
printk(KERN_ERR "synaptics reset failed\n"); printk(KERN_ERR "synaptics reset failed\n");
if (synaptics_identify(psmouse)) if (synaptics_identify(psmouse))
......
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