aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/lifebook.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/lifebook.c')
-rw-r--r--drivers/input/mouse/lifebook.c45
1 files changed, 27 insertions, 18 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
66static int lifebook_initialize(struct psmouse *psmouse) 66static 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
90int lifebook_detect(struct psmouse *psmouse, unsigned int max_proto, 90int 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
103int 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