aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-09-05 15:57:13 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-09-05 15:58:22 -0400
commitf4ccbef2886968ed409939531f6dd0474d53a12a (patch)
tree764b513e40b681bf3bd908e40e8e3a21015d7579 /drivers/input/tablet
parentcb734c03680eaaad64a20a666300eafd1ac260b2 (diff)
Input: wacom - add a quirk for low resolution Bamboo devices
The Bamboo Touch reports a sub-screen resolution of 480x320. The signal-to-noise ratio is only about 100, so filtering is needed in order to reduce the jitter to a usable level. However, the low resolution leads to round-off errors in the EWMA filter, resulting in extremely jerky pointer motion. This patch explicitly sets a higher resolution for those devices, and tells this to the completion handler via a low-resolution quirk. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/wacom_wac.c10
-rw-r--r--drivers/input/tablet/wacom_wac.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 4e9b1ddf54e9..2f4411aee305 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -857,6 +857,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
857 857
858static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) 858static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
859{ 859{
860 struct wacom_features *features = &wacom->features;
860 struct input_dev *input = wacom->input; 861 struct input_dev *input = wacom->input;
861 unsigned char *data = wacom->data; 862 unsigned char *data = wacom->data;
862 int sp = 0, sx = 0, sy = 0, count = 0; 863 int sp = 0, sx = 0, sy = 0, count = 0;
@@ -871,6 +872,10 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
871 if (p) { 872 if (p) {
872 int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; 873 int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
873 int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; 874 int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
875 if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
876 x <<= 5;
877 y <<= 5;
878 }
874 input_report_abs(input, ABS_MT_PRESSURE, p); 879 input_report_abs(input, ABS_MT_PRESSURE, p);
875 input_report_abs(input, ABS_MT_POSITION_X, x); 880 input_report_abs(input, ABS_MT_POSITION_X, x);
876 input_report_abs(input, ABS_MT_POSITION_Y, y); 881 input_report_abs(input, ABS_MT_POSITION_Y, y);
@@ -1010,8 +1015,13 @@ void wacom_setup_device_quirks(struct wacom_features *features)
1010 /* quirks for bamboo touch */ 1015 /* quirks for bamboo touch */
1011 if (features->type == BAMBOO_PT && 1016 if (features->type == BAMBOO_PT &&
1012 features->device_type == BTN_TOOL_TRIPLETAP) { 1017 features->device_type == BTN_TOOL_TRIPLETAP) {
1018 features->x_max <<= 5;
1019 features->y_max <<= 5;
1020 features->x_fuzz <<= 5;
1021 features->y_fuzz <<= 5;
1013 features->pressure_max = 256; 1022 features->pressure_max = 256;
1014 features->pressure_fuzz = 16; 1023 features->pressure_fuzz = 16;
1024 features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
1015 } 1025 }
1016} 1026}
1017 1027
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index a23d6a5fcc4f..00ca01541d89 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -40,6 +40,7 @@
40 40
41/* device quirks */ 41/* device quirks */
42#define WACOM_QUIRK_MULTI_INPUT 0x0001 42#define WACOM_QUIRK_MULTI_INPUT 0x0001
43#define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002
43 44
44/* largest reported tracking id */ 45/* largest reported tracking id */
45#define MAX_TRACKING_ID 0xfff 46#define MAX_TRACKING_ID 0xfff