Input: psmouse - allow disabing certain protocol extensions
Allow ALPS, LOGIPS2PP, LIFEBOOK, TRACKPOINT and TOUCHKIT protocol extensions of psmouse to be disabled during compilation. This will allow users save some memory when they are sure that they will only use a certain type of mice. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:

committed by
Dmitry Torokhov

parent
cb9def4dff
commit
55e3d9224b
@@ -40,21 +40,10 @@
|
||||
#define YMIN_NOMINAL 1408
|
||||
#define YMAX_NOMINAL 4448
|
||||
|
||||
/*****************************************************************************
|
||||
* Synaptics communications functions
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Send a command to the synpatics touchpad by special commands
|
||||
*/
|
||||
static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, unsigned char *param)
|
||||
{
|
||||
if (psmouse_sliced_command(psmouse, c))
|
||||
return -1;
|
||||
if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
/*****************************************************************************
|
||||
* Stuff we need even when we do not want native Synaptics support
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Set the synaptics touchpad mode byte by special commands
|
||||
@@ -71,6 +60,54 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int synaptics_detect(struct psmouse *psmouse, int set_properties)
|
||||
{
|
||||
struct ps2dev *ps2dev = &psmouse->ps2dev;
|
||||
unsigned char param[4];
|
||||
|
||||
param[0] = 0;
|
||||
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO);
|
||||
|
||||
if (param[1] != 0x47)
|
||||
return -ENODEV;
|
||||
|
||||
if (set_properties) {
|
||||
psmouse->vendor = "Synaptics";
|
||||
psmouse->name = "TouchPad";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void synaptics_reset(struct psmouse *psmouse)
|
||||
{
|
||||
/* reset touchpad back to relative mode, gestures enabled */
|
||||
synaptics_mode_cmd(psmouse, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
|
||||
|
||||
/*****************************************************************************
|
||||
* Synaptics communications functions
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Send a command to the synpatics touchpad by special commands
|
||||
*/
|
||||
static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, unsigned char *param)
|
||||
{
|
||||
if (psmouse_sliced_command(psmouse, c))
|
||||
return -1;
|
||||
if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the model-id bytes from the touchpad
|
||||
* see also SYN_MODEL_* macros
|
||||
@@ -529,12 +566,6 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
|
||||
clear_bit(REL_Y, dev->relbit);
|
||||
}
|
||||
|
||||
void synaptics_reset(struct psmouse *psmouse)
|
||||
{
|
||||
/* reset touchpad back to relative mode, gestures enabled */
|
||||
synaptics_mode_cmd(psmouse, 0);
|
||||
}
|
||||
|
||||
static void synaptics_disconnect(struct psmouse *psmouse)
|
||||
{
|
||||
synaptics_reset(psmouse);
|
||||
@@ -569,30 +600,6 @@ static int synaptics_reconnect(struct psmouse *psmouse)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int synaptics_detect(struct psmouse *psmouse, int set_properties)
|
||||
{
|
||||
struct ps2dev *ps2dev = &psmouse->ps2dev;
|
||||
unsigned char param[4];
|
||||
|
||||
param[0] = 0;
|
||||
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
|
||||
ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO);
|
||||
|
||||
if (param[1] != 0x47)
|
||||
return -1;
|
||||
|
||||
if (set_properties) {
|
||||
psmouse->vendor = "Synaptics";
|
||||
psmouse->name = "TouchPad";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <linux/dmi.h>
|
||||
static struct dmi_system_id toshiba_dmi_table[] = {
|
||||
@@ -680,4 +687,12 @@ int synaptics_init(struct psmouse *psmouse)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#else /* CONFIG_MOUSE_PS2_SYNAPTICS */
|
||||
|
||||
int synaptics_init(struct psmouse *psmouse)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MOUSE_PS2_SYNAPTICS */
|
||||
|
||||
|
Reference in New Issue
Block a user