diff options
author | Stephen Evanchik <evanchsa@gmail.com> | 2005-08-08 02:26:18 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-08-08 02:26:18 -0400 |
commit | 541e316aed6f7d6efeb427a88645c2a8f61418d6 (patch) | |
tree | 2283bae66058470f24f47240e342a032d939ff89 /drivers/input/mouse/trackpoint.h | |
parent | 6fc32179de9e14c542e0b1760e412bc670611c53 (diff) |
Input: psmouse - add support for IBM TrackPoint devices.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/trackpoint.h')
-rw-r--r-- | drivers/input/mouse/trackpoint.h | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/drivers/input/mouse/trackpoint.h b/drivers/input/mouse/trackpoint.h new file mode 100644 index 000000000000..9857d8b6ad66 --- /dev/null +++ b/drivers/input/mouse/trackpoint.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* | ||
2 | * IBM TrackPoint PS/2 mouse driver | ||
3 | * | ||
4 | * Stephen Evanchik <evanchsa@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published by | ||
8 | * the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef _TRACKPOINT_H | ||
12 | #define _TRACKPOINT_H | ||
13 | |||
14 | /* | ||
15 | * These constants are from the TrackPoint System | ||
16 | * Engineering documentation Version 4 from IBM Watson | ||
17 | * research: | ||
18 | * http://wwwcssrv.almaden.ibm.com/trackpoint/download.html | ||
19 | */ | ||
20 | |||
21 | #define TP_COMMAND 0xE2 /* Commands start with this */ | ||
22 | |||
23 | #define TP_READ_ID 0xE1 /* Sent for device identification */ | ||
24 | #define TP_MAGIC_IDENT 0x01 /* Sent after a TP_READ_ID followed */ | ||
25 | /* by the firmware ID */ | ||
26 | |||
27 | |||
28 | /* | ||
29 | * Commands | ||
30 | */ | ||
31 | #define TP_RECALIB 0x51 /* Recalibrate */ | ||
32 | #define TP_POWER_DOWN 0x44 /* Can only be undone through HW reset */ | ||
33 | #define TP_EXT_DEV 0x21 /* Determines if external device is connected (RO) */ | ||
34 | #define TP_EXT_BTN 0x4B /* Read extended button status */ | ||
35 | #define TP_POR 0x7F /* Execute Power on Reset */ | ||
36 | #define TP_POR_RESULTS 0x25 /* Read Power on Self test results */ | ||
37 | #define TP_DISABLE_EXT 0x40 /* Disable external pointing device */ | ||
38 | #define TP_ENABLE_EXT 0x41 /* Enable external pointing device */ | ||
39 | |||
40 | /* | ||
41 | * Mode manipulation | ||
42 | */ | ||
43 | #define TP_SET_SOFT_TRANS 0x4E /* Set mode */ | ||
44 | #define TP_CANCEL_SOFT_TRANS 0xB9 /* Cancel mode */ | ||
45 | #define TP_SET_HARD_TRANS 0x45 /* Mode can only be set */ | ||
46 | |||
47 | |||
48 | /* | ||
49 | * Register oriented commands/properties | ||
50 | */ | ||
51 | #define TP_WRITE_MEM 0x81 | ||
52 | #define TP_READ_MEM 0x80 /* Not used in this implementation */ | ||
53 | |||
54 | /* | ||
55 | * RAM Locations for properties | ||
56 | */ | ||
57 | #define TP_SENS 0x4A /* Sensitivity */ | ||
58 | #define TP_MB 0x4C /* Read Middle Button Status (RO) */ | ||
59 | #define TP_INERTIA 0x4D /* Negative Inertia */ | ||
60 | #define TP_SPEED 0x60 /* Speed of TP Cursor */ | ||
61 | #define TP_REACH 0x57 /* Backup for Z-axis press */ | ||
62 | #define TP_DRAGHYS 0x58 /* Drag Hysteresis */ | ||
63 | /* (how hard it is to drag */ | ||
64 | /* with Z-axis pressed) */ | ||
65 | |||
66 | #define TP_MINDRAG 0x59 /* Minimum amount of force needed */ | ||
67 | /* to trigger dragging */ | ||
68 | |||
69 | #define TP_THRESH 0x5C /* Minimum value for a Z-axis press */ | ||
70 | #define TP_UP_THRESH 0x5A /* Used to generate a 'click' on Z-axis */ | ||
71 | #define TP_Z_TIME 0x5E /* How sharp of a press */ | ||
72 | #define TP_JENKS_CURV 0x5D /* Minimum curvature for double click */ | ||
73 | |||
74 | /* | ||
75 | * Toggling Flag bits | ||
76 | */ | ||
77 | #define TP_TOGGLE 0x47 /* Toggle command */ | ||
78 | |||
79 | #define TP_TOGGLE_MB 0x23 /* Disable/Enable Middle Button */ | ||
80 | #define TP_MASK_MB 0x01 | ||
81 | #define TP_TOGGLE_EXT_DEV 0x23 /* Toggle external device */ | ||
82 | #define TP_MASK_EXT_DEV 0x02 | ||
83 | #define TP_TOGGLE_DRIFT 0x23 /* Drift Correction */ | ||
84 | #define TP_MASK_DRIFT 0x80 | ||
85 | #define TP_TOGGLE_BURST 0x28 /* Burst Mode */ | ||
86 | #define TP_MASK_BURST 0x80 | ||
87 | #define TP_TOGGLE_PTSON 0x2C /* Press to Select */ | ||
88 | #define TP_MASK_PTSON 0x01 | ||
89 | #define TP_TOGGLE_HARD_TRANS 0x2C /* Alternate method to set Hard Transparency */ | ||
90 | #define TP_MASK_HARD_TRANS 0x80 | ||
91 | #define TP_TOGGLE_TWOHAND 0x2D /* Two handed */ | ||
92 | #define TP_MASK_TWOHAND 0x01 | ||
93 | #define TP_TOGGLE_STICKY_TWO 0x2D /* Sticky two handed */ | ||
94 | #define TP_MASK_STICKY_TWO 0x04 | ||
95 | #define TP_TOGGLE_SKIPBACK 0x2D /* Suppress movement after drag release */ | ||
96 | #define TP_MASK_SKIPBACK 0x08 | ||
97 | #define TP_TOGGLE_SOURCE_TAG 0x20 /* Bit 3 of the first packet will be set to | ||
98 | to the origin of the packet (external or TP) */ | ||
99 | #define TP_MASK_SOURCE_TAG 0x80 | ||
100 | #define TP_TOGGLE_EXT_TAG 0x22 /* Bit 3 of the first packet coming from the | ||
101 | external device will be forced to 1 */ | ||
102 | #define TP_MASK_EXT_TAG 0x04 | ||
103 | |||
104 | |||
105 | /* Power on Self Test Results */ | ||
106 | #define TP_POR_SUCCESS 0x3B | ||
107 | |||
108 | /* | ||
109 | * Default power on values | ||
110 | */ | ||
111 | #define TP_DEF_SENS 0x80 | ||
112 | #define TP_DEF_INERTIA 0x06 | ||
113 | #define TP_DEF_SPEED 0x61 | ||
114 | #define TP_DEF_REACH 0x0A | ||
115 | |||
116 | #define TP_DEF_DRAGHYS 0xFF | ||
117 | #define TP_DEF_MINDRAG 0x14 | ||
118 | |||
119 | #define TP_DEF_THRESH 0x08 | ||
120 | #define TP_DEF_UP_THRESH 0xFF | ||
121 | #define TP_DEF_Z_TIME 0x26 | ||
122 | #define TP_DEF_JENKS_CURV 0x87 | ||
123 | |||
124 | /* Toggles */ | ||
125 | #define TP_DEF_MB 0x00 | ||
126 | #define TP_DEF_PTSON 0x00 | ||
127 | #define TP_DEF_SKIPBACK 0x00 | ||
128 | #define TP_DEF_EXT_DEV 0x01 | ||
129 | |||
130 | #define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd)) | ||
131 | |||
132 | struct trackpoint_data | ||
133 | { | ||
134 | unsigned char sensitivity, speed, inertia, reach; | ||
135 | unsigned char draghys, mindrag; | ||
136 | unsigned char thresh, upthresh; | ||
137 | unsigned char ztime, jenks; | ||
138 | |||
139 | unsigned char press_to_select; | ||
140 | unsigned char skipback; | ||
141 | |||
142 | unsigned char ext_dev; | ||
143 | }; | ||
144 | |||
145 | extern int trackpoint_detect(struct psmouse *psmouse, int set_properties); | ||
146 | |||
147 | #endif /* _TRACKPOINT_H */ | ||