Commit bea9f0ff authored by Daniel Kurtz's avatar Daniel Kurtz Committed by Dmitry Torokhov

Input: synaptics - rename set_slot to be more descriptive

Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent a9f0b79e
...@@ -485,7 +485,8 @@ static int synaptics_parse_hw_state(const unsigned char buf[], ...@@ -485,7 +485,8 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
return 0; return 0;
} }
static void set_slot(struct input_dev *dev, int slot, bool active, int x, int y) static void synaptics_report_semi_mt_slot(struct input_dev *dev, int slot,
bool active, int x, int y)
{ {
input_mt_slot(dev, slot); input_mt_slot(dev, slot);
input_mt_report_slot_state(dev, MT_TOOL_FINGER, active); input_mt_report_slot_state(dev, MT_TOOL_FINGER, active);
...@@ -502,14 +503,16 @@ static void synaptics_report_semi_mt_data(struct input_dev *dev, ...@@ -502,14 +503,16 @@ static void synaptics_report_semi_mt_data(struct input_dev *dev,
int num_fingers) int num_fingers)
{ {
if (num_fingers >= 2) { if (num_fingers >= 2) {
set_slot(dev, 0, true, min(a->x, b->x), min(a->y, b->y)); synaptics_report_semi_mt_slot(dev, 0, true, min(a->x, b->x),
set_slot(dev, 1, true, max(a->x, b->x), max(a->y, b->y)); min(a->y, b->y));
synaptics_report_semi_mt_slot(dev, 1, true, max(a->x, b->x),
max(a->y, b->y));
} else if (num_fingers == 1) { } else if (num_fingers == 1) {
set_slot(dev, 0, true, a->x, a->y); synaptics_report_semi_mt_slot(dev, 0, true, a->x, a->y);
set_slot(dev, 1, false, 0, 0); synaptics_report_semi_mt_slot(dev, 1, false, 0, 0);
} else { } else {
set_slot(dev, 0, false, 0, 0); synaptics_report_semi_mt_slot(dev, 0, false, 0, 0);
set_slot(dev, 1, false, 0, 0); synaptics_report_semi_mt_slot(dev, 1, false, 0, 0);
} }
} }
......
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