diff options
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
| -rw-r--r-- | drivers/input/mouse/synaptics.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index da392c22fc6c..aa186cf6c514 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -755,23 +755,26 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
| 755 | { | 755 | { |
| 756 | struct synaptics_data *priv = psmouse->private; | 756 | struct synaptics_data *priv = psmouse->private; |
| 757 | struct synaptics_data old_priv = *priv; | 757 | struct synaptics_data old_priv = *priv; |
| 758 | int retry = 0; | ||
| 759 | int error; | ||
| 758 | 760 | ||
| 759 | psmouse_reset(psmouse); | 761 | do { |
| 762 | psmouse_reset(psmouse); | ||
| 763 | error = synaptics_detect(psmouse, 0); | ||
| 764 | } while (error && ++retry < 3); | ||
| 760 | 765 | ||
| 761 | if (synaptics_detect(psmouse, 0)) | 766 | if (error) |
| 762 | return -1; | 767 | return -1; |
| 763 | 768 | ||
| 769 | if (retry > 1) | ||
| 770 | printk(KERN_DEBUG "Synaptics reconnected after %d tries\n", | ||
| 771 | retry); | ||
| 772 | |||
| 764 | if (synaptics_query_hardware(psmouse)) { | 773 | if (synaptics_query_hardware(psmouse)) { |
| 765 | printk(KERN_ERR "Unable to query Synaptics hardware.\n"); | 774 | printk(KERN_ERR "Unable to query Synaptics hardware.\n"); |
| 766 | return -1; | 775 | return -1; |
| 767 | } | 776 | } |
| 768 | 777 | ||
| 769 | if (old_priv.identity != priv->identity || | ||
| 770 | old_priv.model_id != priv->model_id || | ||
| 771 | old_priv.capabilities != priv->capabilities || | ||
| 772 | old_priv.ext_cap != priv->ext_cap) | ||
| 773 | return -1; | ||
| 774 | |||
| 775 | if (synaptics_set_absolute_mode(psmouse)) { | 778 | if (synaptics_set_absolute_mode(psmouse)) { |
| 776 | printk(KERN_ERR "Unable to initialize Synaptics hardware.\n"); | 779 | printk(KERN_ERR "Unable to initialize Synaptics hardware.\n"); |
| 777 | return -1; | 780 | return -1; |
| @@ -782,6 +785,19 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
| 782 | return -1; | 785 | return -1; |
| 783 | } | 786 | } |
| 784 | 787 | ||
| 788 | if (old_priv.identity != priv->identity || | ||
| 789 | old_priv.model_id != priv->model_id || | ||
| 790 | old_priv.capabilities != priv->capabilities || | ||
| 791 | old_priv.ext_cap != priv->ext_cap) { | ||
| 792 | printk(KERN_ERR "Synaptics hardware appears to be different: " | ||
| 793 | "id(%ld-%ld), model(%ld-%ld), caps(%lx-%lx), ext(%lx-%lx).\n", | ||
| 794 | old_priv.identity, priv->identity, | ||
| 795 | old_priv.model_id, priv->model_id, | ||
| 796 | old_priv.capabilities, priv->capabilities, | ||
| 797 | old_priv.ext_cap, priv->ext_cap); | ||
| 798 | return -1; | ||
| 799 | } | ||
| 800 | |||
| 785 | return 0; | 801 | return 0; |
| 786 | } | 802 | } |
| 787 | 803 | ||
