diff options
author | Andres Salomon <dilinger@queued.net> | 2008-09-16 12:30:34 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-09-21 18:28:58 -0400 |
commit | df08ef27a7f91961c91a2a718f5d1e616f1c8e57 (patch) | |
tree | 99d85254467e408cef43014d054f0ed97b476c67 /drivers/input/mouse/hgpk.h | |
parent | 68d482214bb0eaac138ace329e72390d6c8d44ff (diff) |
Input: psmouse - add OLPC touchpad driver
This adds support for OLPC's touchpad. It has lots of neat features,
none of which are enabled because the hardware is too buggy. Instead,
we use it like a normal touchpad, but with a number of workarounds in
place to deal with the frequent hardware spasms. Humidity changes,
sweat, tinfoil underwear, plugging in AC, drinks, evil felines.. All
tend to cause the touchpad to freak out.
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/hgpk.h')
-rw-r--r-- | drivers/input/mouse/hgpk.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/input/mouse/hgpk.h b/drivers/input/mouse/hgpk.h new file mode 100644 index 000000000000..a4b2a96f5f54 --- /dev/null +++ b/drivers/input/mouse/hgpk.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * OLPC HGPK (XO-1) touchpad PS/2 mouse driver | ||
3 | */ | ||
4 | |||
5 | #ifndef _HGPK_H | ||
6 | #define _HGPK_H | ||
7 | |||
8 | enum hgpk_model_t { | ||
9 | HGPK_MODEL_PREA = 0x0a, /* pre-B1s */ | ||
10 | HGPK_MODEL_A = 0x14, /* found on B1s, PT disabled in hardware */ | ||
11 | HGPK_MODEL_B = 0x28, /* B2s, has capacitance issues */ | ||
12 | HGPK_MODEL_C = 0x3c, | ||
13 | HGPK_MODEL_D = 0x50, /* C1, mass production */ | ||
14 | }; | ||
15 | |||
16 | struct hgpk_data { | ||
17 | struct psmouse *psmouse; | ||
18 | int powered; | ||
19 | int count, x_tally, y_tally; /* hardware workaround stuff */ | ||
20 | unsigned long recalib_window; | ||
21 | struct delayed_work recalib_wq; | ||
22 | }; | ||
23 | |||
24 | #define hgpk_dbg(psmouse, format, arg...) \ | ||
25 | dev_dbg(&(psmouse)->ps2dev.serio->dev, format, ## arg) | ||
26 | #define hgpk_err(psmouse, format, arg...) \ | ||
27 | dev_err(&(psmouse)->ps2dev.serio->dev, format, ## arg) | ||
28 | #define hgpk_info(psmouse, format, arg...) \ | ||
29 | dev_info(&(psmouse)->ps2dev.serio->dev, format, ## arg) | ||
30 | #define hgpk_warn(psmouse, format, arg...) \ | ||
31 | dev_warn(&(psmouse)->ps2dev.serio->dev, format, ## arg) | ||
32 | #define hgpk_notice(psmouse, format, arg...) \ | ||
33 | dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg) | ||
34 | |||
35 | #ifdef CONFIG_MOUSE_PS2_OLPC | ||
36 | int hgpk_detect(struct psmouse *psmouse, int set_properties); | ||
37 | int hgpk_init(struct psmouse *psmouse); | ||
38 | #else | ||
39 | static inline int hgpk_detect(struct psmouse *psmouse, int set_properties) | ||
40 | { | ||
41 | return -ENODEV; | ||
42 | } | ||
43 | static inline int hgpk_init(struct psmouse *psmouse) | ||
44 | { | ||
45 | return -ENODEV; | ||
46 | } | ||
47 | #endif | ||
48 | |||
49 | #endif | ||