/* * 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/* * Any position values from the hardware above the following limits are * treated as "wrapped around negative" values that have been truncated to * the 13-bit reporting range of the hardware. These are just reasonable * guesses and can be adjusted if hardware is found that operates outside * of these parameters. */#define X_MAX_POSITIVE (((1 << ABS_POS_BITS) + XMAX) / 2)#define Y_MAX_POSITIVE (((1 << ABS_POS_BITS) + YMAX) / 2)/* * Synaptics touchpads report the y coordinate from bottom to top, which is * opposite from what userspace expects. * This function is used to invert y before reporting. */staticintsynaptics_invert_y(inty){returnYMAX_NOMINAL+YMIN_NOMINAL-y;}/***************************************************************************** * Stuff we need even when we do not want native Synaptics support ****************************************************************************//* * Set the synaptics touchpad mode byte by special commands */staticint