Commit 8a7b8ff4 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 4322f028 dbf3c370
...@@ -771,7 +771,7 @@ static const struct attribute_group *elan_sysfs_groups[] = { ...@@ -771,7 +771,7 @@ static const struct attribute_group *elan_sysfs_groups[] = {
*/ */
static void elan_report_contact(struct elan_tp_data *data, static void elan_report_contact(struct elan_tp_data *data,
int contact_num, bool contact_valid, int contact_num, bool contact_valid,
bool hover_event, u8 *finger_data) u8 *finger_data)
{ {
struct input_dev *input = data->input; struct input_dev *input = data->input;
unsigned int pos_x, pos_y; unsigned int pos_x, pos_y;
...@@ -815,9 +815,7 @@ static void elan_report_contact(struct elan_tp_data *data, ...@@ -815,9 +815,7 @@ static void elan_report_contact(struct elan_tp_data *data,
input_mt_report_slot_state(input, MT_TOOL_FINGER, true); input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
input_report_abs(input, ABS_MT_POSITION_X, pos_x); input_report_abs(input, ABS_MT_POSITION_X, pos_x);
input_report_abs(input, ABS_MT_POSITION_Y, data->max_y - pos_y); input_report_abs(input, ABS_MT_POSITION_Y, data->max_y - pos_y);
input_report_abs(input, ABS_MT_DISTANCE, hover_event); input_report_abs(input, ABS_MT_PRESSURE, scaled_pressure);
input_report_abs(input, ABS_MT_PRESSURE,
hover_event ? 0 : scaled_pressure);
input_report_abs(input, ABS_TOOL_WIDTH, mk_x); input_report_abs(input, ABS_TOOL_WIDTH, mk_x);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, major); input_report_abs(input, ABS_MT_TOUCH_MAJOR, major);
input_report_abs(input, ABS_MT_TOUCH_MINOR, minor); 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,14 +837,14 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet)
hover_event = hover_info & 0x40; hover_event = hover_info & 0x40;
for (i = 0; i < ETP_MAX_FINGERS; i++) { for (i = 0; i < ETP_MAX_FINGERS; i++) {
contact_valid = tp_info & (1U << (3 + i)); contact_valid = tp_info & (1U << (3 + i));
elan_report_contact(data, i, contact_valid, hover_event, elan_report_contact(data, i, contact_valid, finger_data);
finger_data);
if (contact_valid) if (contact_valid)
finger_data += ETP_FINGER_DATA_LEN; finger_data += ETP_FINGER_DATA_LEN;
} }
input_report_key(input, BTN_LEFT, tp_info & 0x01); input_report_key(input, BTN_LEFT, tp_info & 0x01);
input_report_abs(input, ABS_DISTANCE, hover_event != 0);
input_mt_report_pointer_emulation(input, true); input_mt_report_pointer_emulation(input, true);
input_sync(input); input_sync(input);
} }
...@@ -922,6 +920,7 @@ static int elan_setup_input_device(struct elan_tp_data *data) ...@@ -922,6 +920,7 @@ static int elan_setup_input_device(struct elan_tp_data *data)
input_abs_set_res(input, ABS_Y, data->y_res); input_abs_set_res(input, ABS_Y, data->y_res);
input_set_abs_params(input, ABS_PRESSURE, 0, ETP_MAX_PRESSURE, 0, 0); input_set_abs_params(input, ABS_PRESSURE, 0, ETP_MAX_PRESSURE, 0, 0);
input_set_abs_params(input, ABS_TOOL_WIDTH, 0, ETP_FINGER_WIDTH, 0, 0); input_set_abs_params(input, ABS_TOOL_WIDTH, 0, ETP_FINGER_WIDTH, 0, 0);
input_set_abs_params(input, ABS_DISTANCE, 0, 1, 0, 0);
/* And MT parameters */ /* And MT parameters */
input_set_abs_params(input, ABS_MT_POSITION_X, 0, data->max_x, 0, 0); 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,7 +933,6 @@ static int elan_setup_input_device(struct elan_tp_data *data)
ETP_FINGER_WIDTH * max_width, 0, 0); ETP_FINGER_WIDTH * max_width, 0, 0);
input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0,
ETP_FINGER_WIDTH * min_width, 0, 0); ETP_FINGER_WIDTH * min_width, 0, 0);
input_set_abs_params(input, ABS_MT_DISTANCE, 0, 1, 0, 0);
data->input = input; data->input = input;
......
...@@ -1199,7 +1199,7 @@ static void set_input_params(struct psmouse *psmouse, ...@@ -1199,7 +1199,7 @@ static void set_input_params(struct psmouse *psmouse,
ABS_MT_POSITION_Y); ABS_MT_POSITION_Y);
/* Image sensors can report per-contact pressure */ /* Image sensors can report per-contact pressure */
input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0); input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
input_mt_init_slots(dev, 3, INPUT_MT_POINTER | INPUT_MT_TRACK); input_mt_init_slots(dev, 2, INPUT_MT_POINTER | INPUT_MT_TRACK);
/* Image sensors can signal 4 and 5 finger clicks */ /* Image sensors can signal 4 and 5 finger clicks */
__set_bit(BTN_TOOL_QUADTAP, dev->keybit); __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment