aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/input.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-25 10:59:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-25 10:59:01 -0400
commit3a99c6319064af3f2e18eb929f638d555dbf7a62 (patch)
treee611927f41142123dc8efed7e07a3a91151edb01 /include/linux/input.h
parent1dfd166e93f98892aa4427069a23ed73259983c8 (diff)
parent49327ad2bbbaf1945d5ba431522201574219d150 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (75 commits) Input: wacom - specify Cinitq supported tools Input: ab8500-ponkey - fix IRQ freeing in error path Input: adp5588-keys - use more obvious i2c_device_id name string Input: ad7877 - switch to using threaded IRQ Input: ad7877 - use attribute group to control visibility of attributes Input: serio - add support for PS2Mult multiplexer protocol Input: wacom - properly enable runtime PM Input: ad7877 - filter events where pressure is beyond the maximum Input: ad7877 - implement EV_KEY:BTN_TOUCH reporting Input: ad7877 - implement specified chip select behavior Input: hp680_ts_input - use cancel_delayed_work_sync() Input: mousedev - correct lockdep annotation Input: ads7846 - switch to using threaded IRQ Input: serio - support multiple child devices per single parent Input: synaptics - simplify pass-through port handling Input: add ROHM BU21013 touch panel controller support Input: omap4-keypad - wake-up on events & long presses Input: omap4-keypad - fix interrupt line configuration Input: omap4-keypad - SYSCONFIG register configuration Input: omap4-keypad - use platform device helpers ...
Diffstat (limited to 'include/linux/input.h')
-rw-r--r--include/linux/input.h57
1 files changed, 45 insertions, 12 deletions
diff --git a/include/linux/input.h b/include/linux/input.h
index d6ae1761be97..51af441f3a21 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -34,7 +34,7 @@ struct input_event {
34 * Protocol version. 34 * Protocol version.
35 */ 35 */
36 36
37#define EV_VERSION 0x010000 37#define EV_VERSION 0x010001
38 38
39/* 39/*
40 * IOCTLs (0x00 - 0x7f) 40 * IOCTLs (0x00 - 0x7f)
@@ -56,25 +56,50 @@ struct input_absinfo {
56 __s32 resolution; 56 __s32 resolution;
57}; 57};
58 58
59/**
60 * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls
61 * @scancode: scancode represented in machine-endian form.
62 * @len: length of the scancode that resides in @scancode buffer.
63 * @index: index in the keymap, may be used instead of scancode
64 * @flags: allows to specify how kernel should handle the request. For
65 * example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel
66 * should perform lookup in keymap by @index instead of @scancode
67 * @keycode: key code assigned to this scancode
68 *
69 * The structure is used to retrieve and modify keymap data. Users have
70 * option of performing lookup either by @scancode itself or by @index
71 * in keymap entry. EVIOCGKEYCODE will also return scancode or index
72 * (depending on which element was used to perform lookup).
73 */
74struct input_keymap_entry {
75#define INPUT_KEYMAP_BY_INDEX (1 << 0)
76 __u8 flags;
77 __u8 len;
78 __u16 index;
79 __u32 keycode;
80 __u8 scancode[32];
81};
82
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 83#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 84#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
61#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ 85#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
62#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ 86#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
63#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ 87
64#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ 88#define EVIOCGKEYCODE _IOR('E', 0x04, struct input_keymap_entry) /* get keycode */
89#define EVIOCSKEYCODE _IOW('E', 0x04, struct input_keymap_entry) /* set keycode */
65 90
66#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ 91#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
67#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ 92#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
68#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ 93#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
69 94
70#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ 95#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */
71#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ 96#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
72#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ 97#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
73#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ 98#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
74 99
75#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ 100#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
76#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ 101#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
77#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ 102#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */
78 103
79#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ 104#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
80#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ 105#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
@@ -1088,13 +1113,13 @@ struct input_mt_slot {
1088 * @keycodemax: size of keycode table 1113 * @keycodemax: size of keycode table
1089 * @keycodesize: size of elements in keycode table 1114 * @keycodesize: size of elements in keycode table
1090 * @keycode: map of scancodes to keycodes for this device 1115 * @keycode: map of scancodes to keycodes for this device
1116 * @getkeycode: optional legacy method to retrieve current keymap.
1091 * @setkeycode: optional method to alter current keymap, used to implement 1117 * @setkeycode: optional method to alter current keymap, used to implement
1092 * sparse keymaps. If not supplied default mechanism will be used. 1118 * sparse keymaps. If not supplied default mechanism will be used.
1093 * The method is being called while holding event_lock and thus must 1119 * The method is being called while holding event_lock and thus must
1094 * not sleep 1120 * not sleep
1095 * @getkeycode: optional method to retrieve current keymap. If not supplied 1121 * @getkeycode_new: transition method
1096 * default mechanism will be used. The method is being called while 1122 * @setkeycode_new: transition method
1097 * holding event_lock and thus must not sleep
1098 * @ff: force feedback structure associated with the device if device 1123 * @ff: force feedback structure associated with the device if device
1099 * supports force feedback effects 1124 * supports force feedback effects
1100 * @repeat_key: stores key code of the last key pressed; used to implement 1125 * @repeat_key: stores key code of the last key pressed; used to implement
@@ -1168,10 +1193,16 @@ struct input_dev {
1168 unsigned int keycodemax; 1193 unsigned int keycodemax;
1169 unsigned int keycodesize; 1194 unsigned int keycodesize;
1170 void *keycode; 1195 void *keycode;
1196
1171 int (*setkeycode)(struct input_dev *dev, 1197 int (*setkeycode)(struct input_dev *dev,
1172 unsigned int scancode, unsigned int keycode); 1198 unsigned int scancode, unsigned int keycode);
1173 int (*getkeycode)(struct input_dev *dev, 1199 int (*getkeycode)(struct input_dev *dev,
1174 unsigned int scancode, unsigned int *keycode); 1200 unsigned int scancode, unsigned int *keycode);
1201 int (*setkeycode_new)(struct input_dev *dev,
1202 const struct input_keymap_entry *ke,
1203 unsigned int *old_keycode);
1204 int (*getkeycode_new)(struct input_dev *dev,
1205 struct input_keymap_entry *ke);
1175 1206
1176 struct ff_device *ff; 1207 struct ff_device *ff;
1177 1208
@@ -1478,10 +1509,12 @@ INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz)
1478INPUT_GENERATE_ABS_ACCESSORS(flat, flat) 1509INPUT_GENERATE_ABS_ACCESSORS(flat, flat)
1479INPUT_GENERATE_ABS_ACCESSORS(res, resolution) 1510INPUT_GENERATE_ABS_ACCESSORS(res, resolution)
1480 1511
1481int input_get_keycode(struct input_dev *dev, 1512int input_scancode_to_scalar(const struct input_keymap_entry *ke,
1482 unsigned int scancode, unsigned int *keycode); 1513 unsigned int *scancode);
1514
1515int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke);
1483int input_set_keycode(struct input_dev *dev, 1516int input_set_keycode(struct input_dev *dev,
1484 unsigned int scancode, unsigned int keycode); 1517 const struct input_keymap_entry *ke);
1485 1518
1486extern struct class input_class; 1519extern struct class input_class;
1487 1520