/* * Synaptics TouchPad PS/2 mouse driver * * 2003 Dmitry Torokhov <dtor@mail.ru> * Added support for pass-through port. Special thanks to Peter Berg Larsen * for explaining various Synaptics quirks. * * 2003 Peter Osterlund <petero2@telia.com> * Ported to 2.5 input device infrastructure. * * Copyright (C) 2001 Stefan Gmeiner <riddlebox@freesurf.ch> * start merging tpconfig and gpm code to a xfree-input module * adding some changes and extensions (ex. 3rd and 4th button) * * Copyright (c) 1997 C. Scott Ananian <cananian@alumni.priceton.edu> * Copyright (c) 1998-2000 Bruce Kalk <kall@compass.com> * code for the special synaptics commands (from the tpconfig-source) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * Trademarks are the property of their respective owners. */#include<linux/module.h>#include<linux/delay.h>#include<linux/dmi.h>#include<linux/input/mt.h>#include<linux/serio.h>#include<linux/libps2.h>#include<linux/slab.h>#include"psmouse.h"#include"synaptics.h"/* * The x/y limits are taken from the Synaptics TouchPad interfacing Guide, * section 2.3.2, which says that they should be valid regardless of the * actual size of the sensor. * Note that newer firmware allows querying device for maximum useable * coordinates. */#define XMIN 0#define XMAX 6143#define YMIN 0#define YMAX 6143#define XMIN_NOMINAL 1472#define XMAX_NOMINAL 5472#define YMIN_NOMINAL 1408#define YMAX_NOMINAL 4448/* Size in bits of absolute position values reported by the hardware */#define ABS_POS_BITS 13/* * These values should represent the absolute maximum value that will * be reported for a positive position value. Some Synaptics firmware * uses this value to indicate a finger near the edge of the touchpad * whose precise position cannot be determined. * * At least one touchpad is known to report positions in excess of this * value which are actually negative values truncated to the 13-bit * reporting range. These values have never been observed to be lower * than 8184 (i.e. -8), so we treat all values greater than 8176 as * negative and any other value as positive. */#define X_MAX_POSITIVE 8176#define Y_MAX_POSITIVE 8176/* maximum ABS_MT_POSITION displacement (in mm) */#define DMAX 10/***************************************************************************** * Stuff we need even when we do not want native Synaptics support ****************************************************************************//* * Set the synaptics touchpad mode byte by special commands */staticintsynaptics_mode_cmd(struct