diff options
author | Daniel Kurtz <djkurtz@chromium.org> | 2011-07-07 01:39:14 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-07-07 02:01:09 -0400 |
commit | a9f0b79edfda3750d254ba5b192795e2554c361d (patch) | |
tree | c7fac3d08d6a031dd6fa356eb68c28c00d4367a6 /drivers/input | |
parent | 8be3c650f54c259694e82282e54b12c14304487e (diff) |
Input: synaptics - fuzz position for touchpad with reduced filtering
Synaptics touchpads indicate via a capability bit when they perform reduced
filtering on position data. In such a case, use a non-zero fuzz value.
Fuzz = 8 was chosen empirically by observing the raw position data
reported by a clickpad indicating it had reduced filtering.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/synaptics.c | 15 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.h | 10 |
2 files changed, 15 insertions, 10 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 477d1eaea8b5..363aedf8131d 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -684,23 +684,25 @@ static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse) | |||
684 | static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) | 684 | static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) |
685 | { | 685 | { |
686 | int i; | 686 | int i; |
687 | int fuzz = SYN_CAP_REDUCED_FILTERING(priv->ext_cap_0c) ? | ||
688 | SYN_REDUCED_FILTER_FUZZ : 0; | ||
687 | 689 | ||
688 | __set_bit(INPUT_PROP_POINTER, dev->propbit); | 690 | __set_bit(INPUT_PROP_POINTER, dev->propbit); |
689 | 691 | ||
690 | __set_bit(EV_ABS, dev->evbit); | 692 | __set_bit(EV_ABS, dev->evbit); |
691 | input_set_abs_params(dev, ABS_X, | 693 | input_set_abs_params(dev, ABS_X, XMIN_NOMINAL, |
692 | XMIN_NOMINAL, priv->x_max ?: XMAX_NOMINAL, 0, 0); | 694 | priv->x_max ?: XMAX_NOMINAL, fuzz, 0); |
693 | input_set_abs_params(dev, ABS_Y, | 695 | input_set_abs_params(dev, ABS_Y, YMIN_NOMINAL, |
694 | YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0); | 696 | priv->y_max ?: YMAX_NOMINAL, fuzz, 0); |
695 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); | 697 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); |
696 | 698 | ||
697 | if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) { | 699 | if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) { |
698 | __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); | 700 | __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); |
699 | input_mt_init_slots(dev, 2); | 701 | input_mt_init_slots(dev, 2); |
700 | input_set_abs_params(dev, ABS_MT_POSITION_X, XMIN_NOMINAL, | 702 | input_set_abs_params(dev, ABS_MT_POSITION_X, XMIN_NOMINAL, |
701 | priv->x_max ?: XMAX_NOMINAL, 0, 0); | 703 | priv->x_max ?: XMAX_NOMINAL, fuzz, 0); |
702 | input_set_abs_params(dev, ABS_MT_POSITION_Y, YMIN_NOMINAL, | 704 | input_set_abs_params(dev, ABS_MT_POSITION_Y, YMIN_NOMINAL, |
703 | priv->y_max ?: YMAX_NOMINAL, 0, 0); | 705 | priv->y_max ?: YMAX_NOMINAL, fuzz, 0); |
704 | 706 | ||
705 | input_abs_set_res(dev, ABS_MT_POSITION_X, priv->x_res); | 707 | input_abs_set_res(dev, ABS_MT_POSITION_X, priv->x_res); |
706 | input_abs_set_res(dev, ABS_MT_POSITION_Y, priv->y_res); | 708 | input_abs_set_res(dev, ABS_MT_POSITION_Y, priv->y_res); |
@@ -974,4 +976,3 @@ bool synaptics_supported(void) | |||
974 | } | 976 | } |
975 | 977 | ||
976 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 978 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
977 | |||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 7453938bf5ef..b8025b0ee2bd 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -66,9 +66,9 @@ | |||
66 | * 1 0x60 multifinger mode identifies firmware finger counting | 66 | * 1 0x60 multifinger mode identifies firmware finger counting |
67 | * (not reporting!) algorithm. | 67 | * (not reporting!) algorithm. |
68 | * Not particularly meaningful | 68 | * Not particularly meaningful |
69 | * 1 0x80 covered pad W clipped to 14, 15 == pad mostly covered | 69 | * 1 0x80 covered pad W clipped to 14, 15 == pad mostly covered |
70 | * 2 0x01 clickpad bit 1 2-button ClickPad | 70 | * 2 0x01 clickpad bit 1 2-button ClickPad |
71 | * 2 0x02 deluxe LED controls touchpad support LED commands | 71 | * 2 0x02 deluxe LED controls touchpad support LED commands |
72 | * ala multimedia control bar | 72 | * ala multimedia control bar |
73 | * 2 0x04 reduced filtering firmware does less filtering on | 73 | * 2 0x04 reduced filtering firmware does less filtering on |
74 | * position data, driver should watch | 74 | * position data, driver should watch |
@@ -78,6 +78,7 @@ | |||
78 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ | 78 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ |
79 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) | 79 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) |
80 | #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000) | 80 | #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000) |
81 | #define SYN_CAP_REDUCED_FILTERING(ex0c) ((ex0c) & 0x000400) | ||
81 | 82 | ||
82 | /* synaptics modes query bits */ | 83 | /* synaptics modes query bits */ |
83 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) | 84 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) |
@@ -104,6 +105,9 @@ | |||
104 | #define SYN_NEWABS_RELAXED 2 | 105 | #define SYN_NEWABS_RELAXED 2 |
105 | #define SYN_OLDABS 3 | 106 | #define SYN_OLDABS 3 |
106 | 107 | ||
108 | /* amount to fuzz position data when touchpad reports reduced filtering */ | ||
109 | #define SYN_REDUCED_FILTER_FUZZ 8 | ||
110 | |||
107 | /* | 111 | /* |
108 | * A structure to describe the state of the touchpad hardware (buttons and pad) | 112 | * A structure to describe the state of the touchpad hardware (buttons and pad) |
109 | */ | 113 | */ |