diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-06-02 00:39:45 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-06-02 00:39:45 -0400 |
commit | f6d65610df3bd4e7138da03aec391224219df135 (patch) | |
tree | fc25795bd58a446505e1ea867938f5bcd46d0b2c /drivers/input/keyboard/atkbd.c | |
parent | 5a18c343a6bee4b38965f14a40ccb95306641f87 (diff) |
Input: atkbd - use ushort instead of uchar keymap
Since some of the keycodes defined in input.h have values greater
than 255 we should use unsigned shorts in keymaps.
Tested-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/atkbd.c')
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 4a95adc4cc78..56857d1e56d5 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -68,7 +68,7 @@ MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and | |||
68 | * are loadable via an userland utility. | 68 | * are loadable via an userland utility. |
69 | */ | 69 | */ |
70 | 70 | ||
71 | static unsigned char atkbd_set2_keycode[512] = { | 71 | static const unsigned short atkbd_set2_keycode[512] = { |
72 | 72 | ||
73 | #ifdef CONFIG_KEYBOARD_ATKBD_HP_KEYCODES | 73 | #ifdef CONFIG_KEYBOARD_ATKBD_HP_KEYCODES |
74 | 74 | ||
@@ -99,7 +99,7 @@ static unsigned char atkbd_set2_keycode[512] = { | |||
99 | #endif | 99 | #endif |
100 | }; | 100 | }; |
101 | 101 | ||
102 | static unsigned char atkbd_set3_keycode[512] = { | 102 | static const unsigned short atkbd_set3_keycode[512] = { |
103 | 103 | ||
104 | 0, 0, 0, 0, 0, 0, 0, 59, 1,138,128,129,130, 15, 41, 60, | 104 | 0, 0, 0, 0, 0, 0, 0, 59, 1,138,128,129,130, 15, 41, 60, |
105 | 131, 29, 42, 86, 58, 16, 2, 61,133, 56, 44, 31, 30, 17, 3, 62, | 105 | 131, 29, 42, 86, 58, 16, 2, 61,133, 56, 44, 31, 30, 17, 3, 62, |
@@ -115,7 +115,7 @@ static unsigned char atkbd_set3_keycode[512] = { | |||
115 | 148,149,147,140 | 115 | 148,149,147,140 |
116 | }; | 116 | }; |
117 | 117 | ||
118 | static unsigned char atkbd_unxlate_table[128] = { | 118 | static const unsigned short atkbd_unxlate_table[128] = { |
119 | 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, | 119 | 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, |
120 | 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27, | 120 | 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27, |
121 | 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42, | 121 | 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42, |
@@ -161,7 +161,7 @@ static unsigned char atkbd_unxlate_table[128] = { | |||
161 | #define ATKBD_SCR_LEFT 249 | 161 | #define ATKBD_SCR_LEFT 249 |
162 | #define ATKBD_SCR_RIGHT 248 | 162 | #define ATKBD_SCR_RIGHT 248 |
163 | 163 | ||
164 | #define ATKBD_SPECIAL 248 | 164 | #define ATKBD_SPECIAL ATKBD_SCR_RIGHT |
165 | 165 | ||
166 | #define ATKBD_LED_EVENT_BIT 0 | 166 | #define ATKBD_LED_EVENT_BIT 0 |
167 | #define ATKBD_REP_EVENT_BIT 1 | 167 | #define ATKBD_REP_EVENT_BIT 1 |
@@ -173,7 +173,7 @@ static unsigned char atkbd_unxlate_table[128] = { | |||
173 | #define ATKBD_XL_HANGEUL 0x10 | 173 | #define ATKBD_XL_HANGEUL 0x10 |
174 | #define ATKBD_XL_HANJA 0x20 | 174 | #define ATKBD_XL_HANJA 0x20 |
175 | 175 | ||
176 | static struct { | 176 | static const struct { |
177 | unsigned char keycode; | 177 | unsigned char keycode; |
178 | unsigned char set2; | 178 | unsigned char set2; |
179 | } atkbd_scroll_keys[] = { | 179 | } atkbd_scroll_keys[] = { |
@@ -200,7 +200,7 @@ struct atkbd { | |||
200 | char phys[32]; | 200 | char phys[32]; |
201 | 201 | ||
202 | unsigned short id; | 202 | unsigned short id; |
203 | unsigned char keycode[512]; | 203 | unsigned short keycode[512]; |
204 | DECLARE_BITMAP(force_release_mask, 512); | 204 | DECLARE_BITMAP(force_release_mask, 512); |
205 | unsigned char set; | 205 | unsigned char set; |
206 | unsigned char translated; | 206 | unsigned char translated; |
@@ -357,7 +357,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, | |||
357 | unsigned int code = data; | 357 | unsigned int code = data; |
358 | int scroll = 0, hscroll = 0, click = -1; | 358 | int scroll = 0, hscroll = 0, click = -1; |
359 | int value; | 359 | int value; |
360 | unsigned char keycode; | 360 | unsigned short keycode; |
361 | 361 | ||
362 | #ifdef ATKBD_DEBUG | 362 | #ifdef ATKBD_DEBUG |
363 | printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags); | 363 | printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags); |
@@ -959,16 +959,16 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd) | |||
959 | input_dev->evbit[0] |= BIT_MASK(EV_REL); | 959 | input_dev->evbit[0] |= BIT_MASK(EV_REL); |
960 | input_dev->relbit[0] = BIT_MASK(REL_WHEEL) | | 960 | input_dev->relbit[0] = BIT_MASK(REL_WHEEL) | |
961 | BIT_MASK(REL_HWHEEL); | 961 | BIT_MASK(REL_HWHEEL); |
962 | set_bit(BTN_MIDDLE, input_dev->keybit); | 962 | __set_bit(BTN_MIDDLE, input_dev->keybit); |
963 | } | 963 | } |
964 | 964 | ||
965 | input_dev->keycode = atkbd->keycode; | 965 | input_dev->keycode = atkbd->keycode; |
966 | input_dev->keycodesize = sizeof(unsigned char); | 966 | input_dev->keycodesize = sizeof(unsigned short); |
967 | input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode); | 967 | input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode); |
968 | 968 | ||
969 | for (i = 0; i < 512; i++) | 969 | for (i = 0; i < 512; i++) |
970 | if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL) | 970 | if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL) |
971 | set_bit(atkbd->keycode[i], input_dev->keybit); | 971 | __set_bit(atkbd->keycode[i], input_dev->keybit); |
972 | } | 972 | } |
973 | 973 | ||
974 | /* | 974 | /* |