diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-29 09:16:13 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-29 09:16:25 +0200 |
commit | 348b346b238d9c0e5694c8d0b835a099cb383835 (patch) | |
tree | 967d9c72a1d6d33a408a1ff0d732296dbe8d3674 /drivers/input/mouse/synaptics.c | |
parent | 6c697bdf08a09ce461e305a22362973036e95db3 (diff) | |
parent | 52989765629e7d182b4f146050ebba0abf2cb0b7 (diff) |
Merge branch 'linus' into sched/core
Merge reason: we will merge a dependent patch.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 f3e4f7b0240..19984bf06ca 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -180,6 +180,29 @@ static int synaptics_identify(struct psmouse *psmouse) return -1; } +/* + * Read touchpad resolution + * Resolution is left zero if touchpad does not support the query + */ +static int synaptics_resolution(struct psmouse *psmouse) +{ + struct synaptics_data *priv = psmouse->private; + unsigned char res[3]; + + if (SYN_ID_MAJOR(priv->identity) < 4) + return 0; + + if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res)) + return 0; + + if ((res[0] != 0) && (res[1] & 0x80) && (res[2] != 0)) { + priv->x_res = res[0]; /* x resolution in units/mm */ + priv->y_res = res[2]; /* y resolution in units/mm */ + } + + return 0; +} + static int synaptics_query_hardware(struct psmouse *psmouse) { if (synaptics_identify(psmouse)) @@ -188,6 +211,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse) return -1; if (synaptics_capability(psmouse)) return -1; + if (synaptics_resolution(psmouse)) + return -1; return 0; } @@ -563,6 +588,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) clear_bit(EV_REL, dev->evbit); clear_bit(REL_X, dev->relbit); clear_bit(REL_Y, dev->relbit); + + dev->absres[ABS_X] = priv->x_res; + dev->absres[ABS_Y] = priv->y_res; } static void synaptics_disconnect(struct psmouse *psmouse) |