diff options
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/lifebook.c | 45 | ||||
-rw-r--r-- | drivers/input/mouse/lifebook.h | 4 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 14 |
3 files changed, 41 insertions, 22 deletions
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index a5a1fb3f794b..1eb98e18c9e7 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -63,7 +63,7 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse, struct pt_re | |||
63 | return PSMOUSE_FULL_PACKET; | 63 | return PSMOUSE_FULL_PACKET; |
64 | } | 64 | } |
65 | 65 | ||
66 | static int lifebook_initialize(struct psmouse *psmouse) | 66 | static int lifebook_absolute_mode(struct psmouse *psmouse) |
67 | { | 67 | { |
68 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 68 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
69 | unsigned char param; | 69 | unsigned char param; |
@@ -87,27 +87,36 @@ static void lifebook_disconnect(struct psmouse *psmouse) | |||
87 | psmouse_reset(psmouse); | 87 | psmouse_reset(psmouse); |
88 | } | 88 | } |
89 | 89 | ||
90 | int lifebook_detect(struct psmouse *psmouse, unsigned int max_proto, | 90 | int lifebook_detect(struct psmouse *psmouse, int set_properties) |
91 | int set_properties) | ||
92 | { | 91 | { |
93 | if (!dmi_check_system(lifebook_dmi_table) && max_proto != PSMOUSE_LIFEBOOK) | 92 | if (!dmi_check_system(lifebook_dmi_table)) |
94 | return -1; | 93 | return -1; |
95 | 94 | ||
96 | if (set_properties) { | 95 | if (set_properties) { |
97 | psmouse->vendor = "Fujitsu Lifebook"; | 96 | psmouse->vendor = "Fujitsu"; |
98 | psmouse->name = "TouchScreen"; | 97 | psmouse->name = "Lifebook TouchScreen"; |
99 | psmouse->dev.evbit[0] = BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL); | ||
100 | psmouse->dev.keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); | ||
101 | psmouse->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); | ||
102 | psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y); | ||
103 | input_set_abs_params(&psmouse->dev, ABS_X, 0, 1024, 0, 0); | ||
104 | input_set_abs_params(&psmouse->dev, ABS_Y, 0, 1024, 0, 0); | ||
105 | |||
106 | psmouse->protocol_handler = lifebook_process_byte; | ||
107 | psmouse->disconnect = lifebook_disconnect; | ||
108 | psmouse->reconnect = lifebook_initialize; | ||
109 | psmouse->pktsize = 3; | ||
110 | } | 98 | } |
111 | 99 | ||
112 | return lifebook_initialize(psmouse); | 100 | return 0; |
113 | } | 101 | } |
102 | |||
103 | int lifebook_init(struct psmouse *psmouse) | ||
104 | { | ||
105 | if (lifebook_absolute_mode(psmouse)) | ||
106 | return -1; | ||
107 | |||
108 | psmouse->dev.evbit[0] = BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL); | ||
109 | psmouse->dev.keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); | ||
110 | psmouse->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); | ||
111 | psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y); | ||
112 | input_set_abs_params(&psmouse->dev, ABS_X, 0, 1024, 0, 0); | ||
113 | input_set_abs_params(&psmouse->dev, ABS_Y, 0, 1024, 0, 0); | ||
114 | |||
115 | psmouse->protocol_handler = lifebook_process_byte; | ||
116 | psmouse->disconnect = lifebook_disconnect; | ||
117 | psmouse->reconnect = lifebook_absolute_mode; | ||
118 | psmouse->pktsize = 3; | ||
119 | |||
120 | return 0; | ||
121 | } | ||
122 | |||
diff --git a/drivers/input/mouse/lifebook.h b/drivers/input/mouse/lifebook.h index 4a0033a2e5cf..be1c0943825d 100644 --- a/drivers/input/mouse/lifebook.h +++ b/drivers/input/mouse/lifebook.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #ifndef _LIFEBOOK_H | 11 | #ifndef _LIFEBOOK_H |
12 | #define _LIFEBOOK_H | 12 | #define _LIFEBOOK_H |
13 | 13 | ||
14 | int lifebook_detect(struct psmouse *psmouse, unsigned int max_proto, | 14 | int lifebook_detect(struct psmouse *psmouse, int set_properties); |
15 | int set_properties); | 15 | int lifebook_init(struct psmouse *psmouse); |
16 | 16 | ||
17 | #endif | 17 | #endif |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 4be21847c67d..0ecf1297b6a8 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -424,8 +424,18 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
424 | { | 424 | { |
425 | int synaptics_hardware = 0; | 425 | int synaptics_hardware = 0; |
426 | 426 | ||
427 | if (lifebook_detect(psmouse, max_proto, set_properties) == 0) | 427 | /* |
428 | return PSMOUSE_LIFEBOOK; | 428 | * We always check for lifebook because it does not disturb mouse |
429 | * (it only checks DMI information). | ||
430 | */ | ||
431 | if (lifebook_detect(psmouse, set_properties) == 0 || | ||
432 | max_proto == PSMOUSE_LIFEBOOK) { | ||
433 | |||
434 | if (max_proto > PSMOUSE_IMEX) { | ||
435 | if (!set_properties || lifebook_init(psmouse) == 0) | ||
436 | return PSMOUSE_LIFEBOOK; | ||
437 | } | ||
438 | } | ||
429 | 439 | ||
430 | /* | 440 | /* |
431 | * Try Kensington ThinkingMouse (we try first, because synaptics probe | 441 | * Try Kensington ThinkingMouse (we try first, because synaptics probe |