diff options
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
-rw-r--r-- | drivers/input/mouse/synaptics.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index f3e4f7b0240d..19984bf06cad 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -180,6 +180,29 @@ static int synaptics_identify(struct psmouse *psmouse) | |||
180 | return -1; | 180 | return -1; |
181 | } | 181 | } |
182 | 182 | ||
183 | /* | ||
184 | * Read touchpad resolution | ||
185 | * Resolution is left zero if touchpad does not support the query | ||
186 | */ | ||
187 | static int synaptics_resolution(struct psmouse *psmouse) | ||
188 | { | ||
189 | struct synaptics_data *priv = psmouse->private; | ||
190 | unsigned char res[3]; | ||
191 | |||
192 | if (SYN_ID_MAJOR(priv->identity) < 4) | ||
193 | return 0; | ||
194 | |||
195 | if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res)) | ||
196 | return 0; | ||
197 | |||
198 | if ((res[0] != 0) && (res[1] & 0x80) && (res[2] != 0)) { | ||
199 | priv->x_res = res[0]; /* x resolution in units/mm */ | ||
200 | priv->y_res = res[2]; /* y resolution in units/mm */ | ||
201 | } | ||
202 | |||
203 | return 0; | ||
204 | } | ||
205 | |||
183 | static int synaptics_query_hardware(struct psmouse *psmouse) | 206 | static int synaptics_query_hardware(struct psmouse *psmouse) |
184 | { | 207 | { |
185 | if (synaptics_identify(psmouse)) | 208 | if (synaptics_identify(psmouse)) |
@@ -188,6 +211,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse) | |||
188 | return -1; | 211 | return -1; |
189 | if (synaptics_capability(psmouse)) | 212 | if (synaptics_capability(psmouse)) |
190 | return -1; | 213 | return -1; |
214 | if (synaptics_resolution(psmouse)) | ||
215 | return -1; | ||
191 | 216 | ||
192 | return 0; | 217 | return 0; |
193 | } | 218 | } |
@@ -563,6 +588,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) | |||
563 | clear_bit(EV_REL, dev->evbit); | 588 | clear_bit(EV_REL, dev->evbit); |
564 | clear_bit(REL_X, dev->relbit); | 589 | clear_bit(REL_X, dev->relbit); |
565 | clear_bit(REL_Y, dev->relbit); | 590 | clear_bit(REL_Y, dev->relbit); |
591 | |||
592 | dev->absres[ABS_X] = priv->x_res; | ||
593 | dev->absres[ABS_Y] = priv->y_res; | ||
566 | } | 594 | } |
567 | 595 | ||
568 | static void synaptics_disconnect(struct psmouse *psmouse) | 596 | static void synaptics_disconnect(struct psmouse *psmouse) |