aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/lifebook.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c
index 1eb98e18c9e7..bd9df9b28325 100644
--- a/drivers/input/mouse/lifebook.c
+++ b/drivers/input/mouse/lifebook.c
@@ -82,6 +82,17 @@ static int lifebook_absolute_mode(struct psmouse *psmouse)
82 return 0; 82 return 0;
83} 83}
84 84
85static void lifebook_set_resolution(struct psmouse *psmouse, unsigned int resolution)
86{
87 unsigned char params[] = { 0, 1, 2, 2, 3 };
88
89 if (resolution == 0 || resolution > 400)
90 resolution = 400;
91
92 ps2_command(&psmouse->ps2dev, &params[resolution / 100], PSMOUSE_CMD_SETRES);
93 psmouse->resolution = 50 << params[resolution / 100];
94}
95
85static void lifebook_disconnect(struct psmouse *psmouse) 96static void lifebook_disconnect(struct psmouse *psmouse)
86{ 97{
87 psmouse_reset(psmouse); 98 psmouse_reset(psmouse);
@@ -113,6 +124,7 @@ int lifebook_init(struct psmouse *psmouse)
113 input_set_abs_params(&psmouse->dev, ABS_Y, 0, 1024, 0, 0); 124 input_set_abs_params(&psmouse->dev, ABS_Y, 0, 1024, 0, 0);
114 125
115 psmouse->protocol_handler = lifebook_process_byte; 126 psmouse->protocol_handler = lifebook_process_byte;
127 psmouse->set_resolution = lifebook_set_resolution;
116 psmouse->disconnect = lifebook_disconnect; 128 psmouse->disconnect = lifebook_disconnect;
117 psmouse->reconnect = lifebook_absolute_mode; 129 psmouse->reconnect = lifebook_absolute_mode;
118 psmouse->pktsize = 3; 130 psmouse->pktsize = 3;