Skip to content

Commit

Permalink
Input: atkbd - release previously reserved keycodes 248 - 254
Browse files Browse the repository at this point in the history
Keycodes in 248 - 254 range were reserved for special needs (scrolling)
of atkbd driver. Now that the driver has been switched to use unsigned
short keycodes instead of unsigned char we can release this range back
into pull. We keep code 255 (ATKBD_KEY_NULL) reserved since users may
have been using it to silence keys they do not care about since atkbd
silently drops scancodes mapped to this keycode.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Torokhov committed Feb 26, 2010
1 parent 492d4f2 commit 4b70858
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ static const unsigned short atkbd_unxlate_table[128] = {
#define ATKBD_RET_HANGEUL 0xf2
#define ATKBD_RET_ERR 0xff

#define ATKBD_KEY_UNKNOWN 0
#define ATKBD_KEY_UNKNOWN 0
#define ATKBD_KEY_NULL 255

#define ATKBD_SCR_1 254
#define ATKBD_SCR_2 253
#define ATKBD_SCR_4 252
#define ATKBD_SCR_8 251
#define ATKBD_SCR_CLICK 250
#define ATKBD_SCR_LEFT 249
#define ATKBD_SCR_RIGHT 248
#define ATKBD_SCR_1 0xfffe
#define ATKBD_SCR_2 0xfffd
#define ATKBD_SCR_4 0xfffc
#define ATKBD_SCR_8 0xfffb
#define ATKBD_SCR_CLICK 0xfffa
#define ATKBD_SCR_LEFT 0xfff9
#define ATKBD_SCR_RIGHT 0xfff8

#define ATKBD_SPECIAL ATKBD_SCR_RIGHT

Expand All @@ -177,7 +177,7 @@ static const unsigned short atkbd_unxlate_table[128] = {
#define ATKBD_XL_HANJA 0x20

static const struct {
unsigned char keycode;
unsigned short keycode;
unsigned char set2;
} atkbd_scroll_keys[] = {
{ ATKBD_SCR_1, 0xc5 },
Expand Down Expand Up @@ -1074,9 +1074,13 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
input_dev->keycodesize = sizeof(unsigned short);
input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode);

for (i = 0; i < ATKBD_KEYMAP_SIZE; i++)
if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL)
for (i = 0; i < ATKBD_KEYMAP_SIZE; i++) {
if (atkbd->keycode[i] != KEY_RESERVED &&
atkbd->keycode[i] != ATKBD_KEY_NULL &&
atkbd->keycode[i] < ATKBD_SPECIAL) {
__set_bit(atkbd->keycode[i], input_dev->keybit);
}
}
}

/*
Expand Down
2 changes: 1 addition & 1 deletion include/linux/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ struct input_absinfo {

#define KEY_WIMAX 246

/* Range 248 - 255 is reserved for special needs of AT keyboard driver */
/* Code 255 is reserved for special needs of AT keyboard driver */

#define BTN_MISC 0x100
#define BTN_0 0x100
Expand Down

0 comments on commit 4b70858

Please sign in to comment.