Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269450
b: refs/heads/master
c: 7afdb84
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Kurtz authored and Dmitry Torokhov committed Aug 24, 2011
1 parent 605f66e commit 30db656
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6de58dd625a7645008c5c450bf97a5793faf58c3
refs/heads/master: 7afdb842d9fa8cd62c33e76a1efc62c59772216d
19 changes: 14 additions & 5 deletions trunk/drivers/input/mouse/synaptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,17 @@ static void synaptics_pt_create(struct psmouse *psmouse)
* Functions to interpret the absolute mode packets
****************************************************************************/

static void synaptics_parse_agm(const unsigned char buf[],
struct synaptics_data *priv)
{
struct synaptics_hw_state *agm = &priv->agm;

/* Gesture packet: (x, y, z) at half resolution */
agm->x = (((buf[4] & 0x0f) << 8) | buf[1]) << 1;
agm->y = (((buf[4] & 0xf0) << 4) | buf[2]) << 1;
agm->z = ((buf[3] & 0x30) | (buf[5] & 0x0f)) << 1;
}

static int synaptics_parse_hw_state(const unsigned char buf[],
struct synaptics_data *priv,
struct synaptics_hw_state *hw)
Expand Down Expand Up @@ -453,10 +464,7 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
}

if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c) && hw->w == 2) {
/* Gesture packet: (x, y, z) at half resolution */
priv->mt.x = (((buf[4] & 0x0f) << 8) | buf[1]) << 1;
priv->mt.y = (((buf[4] & 0xf0) << 4) | buf[2]) << 1;
priv->mt.z = ((buf[3] & 0x30) | (buf[5] & 0x0f)) << 1;
synaptics_parse_agm(buf, priv);
return 1;
}

Expand Down Expand Up @@ -595,7 +603,8 @@ static void synaptics_process_packet(struct psmouse *psmouse)
}

if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c))
synaptics_report_semi_mt_data(dev, &hw, &priv->mt, num_fingers);
synaptics_report_semi_mt_data(dev, &hw, &priv->agm,
num_fingers);

/* Post events
* BTN_TOUCH has to be first as mousedev relies on it when doing
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/input/mouse/synaptics.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ struct synaptics_data {

struct serio *pt_port; /* Pass-through serio port */

struct synaptics_hw_state mt; /* current gesture packet */
/*
* Last received Advanced Gesture Mode (AGM) packet. An AGM packet
* contains position data for a second contact, at half resolution.
*/
struct synaptics_hw_state agm;
};

void synaptics_module_init(void);
Expand Down

0 comments on commit 30db656

Please sign in to comment.