aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-11 14:16:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-11 14:16:04 -0400
commit8a7b8ff41ddc811f3e06d0bf6892bc3e2b1764b7 (patch)
treeb469c40162a0dd1bd1774ebfdd0285661c9a814a
parent4322f028477d4c84f12fa9aa21809300855ff953 (diff)
parentdbf3c370862d73fcd2c74ca55e254bb02143238d (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: "A fix (revert) for a recent regression in Synaptics driver and a fix for Elan i2c touchpad driver" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Revert "Input: synaptics - allocate 3 slots to keep stability in image sensors" Input: elan_i2c - change the hover event from MT to ST
-rw-r--r--drivers/input/mouse/elan_i2c_core.c12
-rw-r--r--drivers/input/mouse/synaptics.c2
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 62641f2adaf7..5b5f403d8ce6 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -771,7 +771,7 @@ static const struct attribute_group *elan_sysfs_groups[] = {
771 */ 771 */
772static void elan_report_contact(struct elan_tp_data *data, 772static void elan_report_contact(struct elan_tp_data *data,
773 int contact_num, bool contact_valid, 773 int contact_num, bool contact_valid,
774 bool hover_event, u8 *finger_data) 774 u8 *finger_data)
775{ 775{
776 struct input_dev *input = data->input; 776 struct input_dev *input = data->input;
777 unsigned int pos_x, pos_y; 777 unsigned int pos_x, pos_y;
@@ -815,9 +815,7 @@ static void elan_report_contact(struct elan_tp_data *data,
815 input_mt_report_slot_state(input, MT_TOOL_FINGER, true); 815 input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
816 input_report_abs(input, ABS_MT_POSITION_X, pos_x); 816 input_report_abs(input, ABS_MT_POSITION_X, pos_x);
817 input_report_abs(input, ABS_MT_POSITION_Y, data->max_y - pos_y); 817 input_report_abs(input, ABS_MT_POSITION_Y, data->max_y - pos_y);
818 input_report_abs(input, ABS_MT_DISTANCE, hover_event); 818 input_report_abs(input, ABS_MT_PRESSURE, scaled_pressure);
819 input_report_abs(input, ABS_MT_PRESSURE,
820 hover_event ? 0 : scaled_pressure);
821 input_report_abs(input, ABS_TOOL_WIDTH, mk_x); 819 input_report_abs(input, ABS_TOOL_WIDTH, mk_x);
822 input_report_abs(input, ABS_MT_TOUCH_MAJOR, major); 820 input_report_abs(input, ABS_MT_TOUCH_MAJOR, major);
823 input_report_abs(input, ABS_MT_TOUCH_MINOR, minor); 821 input_report_abs(input, ABS_MT_TOUCH_MINOR, minor);
@@ -839,14 +837,14 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet)
839 hover_event = hover_info & 0x40; 837 hover_event = hover_info & 0x40;
840 for (i = 0; i < ETP_MAX_FINGERS; i++) { 838 for (i = 0; i < ETP_MAX_FINGERS; i++) {
841 contact_valid = tp_info & (1U << (3 + i)); 839 contact_valid = tp_info & (1U << (3 + i));
842 elan_report_contact(data, i, contact_valid, hover_event, 840 elan_report_contact(data, i, contact_valid, finger_data);
843 finger_data);
844 841
845 if (contact_valid) 842 if (contact_valid)
846 finger_data += ETP_FINGER_DATA_LEN; 843 finger_data += ETP_FINGER_DATA_LEN;
847 } 844 }
848 845
849 input_report_key(input, BTN_LEFT, tp_info & 0x01); 846 input_report_key(input, BTN_LEFT, tp_info & 0x01);
847 input_report_abs(input, ABS_DISTANCE, hover_event != 0);
850 input_mt_report_pointer_emulation(input, true); 848 input_mt_report_pointer_emulation(input, true);
851 input_sync(input); 849 input_sync(input);
852} 850}
@@ -922,6 +920,7 @@ static int elan_setup_input_device(struct elan_tp_data *data)
922 input_abs_set_res(input, ABS_Y, data->y_res); 920 input_abs_set_res(input, ABS_Y, data->y_res);
923 input_set_abs_params(input, ABS_PRESSURE, 0, ETP_MAX_PRESSURE, 0, 0); 921 input_set_abs_params(input, ABS_PRESSURE, 0, ETP_MAX_PRESSURE, 0, 0);
924 input_set_abs_params(input, ABS_TOOL_WIDTH, 0, ETP_FINGER_WIDTH, 0, 0); 922 input_set_abs_params(input, ABS_TOOL_WIDTH, 0, ETP_FINGER_WIDTH, 0, 0);
923 input_set_abs_params(input, ABS_DISTANCE, 0, 1, 0, 0);
925 924
926 /* And MT parameters */ 925 /* And MT parameters */
927 input_set_abs_params(input, ABS_MT_POSITION_X, 0, data->max_x, 0, 0); 926 input_set_abs_params(input, ABS_MT_POSITION_X, 0, data->max_x, 0, 0);
@@ -934,7 +933,6 @@ static int elan_setup_input_device(struct elan_tp_data *data)
934 ETP_FINGER_WIDTH * max_width, 0, 0); 933 ETP_FINGER_WIDTH * max_width, 0, 0);
935 input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 934 input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0,
936 ETP_FINGER_WIDTH * min_width, 0, 0); 935 ETP_FINGER_WIDTH * min_width, 0, 0);
937 input_set_abs_params(input, ABS_MT_DISTANCE, 0, 1, 0, 0);
938 936
939 data->input = input; 937 data->input = input;
940 938
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 35c8d0ceabee..3a32caf06bf1 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1199,7 +1199,7 @@ static void set_input_params(struct psmouse *psmouse,
1199 ABS_MT_POSITION_Y); 1199 ABS_MT_POSITION_Y);
1200 /* Image sensors can report per-contact pressure */ 1200 /* Image sensors can report per-contact pressure */
1201 input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0); 1201 input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
1202 input_mt_init_slots(dev, 3, INPUT_MT_POINTER | INPUT_MT_TRACK); 1202 input_mt_init_slots(dev, 2, INPUT_MT_POINTER | INPUT_MT_TRACK);
1203 1203
1204 /* Image sensors can signal 4 and 5 finger clicks */ 1204 /* Image sensors can signal 4 and 5 finger clicks */
1205 __set_bit(BTN_TOOL_QUADTAP, dev->keybit); 1205 __set_bit(BTN_TOOL_QUADTAP, dev->keybit);