]> Pileus Git - ~andy/linux/blob - drivers/input/mouse/hgpk.h
Input: hgpk - support GlideSensor and PenTablet modes
[~andy/linux] / drivers / input / mouse / hgpk.h
1 /*
2  * OLPC HGPK (XO-1) touchpad PS/2 mouse driver
3  */
4
5 #ifndef _HGPK_H
6 #define _HGPK_H
7
8 #define HGPK_GS         0xff       /* The GlideSensor */
9 #define HGPK_PT         0xcf       /* The PenTablet */
10
11 enum hgpk_model_t {
12         HGPK_MODEL_PREA = 0x0a, /* pre-B1s */
13         HGPK_MODEL_A = 0x14,    /* found on B1s, PT disabled in hardware */
14         HGPK_MODEL_B = 0x28,    /* B2s, has capacitance issues */
15         HGPK_MODEL_C = 0x3c,
16         HGPK_MODEL_D = 0x50,    /* C1, mass production */
17 };
18
19 enum hgpk_mode {
20         HGPK_MODE_MOUSE,
21         HGPK_MODE_GLIDESENSOR,
22         HGPK_MODE_PENTABLET,
23         HGPK_MODE_INVALID
24 };
25
26 struct hgpk_data {
27         struct psmouse *psmouse;
28         enum hgpk_mode mode;
29         bool powered;
30         int count, x_tally, y_tally;    /* hardware workaround stuff */
31         unsigned long recalib_window;
32         struct delayed_work recalib_wq;
33         int abs_x, abs_y;
34 };
35
36 #define hgpk_dbg(psmouse, format, arg...)               \
37         dev_dbg(&(psmouse)->ps2dev.serio->dev, format, ## arg)
38 #define hgpk_err(psmouse, format, arg...)               \
39         dev_err(&(psmouse)->ps2dev.serio->dev, format, ## arg)
40 #define hgpk_info(psmouse, format, arg...)              \
41         dev_info(&(psmouse)->ps2dev.serio->dev, format, ## arg)
42 #define hgpk_warn(psmouse, format, arg...)              \
43         dev_warn(&(psmouse)->ps2dev.serio->dev, format, ## arg)
44 #define hgpk_notice(psmouse, format, arg...)            \
45         dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg)
46
47 #ifdef CONFIG_MOUSE_PS2_OLPC
48 void hgpk_module_init(void);
49 int hgpk_detect(struct psmouse *psmouse, bool set_properties);
50 int hgpk_init(struct psmouse *psmouse);
51 #else
52 static inline void hgpk_module_init(void)
53 {
54 }
55 static inline int hgpk_detect(struct psmouse *psmouse, bool set_properties)
56 {
57         return -ENODEV;
58 }
59 static inline int hgpk_init(struct psmouse *psmouse)
60 {
61         return -ENODEV;
62 }
63 #endif
64
65 #endif