diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/input/mouse/lifebook.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/input/mouse/lifebook.c')
-rw-r--r-- | drivers/input/mouse/lifebook.c | 60 |
1 files changed, 37 insertions, 23 deletions
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 82811558ec33..c31ad11df6bb 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/serio.h> | 16 | #include <linux/serio.h> |
17 | #include <linux/libps2.h> | 17 | #include <linux/libps2.h> |
18 | #include <linux/dmi.h> | 18 | #include <linux/dmi.h> |
19 | #include <linux/slab.h> | ||
19 | 20 | ||
20 | #include "psmouse.h" | 21 | #include "psmouse.h" |
21 | #include "lifebook.h" | 22 | #include "lifebook.h" |
@@ -25,11 +26,13 @@ struct lifebook_data { | |||
25 | char phys[32]; | 26 | char phys[32]; |
26 | }; | 27 | }; |
27 | 28 | ||
29 | static bool lifebook_present; | ||
30 | |||
28 | static const char *desired_serio_phys; | 31 | static const char *desired_serio_phys; |
29 | 32 | ||
30 | static int lifebook_set_serio_phys(const struct dmi_system_id *d) | 33 | static int lifebook_limit_serio3(const struct dmi_system_id *d) |
31 | { | 34 | { |
32 | desired_serio_phys = d->driver_data; | 35 | desired_serio_phys = "isa0060/serio3"; |
33 | return 0; | 36 | return 0; |
34 | } | 37 | } |
35 | 38 | ||
@@ -41,53 +44,58 @@ static int lifebook_set_6byte_proto(const struct dmi_system_id *d) | |||
41 | return 0; | 44 | return 0; |
42 | } | 45 | } |
43 | 46 | ||
44 | static const struct dmi_system_id lifebook_dmi_table[] = { | 47 | static const struct dmi_system_id __initconst lifebook_dmi_table[] = { |
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 */ |
56 | .matches = { | ||
57 | DMI_MATCH(DMI_PRODUCT_NAME, "Lifebook B Series"), | ||
58 | }, | ||
59 | }, | ||
60 | { | ||
61 | /* LifeBook B */ | ||
53 | .matches = { | 62 | .matches = { |
54 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), | 63 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), |
55 | }, | 64 | }, |
56 | }, | 65 | }, |
57 | { | 66 | { |
58 | .ident = "Lifebook B", | 67 | /* Lifebook B */ |
59 | .matches = { | 68 | .matches = { |
60 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), | 69 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), |
61 | }, | 70 | }, |
62 | }, | 71 | }, |
63 | { | 72 | { |
64 | .ident = "Lifebook B-2130", | 73 | /* Lifebook B-2130 */ |
65 | .matches = { | 74 | .matches = { |
66 | DMI_MATCH(DMI_BOARD_NAME, "ZEPHYR"), | 75 | DMI_MATCH(DMI_BOARD_NAME, "ZEPHYR"), |
67 | }, | 76 | }, |
68 | }, | 77 | }, |
69 | { | 78 | { |
70 | .ident = "Lifebook B213x/B2150", | 79 | /* Lifebook B213x/B2150 */ |
71 | .matches = { | 80 | .matches = { |
72 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), | 81 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), |
73 | }, | 82 | }, |
74 | }, | 83 | }, |
75 | { | 84 | { |
76 | .ident = "Zephyr", | 85 | /* Zephyr */ |
77 | .matches = { | 86 | .matches = { |
78 | DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), | 87 | DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), |
79 | }, | 88 | }, |
80 | }, | 89 | }, |
81 | { | 90 | { |
82 | .ident = "CF-18", | 91 | /* Panasonic CF-18 */ |
83 | .matches = { | 92 | .matches = { |
84 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), | 93 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), |
85 | }, | 94 | }, |
86 | .callback = lifebook_set_serio_phys, | 95 | .callback = lifebook_limit_serio3, |
87 | .driver_data = "isa0060/serio3", | ||
88 | }, | 96 | }, |
89 | { | 97 | { |
90 | .ident = "Panasonic CF-28", | 98 | /* Panasonic CF-28 */ |
91 | .matches = { | 99 | .matches = { |
92 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), | 100 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), |
93 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-28"), | 101 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-28"), |
@@ -95,7 +103,7 @@ static const struct dmi_system_id lifebook_dmi_table[] = { | |||
95 | .callback = lifebook_set_6byte_proto, | 103 | .callback = lifebook_set_6byte_proto, |
96 | }, | 104 | }, |
97 | { | 105 | { |
98 | .ident = "Panasonic CF-29", | 106 | /* Panasonic CF-29 */ |
99 | .matches = { | 107 | .matches = { |
100 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), | 108 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), |
101 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"), | 109 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"), |
@@ -103,14 +111,14 @@ static const struct dmi_system_id lifebook_dmi_table[] = { | |||
103 | .callback = lifebook_set_6byte_proto, | 111 | .callback = lifebook_set_6byte_proto, |
104 | }, | 112 | }, |
105 | { | 113 | { |
106 | .ident = "CF-72", | 114 | /* Panasonic CF-72 */ |
107 | .matches = { | 115 | .matches = { |
108 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-72"), | 116 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-72"), |
109 | }, | 117 | }, |
110 | .callback = lifebook_set_6byte_proto, | 118 | .callback = lifebook_set_6byte_proto, |
111 | }, | 119 | }, |
112 | { | 120 | { |
113 | .ident = "Lifebook B142", | 121 | /* Lifebook B142 */ |
114 | .matches = { | 122 | .matches = { |
115 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), | 123 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), |
116 | }, | 124 | }, |
@@ -118,6 +126,11 @@ static const struct dmi_system_id lifebook_dmi_table[] = { | |||
118 | { } | 126 | { } |
119 | }; | 127 | }; |
120 | 128 | ||
129 | void __init lifebook_module_init(void) | ||
130 | { | ||
131 | lifebook_present = dmi_check_system(lifebook_dmi_table); | ||
132 | } | ||
133 | |||
121 | static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) | 134 | static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) |
122 | { | 135 | { |
123 | struct lifebook_data *priv = psmouse->private; | 136 | struct lifebook_data *priv = psmouse->private; |
@@ -198,10 +211,10 @@ static int lifebook_absolute_mode(struct psmouse *psmouse) | |||
198 | return -1; | 211 | return -1; |
199 | 212 | ||
200 | /* | 213 | /* |
201 | Enable absolute output -- ps2_command fails always but if | 214 | * Enable absolute output -- ps2_command fails always but if |
202 | you leave this call out the touchsreen will never send | 215 | * you leave this call out the touchsreen will never send |
203 | absolute coordinates | 216 | * absolute coordinates |
204 | */ | 217 | */ |
205 | param = lifebook_use_6byte_proto ? 0x08 : 0x07; | 218 | param = lifebook_use_6byte_proto ? 0x08 : 0x07; |
206 | ps2_command(ps2dev, ¶m, PSMOUSE_CMD_SETRES); | 219 | ps2_command(ps2dev, ¶m, PSMOUSE_CMD_SETRES); |
207 | 220 | ||
@@ -243,7 +256,7 @@ static void lifebook_disconnect(struct psmouse *psmouse) | |||
243 | 256 | ||
244 | int lifebook_detect(struct psmouse *psmouse, bool set_properties) | 257 | int lifebook_detect(struct psmouse *psmouse, bool set_properties) |
245 | { | 258 | { |
246 | if (!dmi_check_system(lifebook_dmi_table)) | 259 | if (!lifebook_present) |
247 | return -1; | 260 | return -1; |
248 | 261 | ||
249 | if (desired_serio_phys && | 262 | if (desired_serio_phys && |
@@ -283,8 +296,8 @@ static int lifebook_create_relative_device(struct psmouse *psmouse) | |||
283 | 296 | ||
284 | dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); | 297 | 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); | 298 | 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) | | 299 | dev2->keybit[BIT_WORD(BTN_LEFT)] = |
287 | BIT_MASK(BTN_RIGHT); | 300 | BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT); |
288 | 301 | ||
289 | error = input_register_device(priv->dev2); | 302 | error = input_register_device(priv->dev2); |
290 | if (error) | 303 | if (error) |
@@ -309,6 +322,7 @@ int lifebook_init(struct psmouse *psmouse) | |||
309 | 322 | ||
310 | dev1->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); | 323 | dev1->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); |
311 | dev1->relbit[0] = 0; | 324 | dev1->relbit[0] = 0; |
325 | dev1->keybit[BIT_WORD(BTN_MOUSE)] = 0; | ||
312 | dev1->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); | 326 | dev1->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); |
313 | input_set_abs_params(dev1, ABS_X, 0, max_coord, 0, 0); | 327 | 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); | 328 | input_set_abs_params(dev1, ABS_Y, 0, max_coord, 0, 0); |