From: Dmitry Torokhov Date: Mon, 16 Mar 2015 16:12:56 +0000 (-0700) Subject: Merge branch 'synaptics' into for-linus X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6067fe5e0bf29f525561c8281d01011cfc9ebbd4;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge branch 'synaptics' into for-linus Bring in changes needed to properly handle Lenovo 2015 lineup. --- 6067fe5e0bf29f525561c8281d01011cfc9ebbd4 diff --cc drivers/input/mouse/synaptics.c index f2cceb6493a0,ca7ca8d4eb33..c74bfa1c05e3 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@@ -603,8 -676,23 +671,20 @@@ static void synaptics_parse_agm(const u default: break; } - - /* Record that at least one AGM has been received since last SGM */ - priv->agm_pending = true; } + static void synaptics_parse_ext_buttons(const unsigned char buf[], + struct synaptics_data *priv, + struct synaptics_hw_state *hw) + { + unsigned int ext_bits = + (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1; + unsigned int ext_mask = GENMASK(ext_bits - 1, 0); + + hw->ext_buttons = buf[4] & ext_mask; + hw->ext_buttons |= (buf[5] & ext_mask) << ext_bits; + } + static bool is_forcepad; static int synaptics_parse_hw_state(const unsigned char buf[], @@@ -792,13 -903,25 +895,12 @@@ static void synaptics_report_buttons(st input_report_key(dev, BTN_BACK, hw->down); } - for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++) - input_report_key(dev, BTN_0 + i, hw->ext_buttons & (1 << i)); + synaptics_report_ext_buttons(psmouse, hw); } -static void synaptics_report_slot(struct input_dev *dev, int slot, - const struct synaptics_hw_state *hw) -{ - input_mt_slot(dev, slot); - input_mt_report_slot_state(dev, MT_TOOL_FINGER, (hw != NULL)); - if (!hw) - return; - - input_report_abs(dev, ABS_MT_POSITION_X, hw->x); - input_report_abs(dev, ABS_MT_POSITION_Y, synaptics_invert_y(hw->y)); - input_report_abs(dev, ABS_MT_PRESSURE, hw->z); -} - static void synaptics_report_mt_data(struct psmouse *psmouse, - struct synaptics_mt_state *mt_state, - const struct synaptics_hw_state *sgm) + const struct synaptics_hw_state *sgm, + int num_fingers) { struct input_dev *dev = psmouse->dev; struct synaptics_data *priv = psmouse->private; diff --cc drivers/input/mouse/synaptics.h index aedc3299b14e,f39539c70219..ee4bd0d12b26 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h @@@ -156,7 -196,11 +183,8 @@@ struct synaptics_data bool disable_gesture; /* disable gestures */ struct serio *pt_port; /* Pass-through serio port */ + unsigned char pt_buttons; /* Pass-through buttons */ - struct synaptics_mt_state mt_state; /* Current mt finger state */ - bool mt_state_lost; /* mt_state may be incorrect */ - /* * Last received Advanced Gesture Mode (AGM) packet. An AGM packet * contains position data for a second contact, at half resolution.