summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/olpc.h
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@debian.org>2008-07-06 03:26:01 -0400
committerAndres Salomon <dilinger@debian.org>2008-07-06 20:46:05 -0400
commit4def8439648ce8090b526c29aa2ab3a37b221b13 (patch)
tree5cce4beae132939349685582d4201efe78519620 /drivers/input/mouse/olpc.h
parenta4933862c5862493ef4e9648c124655cc6e98b77 (diff)
downloadlwn-4def8439648ce8090b526c29aa2ab3a37b221b13.tar.gz
lwn-4def8439648ce8090b526c29aa2ab3a37b221b13.zip
psmouse: olpc: drop advanced/stream mode stuff, use mouse mode instead
This drops lots of complexity, and works around a great deal of hardware bugginess. With mouse mode, we have 3 byte packets, get them at a rate of 12mS, and they're sent only when there's activity on the touchpad. This makes deltas between packets _much_ smaller, making it much easier to detect hardware miscalibration (100px deltas are a sign of miscalibration; previously, due to the 24mS+ time between packets, we couldn't guarantee that the delta wasn't intentional). We also drop the PT/GS switching stuff; sorry, but PT mode is no longer supported. Signed-off-by: Andres Salomon <dilinger@debian.org>
Diffstat (limited to 'drivers/input/mouse/olpc.h')
-rw-r--r--drivers/input/mouse/olpc.h34
1 files changed, 7 insertions, 27 deletions
diff --git a/drivers/input/mouse/olpc.h b/drivers/input/mouse/olpc.h
index 777616d61f57..c2d161b6d03d 100644
--- a/drivers/input/mouse/olpc.h
+++ b/drivers/input/mouse/olpc.h
@@ -16,37 +16,17 @@
#define _OLPC_H
enum hgpk_model_t {
- HGPK_MODEL_PreA = 0x0a, /* pre-B1s */
- HGPK_MODEL_A = 0x14, /* found on B1s, PT disabled in hardware */
+ HGPK_MODEL_PREA = 0x0a, /* pre-B1s */
+ HGPK_MODEL_A = 0x14, /* found on B1s, PT disabled in hardware */
HGPK_MODEL_B = 0x28, /* B2s, has capacitance issues */
HGPK_MODEL_C = 0x3c,
- HGPK_MODEL_D = 0x50, /* C1, mass production */
-};
-
-#define HGPK_GS 0xff /* The GlideSensor */
-#define HGPK_PT 0xcf /* The PenTablet */
-
-struct hgpk_packet {
- struct input_dev *dev;
- int x, y, z;
- unsigned char mode_switch;
- unsigned int pt_down:1, gs_down:1;
- unsigned int left:1, right:1;
+ HGPK_MODEL_D = 0x50, /* C1, mass production */
};
struct hgpk_data {
- struct input_dev *gs; /* GlideSensor */
struct psmouse *psmouse;
- char name[32]; /* Name */
- char phys[32]; /* Phys */
- int pending_mode;
- int current_mode;
- s64 late;
- int axis_errors;
- int repeat_pkts;
int powered;
unsigned long recalib_window;
- struct delayed_work switch_wq;
struct delayed_work recalib_wq;
};
@@ -65,13 +45,13 @@ struct hgpk_data {
int olpc_detect(struct psmouse *psmouse, int set_properties);
int olpc_init(struct psmouse *psmouse);
#else
-inline int olpc_detect(struct psmouse *psmouse, int set_properties)
+static inline int olpc_detect(struct psmouse *psmouse, int set_properties)
{
- return -ENOSYS;
+ return -ENODEV;
}
-inline int olpc_init(struct psmouse *psmouse)
+static inline int olpc_init(struct psmouse *psmouse)
{
- return -ENOSYS;
+ return -ENODEV;
}
#endif