aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-03-09 01:37:10 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-03-09 02:19:15 -0500
commit58b939959d228681208ba997595411fddc860849 (patch)
tree3bfa2df2c811e14698e066f093a6dd7d75f45672 /include
parentec62e1c8dd2f9b2a833b48d4a2f58f0c5e07384c (diff)
Input: scancode in get/set_keycodes should be unsigned
The HID layer has some scan codes of the form 0xffbc0000 for logitech devices which do not work if scancode is typed as signed int, so we need to switch to unsigned it instead. While at it keycode being signed does not make much sense either. Acked-by: Márton Németh <nm127@freemail.hu> Acked-by: Matthew Garrett <mjg@redhat.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include')
-rw-r--r--include/linux/input.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/input.h b/include/linux/input.h
index dc24effb6d0e..7ed2251b33f1 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -58,10 +58,10 @@ struct input_absinfo {
58 58
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
61#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ 61#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
62#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */ 62#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
63#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ 63#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */
64#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ 64#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */
65 65
66#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ 66#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 */ 67#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
@@ -1142,8 +1142,10 @@ struct input_dev {
1142 unsigned int keycodemax; 1142 unsigned int keycodemax;
1143 unsigned int keycodesize; 1143 unsigned int keycodesize;
1144 void *keycode; 1144 void *keycode;
1145 int (*setkeycode)(struct input_dev *dev, int scancode, int keycode); 1145 int (*setkeycode)(struct input_dev *dev,
1146 int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode); 1146 unsigned int scancode, unsigned int keycode);
1147 int (*getkeycode)(struct input_dev *dev,
1148 unsigned int scancode, unsigned int *keycode);
1147 1149
1148 struct ff_device *ff; 1150 struct ff_device *ff;
1149 1151
@@ -1415,8 +1417,10 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
1415 dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); 1417 dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
1416} 1418}
1417 1419
1418int input_get_keycode(struct input_dev *dev, int scancode, int *keycode); 1420int input_get_keycode(struct input_dev *dev,
1419int input_set_keycode(struct input_dev *dev, int scancode, int keycode); 1421 unsigned int scancode, unsigned int *keycode);
1422int input_set_keycode(struct input_dev *dev,
1423 unsigned int scancode, unsigned int keycode);
1420 1424
1421extern struct class input_class; 1425extern struct class input_class;
1422 1426