Commit 55e3d922 authored by Andres Salomon's avatar Andres Salomon Committed by Dmitry Torokhov

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: default avatarAndres Salomon <dilinger@debian.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent cb9def4d
...@@ -37,6 +37,65 @@ config MOUSE_PS2 ...@@ -37,6 +37,65 @@ config MOUSE_PS2
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called psmouse. module will be called psmouse.
config MOUSE_PS2_ALPS
bool "ALPS PS/2 mouse protocol extension" if EMBEDDED
default y
depends on MOUSE_PS2
---help---
Say Y here if you have an ALPS PS/2 touchpad connected to
your system.
If unsure, say Y.
config MOUSE_PS2_LOGIPS2PP
bool "Logictech PS/2++ mouse protocol extension" if EMBEDDED
default y
depends on MOUSE_PS2
---help---
Say Y here if you have a Logictech PS/2++ mouse connected to
your system.
If unsure, say Y.
config MOUSE_PS2_SYNAPTICS
bool "Synaptics PS/2 mouse protocol extension" if EMBEDDED
default y
depends on MOUSE_PS2
---help---
Say Y here if you have a Synaptics PS/2 TouchPad connected to
your system.
If unsure, say Y.
config MOUSE_PS2_LIFEBOOK
bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED
default y
depends on MOUSE_PS2
---help---
Say Y here if you have a Fujitsu B-series Lifebook PS/2
TouchScreen connected to your system.
If unsure, say Y.
config MOUSE_PS2_TRACKPOINT
bool "IBM Trackpoint PS/2 mouse protocol extension" if EMBEDDED
default y
depends on MOUSE_PS2
---help---
Say Y here if you have an IBM Trackpoint PS/2 mouse connected
to your system.
If unsure, say Y.
config MOUSE_PS2_TOUCHKIT
bool "eGalax TouchKit PS/2 protocol extension"
depends on MOUSE_PS2
---help---
Say Y here if you have an eGalax TouchKit PS/2 touchscreen
connected to your system.
If unsure, say N.
config MOUSE_SERIAL config MOUSE_SERIAL
tristate "Serial mouse" tristate "Serial mouse"
select SERIO select SERIO
...@@ -118,7 +177,7 @@ config MOUSE_VSXXXAA ...@@ -118,7 +177,7 @@ config MOUSE_VSXXXAA
digitizer (VSXXX-AB) DEC produced. digitizer (VSXXX-AB) DEC produced.
config MOUSE_HIL config MOUSE_HIL
tristate "HIL pointers (mice etc)." tristate "HIL pointers (mice etc)."
depends on GSC || HP300 depends on GSC || HP300
select HP_SDC select HP_SDC
select HIL_MLC select HIL_MLC
......
...@@ -14,5 +14,10 @@ obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o ...@@ -14,5 +14,10 @@ obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o
obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o
psmouse-objs := psmouse-base.o alps.o logips2pp.o synaptics.o lifebook.o \ psmouse-objs := psmouse-base.o synaptics.o
trackpoint.o touchkit_ps2.o
psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o
psmouse-$(CONFIG_MOUSE_PS2_LOGIPS2PP) += logips2pp.o
psmouse-$(CONFIG_MOUSE_PS2_LIFEBOOK) += lifebook.o
psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o
psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
#ifndef _ALPS_H #ifndef _ALPS_H
#define _ALPS_H #define _ALPS_H
int alps_detect(struct psmouse *psmouse, int set_properties);
int alps_init(struct psmouse *psmouse);
struct alps_model_info { struct alps_model_info {
unsigned char signature[3]; unsigned char signature[3];
unsigned char byte0, mask0; unsigned char byte0, mask0;
...@@ -29,4 +26,18 @@ struct alps_data { ...@@ -29,4 +26,18 @@ struct alps_data {
int prev_fin; /* Finger bit from previous packet */ int prev_fin; /* Finger bit from previous packet */
}; };
#ifdef CONFIG_MOUSE_PS2_ALPS
int alps_detect(struct psmouse *psmouse, int set_properties);
int alps_init(struct psmouse *psmouse);
#else
inline int alps_detect(struct psmouse *psmouse, int set_properties)
{
return -ENOSYS;
}
inline int alps_init(struct psmouse *psmouse)
{
return -ENOSYS;
}
#endif /* CONFIG_MOUSE_PS2_ALPS */
#endif #endif
...@@ -11,7 +11,18 @@ ...@@ -11,7 +11,18 @@
#ifndef _LIFEBOOK_H #ifndef _LIFEBOOK_H
#define _LIFEBOOK_H #define _LIFEBOOK_H
#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
int lifebook_detect(struct psmouse *psmouse, int set_properties); int lifebook_detect(struct psmouse *psmouse, int set_properties);
int lifebook_init(struct psmouse *psmouse); int lifebook_init(struct psmouse *psmouse);
#else
inline int lifebook_detect(struct psmouse *psmouse, int set_properties)
{
return -ENOSYS;
}
inline int lifebook_init(struct psmouse *psmouse)
{
return -ENOSYS;
}
#endif
#endif #endif
...@@ -11,6 +11,13 @@ ...@@ -11,6 +11,13 @@
#ifndef _LOGIPS2PP_H #ifndef _LOGIPS2PP_H
#define _LOGIPS2PP_H #define _LOGIPS2PP_H
#ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
int ps2pp_init(struct psmouse *psmouse, int set_properties); int ps2pp_init(struct psmouse *psmouse, int set_properties);
#else
inline int ps2pp_init(struct psmouse *psmouse, int set_properties)
{
return -ENOSYS;
}
#endif /* CONFIG_MOUSE_PS2_LOGIPS2PP */
#endif #endif
...@@ -570,7 +570,9 @@ static int psmouse_extensions(struct psmouse *psmouse, ...@@ -570,7 +570,9 @@ static int psmouse_extensions(struct psmouse *psmouse,
return PSMOUSE_THINKPS; return PSMOUSE_THINKPS;
/* /*
* Try Synaptics TouchPad * Try Synaptics TouchPad. Note that probing is done even if Synaptics protocol
* support is disabled in config - we need to know if it is synaptics so we
* can reset it properly after probing for intellimouse.
*/ */
if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse, set_properties) == 0) { if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse, set_properties) == 0) {
synaptics_hardware = 1; synaptics_hardware = 1;
...@@ -661,12 +663,14 @@ static const struct psmouse_protocol psmouse_protocols[] = { ...@@ -661,12 +663,14 @@ static const struct psmouse_protocol psmouse_protocols[] = {
.maxproto = 1, .maxproto = 1,
.detect = ps2bare_detect, .detect = ps2bare_detect,
}, },
#ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
{ {
.type = PSMOUSE_PS2PP, .type = PSMOUSE_PS2PP,
.name = "PS2++", .name = "PS2++",
.alias = "logitech", .alias = "logitech",
.detect = ps2pp_init, .detect = ps2pp_init,
}, },
#endif
{ {
.type = PSMOUSE_THINKPS, .type = PSMOUSE_THINKPS,
.name = "ThinkPS/2", .name = "ThinkPS/2",
...@@ -693,6 +697,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { ...@@ -693,6 +697,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
.maxproto = 1, .maxproto = 1,
.detect = im_explorer_detect, .detect = im_explorer_detect,
}, },
#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
{ {
.type = PSMOUSE_SYNAPTICS, .type = PSMOUSE_SYNAPTICS,
.name = "SynPS/2", .name = "SynPS/2",
...@@ -700,6 +705,8 @@ static const struct psmouse_protocol psmouse_protocols[] = { ...@@ -700,6 +705,8 @@ static const struct psmouse_protocol psmouse_protocols[] = {
.detect = synaptics_detect, .detect = synaptics_detect,
.init = synaptics_init, .init = synaptics_init,
}, },
#endif
#ifdef CONFIG_MOUSE_PS2_ALPS
{ {
.type = PSMOUSE_ALPS, .type = PSMOUSE_ALPS,
.name = "AlpsPS/2", .name = "AlpsPS/2",
...@@ -707,24 +714,31 @@ static const struct psmouse_protocol psmouse_protocols[] = { ...@@ -707,24 +714,31 @@ static const struct psmouse_protocol psmouse_protocols[] = {
.detect = alps_detect, .detect = alps_detect,
.init = alps_init, .init = alps_init,
}, },
#endif
#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
{ {
.type = PSMOUSE_LIFEBOOK, .type = PSMOUSE_LIFEBOOK,
.name = "LBPS/2", .name = "LBPS/2",
.alias = "lifebook", .alias = "lifebook",
.init = lifebook_init, .init = lifebook_init,
}, },
#endif
#ifdef CONFIG_MOUSE_PS2_TRACKPOINT
{ {
.type = PSMOUSE_TRACKPOINT, .type = PSMOUSE_TRACKPOINT,
.name = "TPPS/2", .name = "TPPS/2",
.alias = "trackpoint", .alias = "trackpoint",
.detect = trackpoint_detect, .detect = trackpoint_detect,
}, },
#endif
#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
{ {
.type = PSMOUSE_TOUCHKIT_PS2, .type = PSMOUSE_TOUCHKIT_PS2,
.name = "touchkitPS/2", .name = "touchkitPS/2",
.alias = "touchkit", .alias = "touchkit",
.detect = touchkit_ps2_detect, .detect = touchkit_ps2_detect,
}, },
#endif
{ {
.type = PSMOUSE_AUTO, .type = PSMOUSE_AUTO,
.name = "auto", .name = "auto",
......
...@@ -40,33 +40,70 @@ ...@@ -40,33 +40,70 @@
#define YMIN_NOMINAL 1408 #define YMIN_NOMINAL 1408
#define YMAX_NOMINAL 4448 #define YMAX_NOMINAL 4448
/***************************************************************************** /*****************************************************************************
* Synaptics communications functions * Stuff we need even when we do not want native Synaptics support
****************************************************************************/ ****************************************************************************/
/* /*
* Send a command to the synpatics touchpad by special commands * Set the synaptics touchpad mode byte by special commands
*/ */
static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, unsigned char *param) static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
{ {
if (psmouse_sliced_command(psmouse, c)) unsigned char param[1];
if (psmouse_sliced_command(psmouse, mode))
return -1; return -1;
if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO)) param[0] = SYN_PS_SET_MODE2;
if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_SETRATE))
return -1; return -1;
return 0; 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
****************************************************************************/
/* /*
* Set the synaptics touchpad mode byte by special commands * Send a command to the synpatics touchpad by special commands
*/ */
static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode) static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, unsigned char *param)
{ {
unsigned char param[1]; if (psmouse_sliced_command(psmouse, c))
if (psmouse_sliced_command(psmouse, mode))
return -1; return -1;
param[0] = SYN_PS_SET_MODE2; if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO))
if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_SETRATE))
return -1; return -1;
return 0; return 0;
} }
...@@ -529,12 +566,6 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) ...@@ -529,12 +566,6 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
clear_bit(REL_Y, dev->relbit); 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) static void synaptics_disconnect(struct psmouse *psmouse)
{ {
synaptics_reset(psmouse); synaptics_reset(psmouse);
...@@ -569,30 +600,6 @@ static int synaptics_reconnect(struct psmouse *psmouse) ...@@ -569,30 +600,6 @@ static int synaptics_reconnect(struct psmouse *psmouse)
return 0; 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__) #if defined(__i386__)
#include <linux/dmi.h> #include <linux/dmi.h>
static struct dmi_system_id toshiba_dmi_table[] = { static struct dmi_system_id toshiba_dmi_table[] = {
...@@ -680,4 +687,12 @@ int synaptics_init(struct psmouse *psmouse) ...@@ -680,4 +687,12 @@ int synaptics_init(struct psmouse *psmouse)
return -1; return -1;
} }
#else /* CONFIG_MOUSE_PS2_SYNAPTICS */
int synaptics_init(struct psmouse *psmouse)
{
return -ENOSYS;
}
#endif /* CONFIG_MOUSE_PS2_SYNAPTICS */
...@@ -9,10 +9,6 @@ ...@@ -9,10 +9,6 @@
#ifndef _SYNAPTICS_H #ifndef _SYNAPTICS_H
#define _SYNAPTICS_H #define _SYNAPTICS_H
extern int synaptics_detect(struct psmouse *psmouse, int set_properties);
extern int synaptics_init(struct psmouse *psmouse);
extern void synaptics_reset(struct psmouse *psmouse);
/* synaptics queries */ /* synaptics queries */
#define SYN_QUE_IDENTIFY 0x00 #define SYN_QUE_IDENTIFY 0x00
#define SYN_QUE_MODES 0x01 #define SYN_QUE_MODES 0x01
...@@ -62,9 +58,9 @@ extern void synaptics_reset(struct psmouse *psmouse); ...@@ -62,9 +58,9 @@ extern void synaptics_reset(struct psmouse *psmouse);
#define SYN_MODE_WMODE(m) ((m) & (1 << 0)) #define SYN_MODE_WMODE(m) ((m) & (1 << 0))
/* synaptics identify query bits */ /* synaptics identify query bits */
#define SYN_ID_MODEL(i) (((i) >> 4) & 0x0f) #define SYN_ID_MODEL(i) (((i) >> 4) & 0x0f)
#define SYN_ID_MAJOR(i) ((i) & 0x0f) #define SYN_ID_MAJOR(i) ((i) & 0x0f)
#define SYN_ID_MINOR(i) (((i) >> 16) & 0xff) #define SYN_ID_MINOR(i) (((i) >> 16) & 0xff)
#define SYN_ID_IS_SYNAPTICS(i) ((((i) >> 8) & 0xff) == 0x47) #define SYN_ID_IS_SYNAPTICS(i) ((((i) >> 8) & 0xff) == 0x47)
/* synaptics special commands */ /* synaptics special commands */
...@@ -98,8 +94,8 @@ struct synaptics_hw_state { ...@@ -98,8 +94,8 @@ struct synaptics_hw_state {
struct synaptics_data { struct synaptics_data {
/* Data read from the touchpad */ /* Data read from the touchpad */
unsigned long int model_id; /* Model-ID */ unsigned long int model_id; /* Model-ID */
unsigned long int capabilities; /* Capabilities */ unsigned long int capabilities; /* Capabilities */
unsigned long int ext_cap; /* Extended Capabilities */ unsigned long int ext_cap; /* Extended Capabilities */
unsigned long int identity; /* Identification */ unsigned long int identity; /* Identification */
unsigned char pkt_type; /* packet type - old, new, etc */ unsigned char pkt_type; /* packet type - old, new, etc */
...@@ -107,4 +103,8 @@ struct synaptics_data { ...@@ -107,4 +103,8 @@ struct synaptics_data {
int scroll; int scroll;
}; };
int synaptics_detect(struct psmouse *psmouse, int set_properties);
int synaptics_init(struct psmouse *psmouse);
void synaptics_reset(struct psmouse *psmouse);
#endif /* _SYNAPTICS_H */ #endif /* _SYNAPTICS_H */
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
#ifndef _TOUCHKIT_PS2_H #ifndef _TOUCHKIT_PS2_H
#define _TOUCHKIT_PS2_H #define _TOUCHKIT_PS2_H
#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties); int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties);
#else
inline int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties)
{
return -ENOSYS;
}
#endif /* CONFIG_MOUSE_PS2_TOUCHKIT */
#endif #endif
...@@ -142,6 +142,13 @@ struct trackpoint_data ...@@ -142,6 +142,13 @@ struct trackpoint_data
unsigned char ext_dev; unsigned char ext_dev;
}; };
extern int trackpoint_detect(struct psmouse *psmouse, int set_properties); #ifdef CONFIG_MOUSE_PS2_TRACKPOINT
int trackpoint_detect(struct psmouse *psmouse, int set_properties);
#else
inline int trackpoint_detect(struct psmouse *psmouse, int set_properties)
{
return -ENOSYS;
}
#endif /* CONFIG_MOUSE_PS2_TRACKPOINT */
#endif /* _TRACKPOINT_H */ #endif /* _TRACKPOINT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment