diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-20 13:33:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-20 13:33:06 -0400 |
| commit | a0fe3cc5d36a5f5b4f60abfe1a4b1caf4a5cce5a (patch) | |
| tree | 99a735d89df5bf49cf4edda1ba53bd9175d0f163 /drivers/input/mouse/synaptics.c | |
| parent | 04afb40593f9a3007e5ea817d009529ef10fb685 (diff) | |
| parent | a62f0d27b4196bad5e900d766b285feb7069cd16 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (40 commits)
Input: psmouse - small formatting changes to better follow coding style
Input: synaptics - set dimensions as reported by firmware
Input: elantech - relax signature checks
Input: elantech - enforce common prefix on messages
Input: wistron_btns - switch to using kmemdup()
Input: usbtouchscreen - switch to using kmemdup()
Input: do not force selecting i8042 on Moorestown
Input: Documentation/sysrq.txt - update KEY_SYSRQ info
Input: 88pm860x_onkey - remove invalid irq number assignment
Input: i8042 - add a PNP entry to the aux device list
Input: i8042 - add some extra PNP keyboard types
Input: wm9712 - fix wm97xx_set_gpio() logic
Input: add keypad driver for keys interfaced to TCA6416
Input: remove obsolete {corgi,spitz,tosa}kbd.c
Input: kbtab - do not advertise unsupported events
Input: kbtab - simplify kbtab_disconnect()
Input: kbtab - fix incorrect size parameter in usb_buffer_free
Input: acecad - don't advertise mouse events
Input: acecad - fix some formatting issues
Input: acecad - simplify usb_acecad_disconnect()
...
Trivial conflict in Documentation/feature-removal-schedule.txt
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
| -rw-r--r-- | drivers/input/mouse/synaptics.c | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index ebd7a99efeae..40cea334ad13 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -36,6 +36,8 @@ | |||
| 36 | * The x/y limits are taken from the Synaptics TouchPad interfacing Guide, | 36 | * The x/y limits are taken from the Synaptics TouchPad interfacing Guide, |
| 37 | * section 2.3.2, which says that they should be valid regardless of the | 37 | * section 2.3.2, which says that they should be valid regardless of the |
| 38 | * actual size of the sensor. | 38 | * actual size of the sensor. |
| 39 | * Note that newer firmware allows querying device for maximum useable | ||
| 40 | * coordinates. | ||
| 39 | */ | 41 | */ |
| 40 | #define XMIN_NOMINAL 1472 | 42 | #define XMIN_NOMINAL 1472 |
| 41 | #define XMAX_NOMINAL 5472 | 43 | #define XMAX_NOMINAL 5472 |
| @@ -194,23 +196,33 @@ static int synaptics_identify(struct psmouse *psmouse) | |||
| 194 | } | 196 | } |
| 195 | 197 | ||
| 196 | /* | 198 | /* |
| 197 | * Read touchpad resolution | 199 | * Read touchpad resolution and maximum reported coordinates |
| 198 | * Resolution is left zero if touchpad does not support the query | 200 | * Resolution is left zero if touchpad does not support the query |
| 199 | */ | 201 | */ |
| 200 | static int synaptics_resolution(struct psmouse *psmouse) | 202 | static int synaptics_resolution(struct psmouse *psmouse) |
| 201 | { | 203 | { |
| 202 | struct synaptics_data *priv = psmouse->private; | 204 | struct synaptics_data *priv = psmouse->private; |
| 203 | unsigned char res[3]; | 205 | unsigned char res[3]; |
| 206 | unsigned char max[3]; | ||
| 204 | 207 | ||
| 205 | if (SYN_ID_MAJOR(priv->identity) < 4) | 208 | if (SYN_ID_MAJOR(priv->identity) < 4) |
| 206 | return 0; | ||
| 207 | 209 | ||
| 208 | if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res)) | 210 | if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res) == 0) { |
| 209 | return 0; | 211 | if (res[0] != 0 && (res[1] & 0x80) && res[2] != 0) { |
| 212 | priv->x_res = res[0]; /* x resolution in units/mm */ | ||
| 213 | priv->y_res = res[2]; /* y resolution in units/mm */ | ||
| 214 | } | ||
| 215 | } | ||
| 210 | 216 | ||
| 211 | if ((res[0] != 0) && (res[1] & 0x80) && (res[2] != 0)) { | 217 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 && |
| 212 | priv->x_res = res[0]; /* x resolution in units/mm */ | 218 | SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) { |
| 213 | priv->y_res = res[2]; /* y resolution in units/mm */ | 219 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_DIMENSIONS, max)) { |
| 220 | printk(KERN_ERR "Synaptics claims to have dimensions query," | ||
| 221 | " but I'm not able to read it.\n"); | ||
| 222 | } else { | ||
| 223 | priv->x_max = (max[0] << 5) | ((max[1] & 0x0f) << 1); | ||
| 224 | priv->y_max = (max[2] << 5) | ((max[1] & 0xf0) >> 3); | ||
| 225 | } | ||
| 214 | } | 226 | } |
| 215 | 227 | ||
| 216 | return 0; | 228 | return 0; |
| @@ -520,19 +532,20 @@ static int synaptics_validate_byte(unsigned char packet[], int idx, unsigned cha | |||
| 520 | return 0; | 532 | return 0; |
| 521 | 533 | ||
| 522 | switch (pkt_type) { | 534 | switch (pkt_type) { |
| 523 | case SYN_NEWABS: | ||
| 524 | case SYN_NEWABS_RELAXED: | ||
| 525 | return (packet[idx] & newabs_rel_mask[idx]) == newabs_rslt[idx]; | ||
| 526 | 535 | ||
| 527 | case SYN_NEWABS_STRICT: | 536 | case SYN_NEWABS: |
| 528 | return (packet[idx] & newabs_mask[idx]) == newabs_rslt[idx]; | 537 | case SYN_NEWABS_RELAXED: |
| 538 | return (packet[idx] & newabs_rel_mask[idx]) == newabs_rslt[idx]; | ||
| 529 | 539 | ||
| 530 | case SYN_OLDABS: | 540 | case SYN_NEWABS_STRICT: |
| 531 | return (packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx]; | 541 | return (packet[idx] & newabs_mask[idx]) == newabs_rslt[idx]; |
| 532 | 542 | ||
| 533 | default: | 543 | case SYN_OLDABS: |
| 534 | printk(KERN_ERR "synaptics: unknown packet type %d\n", pkt_type); | 544 | return (packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx]; |
| 535 | return 0; | 545 | |
| 546 | default: | ||
| 547 | printk(KERN_ERR "synaptics: unknown packet type %d\n", pkt_type); | ||
| 548 | return 0; | ||
| 536 | } | 549 | } |
| 537 | } | 550 | } |
| 538 | 551 | ||
| @@ -578,8 +591,10 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) | |||
| 578 | int i; | 591 | int i; |
| 579 | 592 | ||
| 580 | __set_bit(EV_ABS, dev->evbit); | 593 | __set_bit(EV_ABS, dev->evbit); |
| 581 | input_set_abs_params(dev, ABS_X, XMIN_NOMINAL, XMAX_NOMINAL, 0, 0); | 594 | input_set_abs_params(dev, ABS_X, |
| 582 | input_set_abs_params(dev, ABS_Y, YMIN_NOMINAL, YMAX_NOMINAL, 0, 0); | 595 | XMIN_NOMINAL, priv->x_max ?: XMAX_NOMINAL, 0, 0); |
| 596 | input_set_abs_params(dev, ABS_Y, | ||
| 597 | YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0); | ||
| 583 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); | 598 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); |
| 584 | __set_bit(ABS_TOOL_WIDTH, dev->absbit); | 599 | __set_bit(ABS_TOOL_WIDTH, dev->absbit); |
| 585 | 600 | ||
