Input: psmouse - disable changing resolution/rate/scale for FocalTech
These PS/2 commands make some touchpads stop responding, so this commit adds some dummy functions to replace the generic implementation. Because scale changes were not encapsulated in a method of struct psmouse yet, this commit adds a method set_scale to psmouse. Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
679d83ea93
commit
4ec212f003
@ -386,6 +386,23 @@ static int focaltech_read_size(struct psmouse *psmouse)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void focaltech_set_resolution(struct psmouse *psmouse, unsigned int resolution)
|
||||
{
|
||||
/* not supported yet */
|
||||
}
|
||||
|
||||
static void focaltech_set_rate(struct psmouse *psmouse, unsigned int rate)
|
||||
{
|
||||
/* not supported yet */
|
||||
}
|
||||
|
||||
static void focaltech_set_scale(struct psmouse *psmouse,
|
||||
enum psmouse_scale scale)
|
||||
{
|
||||
/* not supported yet */
|
||||
}
|
||||
|
||||
int focaltech_init(struct psmouse *psmouse)
|
||||
{
|
||||
struct focaltech_data *priv;
|
||||
@ -420,6 +437,14 @@ int focaltech_init(struct psmouse *psmouse)
|
||||
psmouse->cleanup = focaltech_reset;
|
||||
/* resync is not supported yet */
|
||||
psmouse->resync_time = 0;
|
||||
/*
|
||||
* rate/resolution/scale changes are not supported yet, and
|
||||
* the generic implementations of these functions seem to
|
||||
* confuse some touchpads
|
||||
*/
|
||||
psmouse->set_resolution = focaltech_set_resolution;
|
||||
psmouse->set_rate = focaltech_set_rate;
|
||||
psmouse->set_scale = focaltech_set_scale;
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -453,6 +453,17 @@ static void psmouse_set_rate(struct psmouse *psmouse, unsigned int rate)
|
||||
psmouse->rate = r;
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we set the mouse scaling.
|
||||
*/
|
||||
|
||||
static void psmouse_set_scale(struct psmouse *psmouse, enum psmouse_scale scale)
|
||||
{
|
||||
ps2_command(&psmouse->ps2dev, NULL,
|
||||
scale == PSMOUSE_SCALE21 ? PSMOUSE_CMD_SETSCALE21 :
|
||||
PSMOUSE_CMD_SETSCALE11);
|
||||
}
|
||||
|
||||
/*
|
||||
* psmouse_poll() - default poll handler. Everyone except for ALPS uses it.
|
||||
*/
|
||||
@ -689,6 +700,7 @@ static void psmouse_apply_defaults(struct psmouse *psmouse)
|
||||
|
||||
psmouse->set_rate = psmouse_set_rate;
|
||||
psmouse->set_resolution = psmouse_set_resolution;
|
||||
psmouse->set_scale = psmouse_set_scale;
|
||||
psmouse->poll = psmouse_poll;
|
||||
psmouse->protocol_handler = psmouse_process_byte;
|
||||
psmouse->pktsize = 3;
|
||||
@ -1160,7 +1172,7 @@ static void psmouse_initialize(struct psmouse *psmouse)
|
||||
if (psmouse_max_proto != PSMOUSE_PS2) {
|
||||
psmouse->set_rate(psmouse, psmouse->rate);
|
||||
psmouse->set_resolution(psmouse, psmouse->resolution);
|
||||
ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
|
||||
psmouse->set_scale(psmouse, PSMOUSE_SCALE11);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,11 @@ typedef enum {
|
||||
PSMOUSE_FULL_PACKET
|
||||
} psmouse_ret_t;
|
||||
|
||||
enum psmouse_scale {
|
||||
PSMOUSE_SCALE11,
|
||||
PSMOUSE_SCALE21
|
||||
};
|
||||
|
||||
struct psmouse {
|
||||
void *private;
|
||||
struct input_dev *dev;
|
||||
@ -67,6 +72,7 @@ struct psmouse {
|
||||
psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse);
|
||||
void (*set_rate)(struct psmouse *psmouse, unsigned int rate);
|
||||
void (*set_resolution)(struct psmouse *psmouse, unsigned int resolution);
|
||||
void (*set_scale)(struct psmouse *psmouse, enum psmouse_scale scale);
|
||||
|
||||
int (*reconnect)(struct psmouse *psmouse);
|
||||
void (*disconnect)(struct psmouse *psmouse);
|
||||
|
Loading…
Reference in New Issue
Block a user