/* The packets that are spewed tend to all have deltas between -2 and 2, and the cursor will move around without really going very far. It will tend to end up in the same location; if we tally up the changes over 100 packets, we end up w/ a final delta of close to 0. This happens pretty regularly when the touchpad is spewing, and is pretty hard to manually trigger (at least for  */
static void hgpk_spewing_hack(struct psmouse *psmouse, int l, int r, int x, int y)
/* The packets that are spewed tend to all have deltas between -2 and 2, and the cursor will move around without really going very far. It will tend to end up in the same location; if we tally up the changes over 100 packets, we end up w/ a final delta of close to 0. This happens pretty regularly when the touchpad is spewing, and is pretty hard to manually trigger (at least for  */
static void hgpk_spewing_hack(struct psmouse *psmouse, int l, int r, int x, int y)
{
	struct hgpk_data *priv = psmouse->private;
	if (l || r)
		return;
	priv->x_tally += x;
	priv->y_tally += y;
	if (++priv->count > 100) {
		if (abs(priv->x_tally) < 3 && abs(priv->y_tally) < 3) {
			hgpk_dbg(psmouse, "packet spew detected (%d,%d)\n",
				 priv->x_tally, priv->y_tally);
			psmouse_queue_work(psmouse, &priv->recalib_wq,
					   msecs_to_jiffies(spew_delay));
		}
		priv->count = 0;
		priv->x_tally = 0;
		priv->y_tally = 0;
	}
}