diff options
author | John Sung <penmount.touch@gmail.com> | 2011-09-09 16:33:12 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-09-21 01:46:28 -0400 |
commit | 21ae508bab28c2b0ae8709c95a36739b6f1ae5be (patch) | |
tree | 8146e9090ffa387af692a50bc78b2e60d03188e8 /drivers/input/touchscreen | |
parent | 4af61e90270e35bafa9e99a3c48fb3f363da592d (diff) |
Input: penmount - fix the protocol
The MSB and LSB of the XY axis value are switched according to the PenMount 9000 protocol. The driver name is also changed from penmountlpc, since it is not for LPC interface at all.
Signed-off-by: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/penmount.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/penmount.c b/drivers/input/touchscreen/penmount.c index c7f9cebebbb6..3342c6d8e57d 100644 --- a/drivers/input/touchscreen/penmount.c +++ b/drivers/input/touchscreen/penmount.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * Penmount serial touchscreen driver | 2 | * Penmount serial touchscreen driver |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Rick Koch <n1gp@hotmail.com> | 4 | * Copyright (c) 2006 Rick Koch <n1gp@hotmail.com> |
5 | * Copyright (c) 2011 John Sung <penmount.touch@gmail.com> | ||
5 | * | 6 | * |
6 | * Based on ELO driver (drivers/input/touchscreen/elo.c) | 7 | * Based on ELO driver (drivers/input/touchscreen/elo.c) |
7 | * Copyright (c) 2004 Vojtech Pavlik | 8 | * Copyright (c) 2004 Vojtech Pavlik |
@@ -21,9 +22,10 @@ | |||
21 | #include <linux/serio.h> | 22 | #include <linux/serio.h> |
22 | #include <linux/init.h> | 23 | #include <linux/init.h> |
23 | 24 | ||
24 | #define DRIVER_DESC "Penmount serial touchscreen driver" | 25 | #define DRIVER_DESC "PenMount serial touchscreen driver" |
25 | 26 | ||
26 | MODULE_AUTHOR("Rick Koch <n1gp@hotmail.com>"); | 27 | MODULE_AUTHOR("Rick Koch <n1gp@hotmail.com>"); |
28 | MODULE_AUTHOR("John Sung <penmount.touch@gmail.com>"); | ||
27 | MODULE_DESCRIPTION(DRIVER_DESC); | 29 | MODULE_DESCRIPTION(DRIVER_DESC); |
28 | MODULE_LICENSE("GPL"); | 30 | MODULE_LICENSE("GPL"); |
29 | 31 | ||
@@ -55,8 +57,8 @@ static irqreturn_t pm_interrupt(struct serio *serio, | |||
55 | 57 | ||
56 | if (pm->data[0] & 0x80) { | 58 | if (pm->data[0] & 0x80) { |
57 | if (PM_MAX_LENGTH == ++pm->idx) { | 59 | if (PM_MAX_LENGTH == ++pm->idx) { |
58 | input_report_abs(dev, ABS_X, pm->data[2] * 128 + pm->data[1]); | 60 | input_report_abs(dev, ABS_X, pm->data[1] * 128 + pm->data[2]); |
59 | input_report_abs(dev, ABS_Y, pm->data[4] * 128 + pm->data[3]); | 61 | input_report_abs(dev, ABS_Y, pm->data[3] * 128 + pm->data[4]); |
60 | input_report_key(dev, BTN_TOUCH, !!(pm->data[0] & 0x40)); | 62 | input_report_key(dev, BTN_TOUCH, !!(pm->data[0] & 0x40)); |
61 | input_sync(dev); | 63 | input_sync(dev); |
62 | pm->idx = 0; | 64 | pm->idx = 0; |
@@ -84,7 +86,7 @@ static void pm_disconnect(struct serio *serio) | |||
84 | 86 | ||
85 | /* | 87 | /* |
86 | * pm_connect() is the routine that is called when someone adds a | 88 | * pm_connect() is the routine that is called when someone adds a |
87 | * new serio device that supports Gunze protocol and registers it as | 89 | * new serio device that supports PenMount protocol and registers it as |
88 | * an input device. | 90 | * an input device. |
89 | */ | 91 | */ |
90 | 92 | ||
@@ -105,7 +107,7 @@ static int pm_connect(struct serio *serio, struct serio_driver *drv) | |||
105 | pm->dev = input_dev; | 107 | pm->dev = input_dev; |
106 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys); | 108 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys); |
107 | 109 | ||
108 | input_dev->name = "Penmount Serial TouchScreen"; | 110 | input_dev->name = "PenMount Serial TouchScreen"; |
109 | input_dev->phys = pm->phys; | 111 | input_dev->phys = pm->phys; |
110 | input_dev->id.bustype = BUS_RS232; | 112 | input_dev->id.bustype = BUS_RS232; |
111 | input_dev->id.vendor = SERIO_PENMOUNT; | 113 | input_dev->id.vendor = SERIO_PENMOUNT; |
@@ -155,7 +157,7 @@ MODULE_DEVICE_TABLE(serio, pm_serio_ids); | |||
155 | 157 | ||
156 | static struct serio_driver pm_drv = { | 158 | static struct serio_driver pm_drv = { |
157 | .driver = { | 159 | .driver = { |
158 | .name = "penmountlpc", | 160 | .name = "serio-penmount", |
159 | }, | 161 | }, |
160 | .description = DRIVER_DESC, | 162 | .description = DRIVER_DESC, |
161 | .id_table = pm_serio_ids, | 163 | .id_table = pm_serio_ids, |