struct input_dev *dev = &psmouse->dev;
struct input_dev *dev = psmouse->dev;
static void synaptics_process_packet(struct psmouse *psmouse){	struct input_dev *dev = &psmouse->dev;	struct synaptics_data *priv = psmouse->private;	struct synaptics_hw_state hw;	int num_fingers;	int finger_width;	int i;	synaptics_parse_hw_state(psmouse->packet, priv, &hw);	if (hw.scroll) {		priv->scroll += hw.scroll;		while (priv->scroll >= 4) {			input_report_key(dev, BTN_BACK, !hw.down);			input_sync(dev);			input_report_key(dev, BTN_BACK, hw.down);			input_sync(dev);			priv->scroll -= 4;		}		while (priv->scroll <= -4) {			input_report_key(dev, BTN_FORWARD, !hw.up);			input_sync(dev);			input_report_key(dev, BTN_FORWARD, hw.up);			input_sync(dev);			priv->scroll += 4;		}		return;	}	if (hw.z > 0) {		num_fingers = 1;		finger_width = 5;		if (SYN_CAP_EXTENDED(priv->capabilities)) {			switch (hw.w) {			case 0 ... 1:				if (SYN_CAP_MULTIFINGER(priv->capabilities))					num_fingers = hw.w + 2;				break;			case 2:				if (SYN_MODEL_PEN(priv->model_id))					;   /* Nothing, treat a pen as a single finger */				break;			case 4 ... 15:				if (SYN_CAP_PALMDETECT(priv->capabilities))					finger_width = hw.w;				break;			}		}	} else {		num_fingers = 0;		finger_width = 0;	}	/* Post events	 * BTN_TOUCH has to be first as mousedev relies on it when doing	 * absolute -> relative conversion	 */	if (hw.z > 30) input_report_key(dev, BTN_TOUCH, 1);	if (hw.z < 25) input_report_key(dev, BTN_TOUCH, 0);	if (hw.z > 0) {		input_report_abs(dev, ABS_X, hw.x);		input_report_abs(dev, ABS_Y, YMAX_NOMINAL + YMIN_NOMINAL - hw.y);	}	input_report_abs(dev, ABS_PRESSURE, hw.z);	input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);	input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);	input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2);	input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3);	input_report_key(dev, BTN_LEFT, hw.left);	input_report_key(dev, BTN_RIGHT, hw.right);	if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))		input_report_key(dev, BTN_MIDDLE, hw.middle);	if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) {		input_report_key(dev, BTN_FORWARD, hw.up);		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));	input_sync(dev);}