dell_wmi: Use a C99-style array for bios_to_linux_keycode
It's currently hard to follow what maps to what, and it's hard to edit the array. Redo it as a C99-style array. I generated this using emacs regexes and a python one-liner. Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
Родитель
260e0eca80
Коммит
394cb778ca
|
@ -119,27 +119,46 @@ struct dell_bios_hotkey_table {
|
||||||
static const struct dell_bios_hotkey_table *dell_bios_hotkey_table;
|
static const struct dell_bios_hotkey_table *dell_bios_hotkey_table;
|
||||||
|
|
||||||
static const u16 bios_to_linux_keycode[256] __initconst = {
|
static const u16 bios_to_linux_keycode[256] __initconst = {
|
||||||
|
[0] = KEY_MEDIA,
|
||||||
KEY_MEDIA, KEY_NEXTSONG, KEY_PLAYPAUSE, KEY_PREVIOUSSONG,
|
[1] = KEY_NEXTSONG,
|
||||||
KEY_STOPCD, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
|
[2] = KEY_PLAYPAUSE,
|
||||||
KEY_WWW, KEY_UNKNOWN, KEY_VOLUMEDOWN, KEY_MUTE,
|
[3] = KEY_PREVIOUSSONG,
|
||||||
KEY_VOLUMEUP, KEY_UNKNOWN, KEY_BATTERY, KEY_EJECTCD,
|
[4] = KEY_STOPCD,
|
||||||
KEY_UNKNOWN, KEY_SLEEP, KEY_PROG1, KEY_BRIGHTNESSDOWN,
|
[5] = KEY_UNKNOWN,
|
||||||
KEY_BRIGHTNESSUP, KEY_UNKNOWN, KEY_KBDILLUMTOGGLE,
|
[6] = KEY_UNKNOWN,
|
||||||
KEY_UNKNOWN, KEY_SWITCHVIDEOMODE, KEY_UNKNOWN, KEY_UNKNOWN,
|
[7] = KEY_UNKNOWN,
|
||||||
KEY_SWITCHVIDEOMODE, KEY_UNKNOWN, KEY_UNKNOWN, KEY_PROG2,
|
[8] = KEY_WWW,
|
||||||
KEY_UNKNOWN, KEY_UNKNOWN, KEY_U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||||
|
[21] = KEY_UNKNOWN,
|
||||||
|
[22] = KEY_KBDILLUMTOGGLE,
|
||||||
|
[23] = KEY_UNKNOWN,
|
||||||
|
[24] = KEY_SWITCHVIDEOMODE,
|
||||||
|
[25] = KEY_UNKNOWN,
|
||||||
|
[26] = KEY_UNKNOWN,
|
||||||
|
[27] = KEY_SWITCHVIDEOMODE,
|
||||||
|
[28] = KEY_UNKNOWN,
|
||||||
|
[29] = KEY_UNKNOWN,
|
||||||
|
[30] = KEY_PROG2,
|
||||||
|
[31] = KEY_UNKNOWN,
|
||||||
|
[32] = KEY_UNKNOWN,
|
||||||
|
[33] = KEY_UNKNOWN,
|
||||||
|
[34] = KEY_UNKNOWN,
|
||||||
|
[35] = KEY_UNKNOWN,
|
||||||
|
[36] = KEY_UNKNOWN,
|
||||||
|
[37] = KEY_UNKNOWN,
|
||||||
|
[38] = KEY_MICMUTE,
|
||||||
|
[255] = KEY_PROG3,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct input_dev *dell_wmi_input_dev;
|
static struct input_dev *dell_wmi_input_dev;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче