diff options
Diffstat (limited to 'drivers/input/mouse/lifebook.c')
-rw-r--r-- | drivers/input/mouse/lifebook.c | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 82811558ec33..2e6bdfea0165 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -25,11 +25,13 @@ struct lifebook_data { | |||
25 | char phys[32]; | 25 | char phys[32]; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | static bool lifebook_present; | ||
29 | |||
28 | static const char *desired_serio_phys; | 30 | static const char *desired_serio_phys; |
29 | 31 | ||
30 | static int lifebook_set_serio_phys(const struct dmi_system_id *d) | 32 | static int lifebook_limit_serio3(const struct dmi_system_id *d) |
31 | { | 33 | { |
32 | desired_serio_phys = d->driver_data; | 34 | desired_serio_phys = "isa0060/serio3"; |
33 | return 0; | 35 | return 0; |
34 | } | 36 | } |
35 | 37 | ||
@@ -41,53 +43,53 @@ static int lifebook_set_6byte_proto(const struct dmi_system_id *d) | |||
41 | return 0; | 43 | return 0; |
42 | } | 44 | } |
43 | 45 | ||
44 | static const struct dmi_system_id lifebook_dmi_table[] = { | 46 | static const struct dmi_system_id __initconst lifebook_dmi_table[] = { |
47 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
45 | { | 48 | { |
46 | .ident = "FLORA-ie 55mi", | 49 | /* FLORA-ie 55mi */ |
47 | .matches = { | 50 | .matches = { |
48 | DMI_MATCH(DMI_PRODUCT_NAME, "FLORA-ie 55mi"), | 51 | DMI_MATCH(DMI_PRODUCT_NAME, "FLORA-ie 55mi"), |
49 | }, | 52 | }, |
50 | }, | 53 | }, |
51 | { | 54 | { |
52 | .ident = "LifeBook B", | 55 | /* LifeBook B */ |
53 | .matches = { | 56 | .matches = { |
54 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), | 57 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), |
55 | }, | 58 | }, |
56 | }, | 59 | }, |
57 | { | 60 | { |
58 | .ident = "Lifebook B", | 61 | /* Lifebook B */ |
59 | .matches = { | 62 | .matches = { |
60 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), | 63 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), |
61 | }, | 64 | }, |
62 | }, | 65 | }, |
63 | { | 66 | { |
64 | .ident = "Lifebook B-2130", | 67 | /* Lifebook B-2130 */ |
65 | .matches = { | 68 | .matches = { |
66 | DMI_MATCH(DMI_BOARD_NAME, "ZEPHYR"), | 69 | DMI_MATCH(DMI_BOARD_NAME, "ZEPHYR"), |
67 | }, | 70 | }, |
68 | }, | 71 | }, |
69 | { | 72 | { |
70 | .ident = "Lifebook B213x/B2150", | 73 | /* Lifebook B213x/B2150 */ |
71 | .matches = { | 74 | .matches = { |
72 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), | 75 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), |
73 | }, | 76 | }, |
74 | }, | 77 | }, |
75 | { | 78 | { |
76 | .ident = "Zephyr", | 79 | /* Zephyr */ |
77 | .matches = { | 80 | .matches = { |
78 | DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), | 81 | DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), |
79 | }, | 82 | }, |
80 | }, | 83 | }, |
81 | { | 84 | { |
82 | .ident = "CF-18", | 85 | /* Panasonic CF-18 */ |
83 | .matches = { | 86 | .matches = { |
84 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), | 87 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), |
85 | }, | 88 | }, |
86 | .callback = lifebook_set_serio_phys, | 89 | .callback = lifebook_limit_serio3, |
87 | .driver_data = "isa0060/serio3", | ||
88 | }, | 90 | }, |
89 | { | 91 | { |
90 | .ident = "Panasonic CF-28", | 92 | /* Panasonic CF-28 */ |
91 | .matches = { | 93 | .matches = { |
92 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), | 94 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), |
93 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-28"), | 95 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-28"), |
@@ -95,7 +97,7 @@ static const struct dmi_system_id lifebook_dmi_table[] = { | |||
95 | .callback = lifebook_set_6byte_proto, | 97 | .callback = lifebook_set_6byte_proto, |
96 | }, | 98 | }, |
97 | { | 99 | { |
98 | .ident = "Panasonic CF-29", | 100 | /* Panasonic CF-29 */ |
99 | .matches = { | 101 | .matches = { |
100 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), | 102 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), |
101 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"), | 103 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"), |
@@ -103,21 +105,27 @@ static const struct dmi_system_id lifebook_dmi_table[] = { | |||
103 | .callback = lifebook_set_6byte_proto, | 105 | .callback = lifebook_set_6byte_proto, |
104 | }, | 106 | }, |
105 | { | 107 | { |
106 | .ident = "CF-72", | 108 | /* Panasonic CF-72 */ |
107 | .matches = { | 109 | .matches = { |
108 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-72"), | 110 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-72"), |
109 | }, | 111 | }, |
110 | .callback = lifebook_set_6byte_proto, | 112 | .callback = lifebook_set_6byte_proto, |
111 | }, | 113 | }, |
112 | { | 114 | { |
113 | .ident = "Lifebook B142", | 115 | /* Lifebook B142 */ |
114 | .matches = { | 116 | .matches = { |
115 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), | 117 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), |
116 | }, | 118 | }, |
117 | }, | 119 | }, |
118 | { } | 120 | { } |
121 | #endif | ||
119 | }; | 122 | }; |
120 | 123 | ||
124 | void __init lifebook_module_init(void) | ||
125 | { | ||
126 | lifebook_present = dmi_check_system(lifebook_dmi_table); | ||
127 | } | ||
128 | |||
121 | static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) | 129 | static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) |
122 | { | 130 | { |
123 | struct lifebook_data *priv = psmouse->private; | 131 | struct lifebook_data *priv = psmouse->private; |
@@ -198,10 +206,10 @@ static int lifebook_absolute_mode(struct psmouse *psmouse) | |||
198 | return -1; | 206 | return -1; |
199 | 207 | ||
200 | /* | 208 | /* |
201 | Enable absolute output -- ps2_command fails always but if | 209 | * Enable absolute output -- ps2_command fails always but if |
202 | you leave this call out the touchsreen will never send | 210 | * you leave this call out the touchsreen will never send |
203 | absolute coordinates | 211 | * absolute coordinates |
204 | */ | 212 | */ |
205 | param = lifebook_use_6byte_proto ? 0x08 : 0x07; | 213 | param = lifebook_use_6byte_proto ? 0x08 : 0x07; |
206 | ps2_command(ps2dev, ¶m, PSMOUSE_CMD_SETRES); | 214 | ps2_command(ps2dev, ¶m, PSMOUSE_CMD_SETRES); |
207 | 215 | ||
@@ -243,7 +251,7 @@ static void lifebook_disconnect(struct psmouse *psmouse) | |||
243 | 251 | ||
244 | int lifebook_detect(struct psmouse *psmouse, bool set_properties) | 252 | int lifebook_detect(struct psmouse *psmouse, bool set_properties) |
245 | { | 253 | { |
246 | if (!dmi_check_system(lifebook_dmi_table)) | 254 | if (!lifebook_present) |
247 | return -1; | 255 | return -1; |
248 | 256 | ||
249 | if (desired_serio_phys && | 257 | if (desired_serio_phys && |
@@ -283,8 +291,8 @@ static int lifebook_create_relative_device(struct psmouse *psmouse) | |||
283 | 291 | ||
284 | dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); | 292 | dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); |
285 | dev2->relbit[BIT_WORD(REL_X)] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); | 293 | dev2->relbit[BIT_WORD(REL_X)] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); |
286 | dev2->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | | 294 | dev2->keybit[BIT_WORD(BTN_LEFT)] = |
287 | BIT_MASK(BTN_RIGHT); | 295 | BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT); |
288 | 296 | ||
289 | error = input_register_device(priv->dev2); | 297 | error = input_register_device(priv->dev2); |
290 | if (error) | 298 | if (error) |
@@ -309,6 +317,7 @@ int lifebook_init(struct psmouse *psmouse) | |||
309 | 317 | ||
310 | dev1->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); | 318 | dev1->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); |
311 | dev1->relbit[0] = 0; | 319 | dev1->relbit[0] = 0; |
320 | dev1->keybit[BIT_WORD(BTN_MOUSE)] = 0; | ||
312 | dev1->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); | 321 | dev1->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); |
313 | input_set_abs_params(dev1, ABS_X, 0, max_coord, 0, 0); | 322 | input_set_abs_params(dev1, ABS_X, 0, max_coord, 0, 0); |
314 | input_set_abs_params(dev1, ABS_Y, 0, max_coord, 0, 0); | 323 | input_set_abs_params(dev1, ABS_Y, 0, max_coord, 0, 0); |