aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/hgpk.h
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2010-11-12 01:19:57 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-11-12 01:21:15 -0500
commitca94ec43540ce5d93fd30a3bf88321b6f11ed51a (patch)
treea371cc49adf0273e84040b1bf59e57c35a522c4c /drivers/input/mouse/hgpk.h
parent10ee2ded629b1571cef1182728d6f65dbe4c7f79 (diff)
Input: hgpk - support GlideSensor and PenTablet modes
Add a "hgpk_mode" sysfs attribute that allows selection between 3 options: Mouse (the existing option), GlideSensor and PenTablet. GlideSensor is an enhanced protocol for the regular touchpad mode that additionally reports pressure and uses absolute coordinates. We suspect that it may be more reliable than mouse mode in some environments. PenTablet mode puts the touchpad into resistive mode, you must then use a stylus as an input. We suspect this is the most reliable way to drive the touchpad. The GlideSensor and PenTablet devices expose themselves with the intention of being combined with the synaptics X11 input driver. Based on earlier work by Paul Fox. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/hgpk.h')
-rw-r--r--drivers/input/mouse/hgpk.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/input/mouse/hgpk.h b/drivers/input/mouse/hgpk.h
index d61cfd3ee9cb..01c983bb8465 100644
--- a/drivers/input/mouse/hgpk.h
+++ b/drivers/input/mouse/hgpk.h
@@ -5,6 +5,9 @@
5#ifndef _HGPK_H 5#ifndef _HGPK_H
6#define _HGPK_H 6#define _HGPK_H
7 7
8#define HGPK_GS 0xff /* The GlideSensor */
9#define HGPK_PT 0xcf /* The PenTablet */
10
8enum hgpk_model_t { 11enum hgpk_model_t {
9 HGPK_MODEL_PREA = 0x0a, /* pre-B1s */ 12 HGPK_MODEL_PREA = 0x0a, /* pre-B1s */
10 HGPK_MODEL_A = 0x14, /* found on B1s, PT disabled in hardware */ 13 HGPK_MODEL_A = 0x14, /* found on B1s, PT disabled in hardware */
@@ -13,12 +16,21 @@ enum hgpk_model_t {
13 HGPK_MODEL_D = 0x50, /* C1, mass production */ 16 HGPK_MODEL_D = 0x50, /* C1, mass production */
14}; 17};
15 18
19enum hgpk_mode {
20 HGPK_MODE_MOUSE,
21 HGPK_MODE_GLIDESENSOR,
22 HGPK_MODE_PENTABLET,
23 HGPK_MODE_INVALID
24};
25
16struct hgpk_data { 26struct hgpk_data {
17 struct psmouse *psmouse; 27 struct psmouse *psmouse;
28 enum hgpk_mode mode;
18 bool powered; 29 bool powered;
19 int count, x_tally, y_tally; /* hardware workaround stuff */ 30 int count, x_tally, y_tally; /* hardware workaround stuff */
20 unsigned long recalib_window; 31 unsigned long recalib_window;
21 struct delayed_work recalib_wq; 32 struct delayed_work recalib_wq;
33 int abs_x, abs_y;
22}; 34};
23 35
24#define hgpk_dbg(psmouse, format, arg...) \ 36#define hgpk_dbg(psmouse, format, arg...) \
@@ -33,9 +45,13 @@ struct hgpk_data {
33 dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg) 45 dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg)
34 46
35#ifdef CONFIG_MOUSE_PS2_OLPC 47#ifdef CONFIG_MOUSE_PS2_OLPC
48void hgpk_module_init(void);
36int hgpk_detect(struct psmouse *psmouse, bool set_properties); 49int hgpk_detect(struct psmouse *psmouse, bool set_properties);
37int hgpk_init(struct psmouse *psmouse); 50int hgpk_init(struct psmouse *psmouse);
38#else 51#else
52static inline void hgpk_module_init(void)
53{
54}
39static inline int hgpk_detect(struct psmouse *psmouse, bool set_properties) 55static inline int hgpk_detect(struct psmouse *psmouse, bool set_properties)
40{ 56{
41 return -ENODEV; 57 return -ENODEV;