Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lk201: remove obsolete driver

Remove the old-fashioned lk201 driver under drivers/tc/ that used to be
used by the old dz.c and zs.c drivers, which is now orphan code referred to
from nowhere and does not build anymore. A modern replacement is available
as drivers/input/keyboard/lkkbd.c.

There are no plans to do anything about this piece of code and it does not
fit anywhere anymore, so it is not just a matter of maintenance or the lack
of. There are still some bits that might be added to the new lkkbd.c
driver based on the old code, and the embedded hardware documentation which
is otherwise quite hard to get hold of might be useful to keep too. Both
of these can be done separately though. RIP.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Maciej W. Rozycki and committed by
Linus Torvalds
44a2db43 debe6214

-1375
-1
Documentation/dontdiff
··· 121 121 lkc_defs.h 122 122 lex.c* 123 123 lex.*.c 124 - lk201-map.c 125 124 logo_*.c 126 125 logo_*_clut224.c 127 126 logo_*_mono.c
-1
arch/mips/Makefile
··· 279 279 cflags-$(CONFIG_MACH_DECSTATION)+= -Iinclude/asm-mips/mach-dec 280 280 libs-$(CONFIG_MACH_DECSTATION) += arch/mips/dec/prom/ 281 281 load-$(CONFIG_MACH_DECSTATION) += 0xffffffff80040000 282 - CLEAN_FILES += drivers/tc/lk201-map.c 283 282 284 283 # 285 284 # Wind River PPMC Board (4KC + GT64120)
-1
drivers/tc/.gitignore
··· 1 - lk201-map.c
-15
drivers/tc/Makefile
··· 5 5 # Object file lists. 6 6 7 7 obj-$(CONFIG_TC) += tc.o tc-driver.o 8 - obj-$(CONFIG_VT) += lk201.o lk201-map.o lk201-remap.o 9 - 10 - $(obj)/lk201-map.o: $(obj)/lk201-map.c 11 - 12 - # Uncomment if you're changing the keymap and have an appropriate 13 - # loadkeys version for the map. By default, we'll use the shipped 14 - # versions. 15 - # GENERATE_KEYMAP := 1 16 - 17 - ifdef GENERATE_KEYMAP 18 - 19 - $(obj)/lk201-map.c: $(obj)/%.c: $(src)/%.map 20 - loadkeys --mktable $< > $@ 21 - 22 - endif
-265
drivers/tc/lk201-map.c_shipped
··· 1 - 2 - /* Do not edit this file! It was automatically generated by */ 3 - /* loadkeys --mktable defkeymap.map > defkeymap.c */ 4 - 5 - #include <linux/types.h> 6 - #include <linux/keyboard.h> 7 - #include <linux/kd.h> 8 - 9 - u_short plain_map[NR_KEYS] = { 10 - 0xf200, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 11 - 0xf107, 0xf108, 0xf109, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf11b, 12 - 0xf11c, 0xf110, 0xf111, 0xf112, 0xf113, 0xf060, 0xf031, 0xf032, 13 - 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, 0xf039, 0xf030, 14 - 0xf02d, 0xf03d, 0xf07f, 0xf114, 0xf115, 0xf116, 0xf200, 0xf200, 15 - 0xf200, 0xf200, 0xf009, 0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 16 - 0xfb79, 0xfb75, 0xfb69, 0xfb6f, 0xfb70, 0xf05b, 0xf05d, 0xf201, 17 - 0xf117, 0xf118, 0xf119, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf702, 18 - 0xf207, 0xfb61, 0xfb73, 0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 19 - 0xfb6b, 0xfb6c, 0xf03b, 0xf027, 0xf05c, 0xf603, 0xf304, 0xf305, 20 - 0xf306, 0xf200, 0xf700, 0xf03e, 0xfb7a, 0xfb78, 0xfb63, 0xfb76, 21 - 0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf200, 0xf601, 22 - 0xf600, 0xf602, 0xf301, 0xf302, 0xf303, 0xf30e, 0xf200, 0xf703, 23 - 0xf020, 0xf200, 0xf200, 0xf300, 0xf310, 0xf200, 0xf200, 0xf200, 24 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 25 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 26 - }; 27 - 28 - static u_short shift_map[NR_KEYS] = { 29 - 0xf200, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 30 - 0xf107, 0xf108, 0xf109, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf203, 31 - 0xf11c, 0xf110, 0xf111, 0xf112, 0xf113, 0xf07e, 0xf021, 0xf040, 32 - 0xf023, 0xf024, 0xf025, 0xf05e, 0xf026, 0xf02a, 0xf028, 0xf029, 33 - 0xf05f, 0xf02b, 0xf07f, 0xf114, 0xf115, 0xf116, 0xf200, 0xf200, 34 - 0xf200, 0xf200, 0xf009, 0xfb51, 0xfb57, 0xfb45, 0xfb52, 0xfb54, 35 - 0xfb59, 0xfb55, 0xfb49, 0xfb4f, 0xfb50, 0xf07b, 0xf07d, 0xf201, 36 - 0xf117, 0xf20b, 0xf20a, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf702, 37 - 0xf207, 0xfb41, 0xfb53, 0xfb44, 0xfb46, 0xfb47, 0xfb48, 0xfb4a, 38 - 0xfb4b, 0xfb4c, 0xf03a, 0xf022, 0xf07c, 0xf603, 0xf304, 0xf305, 39 - 0xf306, 0xf200, 0xf700, 0xf03c, 0xfb5a, 0xfb58, 0xfb43, 0xfb56, 40 - 0xfb42, 0xfb4e, 0xfb4d, 0xf03c, 0xf03e, 0xf03f, 0xf200, 0xf601, 41 - 0xf600, 0xf602, 0xf301, 0xf302, 0xf303, 0xf30e, 0xf200, 0xf703, 42 - 0xf020, 0xf200, 0xf200, 0xf300, 0xf310, 0xf200, 0xf200, 0xf200, 43 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 44 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 45 - }; 46 - 47 - static u_short altgr_map[NR_KEYS] = { 48 - 0xf200, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 49 - 0xf107, 0xf108, 0xf109, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf202, 50 - 0xf11c, 0xf110, 0xf111, 0xf112, 0xf113, 0xf200, 0xf200, 0xf040, 51 - 0xf200, 0xf024, 0xf200, 0xf200, 0xf07b, 0xf05b, 0xf05d, 0xf07d, 52 - 0xf05c, 0xf200, 0xf200, 0xf114, 0xf115, 0xf116, 0xf200, 0xf200, 53 - 0xf200, 0xf200, 0xf200, 0xfb71, 0xfb77, 0xf918, 0xfb72, 0xfb74, 54 - 0xfb79, 0xfb75, 0xfb69, 0xfb6f, 0xfb70, 0xf200, 0xf07e, 0xf201, 55 - 0xf117, 0xf118, 0xf119, 0xf911, 0xf912, 0xf913, 0xf30b, 0xf702, 56 - 0xf207, 0xf914, 0xfb73, 0xf917, 0xf919, 0xfb67, 0xfb68, 0xfb6a, 57 - 0xfb6b, 0xfb6c, 0xf200, 0xf200, 0xf200, 0xf603, 0xf90e, 0xf90f, 58 - 0xf910, 0xf200, 0xf700, 0xf200, 0xfb7a, 0xfb78, 0xf916, 0xfb76, 59 - 0xf915, 0xfb6e, 0xfb6d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf601, 60 - 0xf600, 0xf602, 0xf90b, 0xf90c, 0xf90d, 0xf30e, 0xf200, 0xf703, 61 - 0xf200, 0xf200, 0xf200, 0xf90a, 0xf310, 0xf200, 0xf200, 0xf200, 62 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 63 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 64 - }; 65 - 66 - static u_short ctrl_map[NR_KEYS] = { 67 - 0xf200, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 68 - 0xf107, 0xf108, 0xf109, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf204, 69 - 0xf11c, 0xf110, 0xf111, 0xf112, 0xf113, 0xf81b, 0xf200, 0xf000, 70 - 0xf01b, 0xf01c, 0xf01d, 0xf01e, 0xf01f, 0xf07f, 0xf200, 0xf200, 71 - 0xf01f, 0xf200, 0xf008, 0xf114, 0xf115, 0xf116, 0xf200, 0xf200, 72 - 0xf200, 0xf200, 0xf200, 0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 73 - 0xf019, 0xf015, 0xf009, 0xf00f, 0xf010, 0xf01b, 0xf01d, 0xf201, 74 - 0xf117, 0xf118, 0xf119, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf702, 75 - 0xf207, 0xf001, 0xf013, 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 76 - 0xf00b, 0xf00c, 0xf200, 0xf007, 0xf01c, 0xf603, 0xf304, 0xf305, 77 - 0xf306, 0xf200, 0xf700, 0xf200, 0xf01a, 0xf018, 0xf003, 0xf016, 78 - 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf20e, 0xf07f, 0xf200, 0xf601, 79 - 0xf600, 0xf602, 0xf301, 0xf302, 0xf303, 0xf30e, 0xf200, 0xf703, 80 - 0xf000, 0xf200, 0xf200, 0xf300, 0xf310, 0xf200, 0xf200, 0xf200, 81 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 82 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 83 - }; 84 - 85 - static u_short shift_ctrl_map[NR_KEYS] = { 86 - 0xf200, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 87 - 0xf107, 0xf108, 0xf109, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf200, 88 - 0xf11c, 0xf110, 0xf111, 0xf112, 0xf113, 0xf200, 0xf200, 0xf000, 89 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 90 - 0xf01f, 0xf200, 0xf200, 0xf114, 0xf115, 0xf116, 0xf200, 0xf200, 91 - 0xf200, 0xf200, 0xf200, 0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 92 - 0xf019, 0xf015, 0xf009, 0xf00f, 0xf010, 0xf200, 0xf200, 0xf201, 93 - 0xf117, 0xf118, 0xf119, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf702, 94 - 0xf207, 0xf001, 0xf013, 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 95 - 0xf00b, 0xf00c, 0xf200, 0xf200, 0xf200, 0xf603, 0xf304, 0xf305, 96 - 0xf306, 0xf200, 0xf700, 0xf200, 0xf01a, 0xf018, 0xf003, 0xf016, 97 - 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf601, 98 - 0xf600, 0xf602, 0xf301, 0xf302, 0xf303, 0xf30e, 0xf200, 0xf703, 99 - 0xf200, 0xf200, 0xf200, 0xf300, 0xf310, 0xf200, 0xf200, 0xf200, 100 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 101 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 102 - }; 103 - 104 - static u_short alt_map[NR_KEYS] = { 105 - 0xf200, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, 0xf505, 0xf506, 106 - 0xf507, 0xf508, 0xf509, 0xf50a, 0xf50b, 0xf50c, 0xf50d, 0xf200, 107 - 0xf11c, 0xf510, 0xf511, 0xf512, 0xf513, 0xf01b, 0xf831, 0xf832, 108 - 0xf833, 0xf834, 0xf835, 0xf836, 0xf837, 0xf838, 0xf839, 0xf830, 109 - 0xf82d, 0xf83d, 0xf87f, 0xf114, 0xf115, 0xf116, 0xf200, 0xf200, 110 - 0xf200, 0xf200, 0xf809, 0xf871, 0xf877, 0xf865, 0xf872, 0xf874, 111 - 0xf879, 0xf875, 0xf869, 0xf86f, 0xf870, 0xf85b, 0xf85d, 0xf80d, 112 - 0xf117, 0xf118, 0xf119, 0xf907, 0xf908, 0xf909, 0xf30b, 0xf702, 113 - 0xf207, 0xf861, 0xf873, 0xf864, 0xf866, 0xf867, 0xf868, 0xf86a, 114 - 0xf86b, 0xf86c, 0xf83b, 0xf827, 0xf85c, 0xf603, 0xf904, 0xf905, 115 - 0xf906, 0xf200, 0xf700, 0xf200, 0xf87a, 0xf878, 0xf863, 0xf876, 116 - 0xf862, 0xf86e, 0xf86d, 0xf82c, 0xf82e, 0xf82f, 0xf200, 0xf210, 117 - 0xf600, 0xf211, 0xf901, 0xf902, 0xf903, 0xf30e, 0xf200, 0xf703, 118 - 0xf820, 0xf200, 0xf200, 0xf900, 0xf310, 0xf200, 0xf200, 0xf200, 119 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 120 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 121 - }; 122 - 123 - static u_short ctrl_alt_map[NR_KEYS] = { 124 - 0xf200, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, 0xf505, 0xf506, 125 - 0xf507, 0xf508, 0xf509, 0xf50a, 0xf50b, 0xf50c, 0xf50d, 0xf200, 126 - 0xf11c, 0xf510, 0xf511, 0xf512, 0xf513, 0xf200, 0xf200, 0xf200, 127 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 128 - 0xf200, 0xf200, 0xf200, 0xf114, 0xf115, 0xf20c, 0xf200, 0xf200, 129 - 0xf200, 0xf200, 0xf200, 0xf811, 0xf817, 0xf805, 0xf812, 0xf814, 130 - 0xf819, 0xf815, 0xf809, 0xf80f, 0xf810, 0xf200, 0xf200, 0xf201, 131 - 0xf117, 0xf118, 0xf119, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf702, 132 - 0xf207, 0xf801, 0xf813, 0xf804, 0xf806, 0xf807, 0xf808, 0xf80a, 133 - 0xf80b, 0xf80c, 0xf200, 0xf200, 0xf200, 0xf603, 0xf304, 0xf305, 134 - 0xf306, 0xf200, 0xf700, 0xf200, 0xf81a, 0xf818, 0xf803, 0xf816, 135 - 0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf601, 136 - 0xf600, 0xf602, 0xf301, 0xf302, 0xf303, 0xf30e, 0xf200, 0xf703, 137 - 0xf200, 0xf200, 0xf200, 0xf300, 0xf20c, 0xf200, 0xf200, 0xf200, 138 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 139 - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 140 - }; 141 - 142 - ushort *key_maps[MAX_NR_KEYMAPS] = { 143 - plain_map, shift_map, altgr_map, 0, 144 - ctrl_map, shift_ctrl_map, 0, 0, 145 - alt_map, 0, 0, 0, 146 - ctrl_alt_map, 0 147 - }; 148 - 149 - unsigned int keymap_count = 7; 150 - 151 - 152 - /* 153 - * Philosophy: most people do not define more strings, but they who do 154 - * often want quite a lot of string space. So, we statically allocate 155 - * the default and allocate dynamically in chunks of 512 bytes. 156 - */ 157 - 158 - char func_buf[] = { 159 - '\033', '[', '[', 'A', 0, 160 - '\033', '[', '[', 'B', 0, 161 - '\033', '[', '[', 'C', 0, 162 - '\033', '[', '[', 'D', 0, 163 - '\033', '[', '[', 'E', 0, 164 - '\033', '[', '1', '7', '~', 0, 165 - '\033', '[', '1', '8', '~', 0, 166 - '\033', '[', '1', '9', '~', 0, 167 - '\033', '[', '2', '0', '~', 0, 168 - '\033', '[', '2', '1', '~', 0, 169 - '\033', '[', '2', '3', '~', 0, 170 - '\033', '[', '2', '4', '~', 0, 171 - '\033', '[', '2', '5', '~', 0, 172 - '\033', '[', '2', '6', '~', 0, 173 - '\033', '[', '2', '8', '~', 0, 174 - '\033', '[', '2', '9', '~', 0, 175 - '\033', '[', '3', '1', '~', 0, 176 - '\033', '[', '3', '2', '~', 0, 177 - '\033', '[', '3', '3', '~', 0, 178 - '\033', '[', '3', '4', '~', 0, 179 - '\033', '[', '1', '~', 0, 180 - '\033', '[', '2', '~', 0, 181 - '\033', '[', '3', '~', 0, 182 - '\033', '[', '4', '~', 0, 183 - '\033', '[', '5', '~', 0, 184 - '\033', '[', '6', '~', 0, 185 - '\033', '[', 'M', 0, 186 - '\033', '[', 'P', 0, 187 - }; 188 - 189 - 190 - char *funcbufptr = func_buf; 191 - int funcbufsize = sizeof(func_buf); 192 - int funcbufleft = 0; /* space left */ 193 - 194 - char *func_table[MAX_NR_FUNC] = { 195 - func_buf + 0, 196 - func_buf + 5, 197 - func_buf + 10, 198 - func_buf + 15, 199 - func_buf + 20, 200 - func_buf + 25, 201 - func_buf + 31, 202 - func_buf + 37, 203 - func_buf + 43, 204 - func_buf + 49, 205 - func_buf + 55, 206 - func_buf + 61, 207 - func_buf + 67, 208 - func_buf + 73, 209 - func_buf + 79, 210 - func_buf + 85, 211 - func_buf + 91, 212 - func_buf + 97, 213 - func_buf + 103, 214 - func_buf + 109, 215 - func_buf + 115, 216 - func_buf + 120, 217 - func_buf + 125, 218 - func_buf + 130, 219 - func_buf + 135, 220 - func_buf + 140, 221 - func_buf + 145, 222 - 0, 223 - 0, 224 - func_buf + 149, 225 - 0, 226 - }; 227 - 228 - struct kbdiacruc accent_table[MAX_DIACR] = { 229 - {'`', 'A', '�'}, {'`', 'a', '�'}, 230 - {'\'', 'A', '�'}, {'\'', 'a', '�'}, 231 - {'^', 'A', '�'}, {'^', 'a', '�'}, 232 - {'~', 'A', '�'}, {'~', 'a', '�'}, 233 - {'"', 'A', '�'}, {'"', 'a', '�'}, 234 - {'O', 'A', '�'}, {'o', 'a', '�'}, 235 - {'0', 'A', '�'}, {'0', 'a', '�'}, 236 - {'A', 'A', '�'}, {'a', 'a', '�'}, 237 - {'A', 'E', '�'}, {'a', 'e', '�'}, 238 - {',', 'C', '�'}, {',', 'c', '�'}, 239 - {'`', 'E', '�'}, {'`', 'e', '�'}, 240 - {'\'', 'E', '�'}, {'\'', 'e', '�'}, 241 - {'^', 'E', '�'}, {'^', 'e', '�'}, 242 - {'"', 'E', '�'}, {'"', 'e', '�'}, 243 - {'`', 'I', '�'}, {'`', 'i', '�'}, 244 - {'\'', 'I', '�'}, {'\'', 'i', '�'}, 245 - {'^', 'I', '�'}, {'^', 'i', '�'}, 246 - {'"', 'I', '�'}, {'"', 'i', '�'}, 247 - {'-', 'D', '�'}, {'-', 'd', '�'}, 248 - {'~', 'N', '�'}, {'~', 'n', '�'}, 249 - {'`', 'O', '�'}, {'`', 'o', '�'}, 250 - {'\'', 'O', '�'}, {'\'', 'o', '�'}, 251 - {'^', 'O', '�'}, {'^', 'o', '�'}, 252 - {'~', 'O', '�'}, {'~', 'o', '�'}, 253 - {'"', 'O', '�'}, {'"', 'o', '�'}, 254 - {'/', 'O', '�'}, {'/', 'o', '�'}, 255 - {'`', 'U', '�'}, {'`', 'u', '�'}, 256 - {'\'', 'U', '�'}, {'\'', 'u', '�'}, 257 - {'^', 'U', '�'}, {'^', 'u', '�'}, 258 - {'"', 'U', '�'}, {'"', 'u', '�'}, 259 - {'\'', 'Y', '�'}, {'\'', 'y', '�'}, 260 - {'T', 'H', '�'}, {'t', 'h', '�'}, 261 - {'s', 's', '�'}, {'"', 'y', '�'}, 262 - {'s', 'z', '�'}, {'i', 'j', '�'}, 263 - }; 264 - 265 - unsigned int accent_table_size = 68;
-356
drivers/tc/lk201-map.map
··· 1 - # Default kernel keymap. This uses 7 modifier combinations. 2 - keymaps 0-2,4-5,8,12 3 - # Change the above line into 4 - # keymaps 0-2,4-6,8,12 5 - # in case you want the entries 6 - # altgr control keycode 83 = Boot 7 - # altgr control keycode 111 = Boot 8 - # below. 9 - # 10 - # In fact AltGr is used very little, and one more keymap can 11 - # be saved by mapping AltGr to Alt (and adapting a few entries): 12 - # keycode 100 = Alt 13 - # 14 - keycode 0x15 = grave tilde 15 - alt keycode 0x15 = Escape 16 - control keycode 0x15 = Meta_Escape 17 - keycode 0x16 = one exclam 18 - alt keycode 0x16 = Meta_one 19 - keycode 0x17 = two at at 20 - control keycode 0x17 = nul 21 - shift control keycode 0x17 = nul 22 - alt keycode 0x17 = Meta_two 23 - keycode 0x18 = three numbersign 24 - control keycode 0x18 = Escape 25 - alt keycode 0x18 = Meta_three 26 - keycode 0x19 = four dollar dollar 27 - control keycode 0x19 = Control_backslash 28 - alt keycode 0x19 = Meta_four 29 - keycode 0x1a = five percent 30 - control keycode 0x1a = Control_bracketright 31 - alt keycode 0x1a = Meta_five 32 - keycode 0x1b = six asciicircum 33 - control keycode 0x1b = Control_asciicircum 34 - alt keycode 0x1b = Meta_six 35 - keycode 0x1c = seven ampersand braceleft 36 - control keycode 0x1c = Control_underscore 37 - alt keycode 0x1c = Meta_seven 38 - keycode 0x1d = eight asterisk bracketleft 39 - control keycode 0x1d = Delete 40 - alt keycode 0x1d = Meta_eight 41 - keycode 0x1e = nine parenleft bracketright 42 - alt keycode 0x1e = Meta_nine 43 - keycode 0x1f = zero parenright braceright 44 - alt keycode 0x1f = Meta_zero 45 - keycode 0x20 = minus underscore backslash 46 - control keycode 0x20 = Control_underscore 47 - shift control keycode 0x20 = Control_underscore 48 - alt keycode 0x20 = Meta_minus 49 - keycode 0x21 = equal plus 50 - alt keycode 0x21 = Meta_equal 51 - keycode 0x22 = Delete Delete 52 - control keycode 0x22 = BackSpace 53 - alt keycode 0x22 = Meta_Delete 54 - keycode 0x2a = Tab Tab 55 - alt keycode 0x2a = Meta_Tab 56 - keycode 0x2b = q 57 - keycode 0x2c = w 58 - keycode 0x2d = e 59 - altgr keycode 0x2d = Hex_E 60 - keycode 0x2e = r 61 - keycode 0x2f = t 62 - keycode 0x30 = y 63 - keycode 0x31 = u 64 - keycode 0x32 = i 65 - keycode 0x33 = o 66 - keycode 0x34 = p 67 - keycode 0x35 = bracketleft braceleft 68 - control keycode 0x35 = Escape 69 - alt keycode 0x35 = Meta_bracketleft 70 - keycode 0x36 = bracketright braceright asciitilde 71 - control keycode 0x36 = Control_bracketright 72 - alt keycode 0x36 = Meta_bracketright 73 - keycode 0x37 = Return 74 - alt keycode 0x37 = Meta_Control_m 75 - keycode 0x3f = Control 76 - keycode 0x41 = a 77 - altgr keycode 0x41 = Hex_A 78 - keycode 0x42 = s 79 - keycode 0x43 = d 80 - altgr keycode 0x43 = Hex_D 81 - keycode 0x44 = f 82 - altgr keycode 0x44 = Hex_F 83 - keycode 0x45 = g 84 - keycode 0x46 = h 85 - keycode 0x47 = j 86 - keycode 0x48 = k 87 - keycode 0x49 = l 88 - keycode 0x4a = semicolon colon 89 - alt keycode 0x4a = Meta_semicolon 90 - keycode 0x4b = apostrophe quotedbl 91 - control keycode 0x4b = Control_g 92 - alt keycode 0x4b = Meta_apostrophe 93 - # keycode 41 = grave asciitilde 94 - # control keycode 41 = nul 95 - # alt keycode 41 = Meta_grave 96 - keycode 0x52 = Shift 97 - keycode 0x4c = backslash bar 98 - control keycode 0x4c = Control_backslash 99 - alt keycode 0x4c = Meta_backslash 100 - keycode 0x53 = greater less 101 - keycode 0x54 = z 102 - keycode 0x55 = x 103 - keycode 0x56 = c 104 - altgr keycode 0x56 = Hex_C 105 - keycode 0x57 = v 106 - keycode 0x58 = b 107 - altgr keycode 0x58 = Hex_B 108 - keycode 0x59 = n 109 - keycode 0x5a = m 110 - keycode 0x5b = comma less 111 - alt keycode 0x5b = Meta_comma 112 - keycode 0x5c = period greater 113 - control keycode 0x5c = Compose 114 - alt keycode 0x5c = Meta_period 115 - keycode 0x5d = slash question 116 - control keycode 0x5d = Delete 117 - alt keycode 0x5d = Meta_slash 118 - 119 - keycode 0x67 = Alt 120 - keycode 0x68 = space space 121 - control keycode 0x68 = nul 122 - alt keycode 0x68 = Meta_space 123 - keycode 0x40 = Caps_Lock 124 - keycode 0x01 = F1 125 - control keycode 0x01 = F1 126 - alt keycode 0x01 = Console_1 127 - control alt keycode 0x01 = Console_1 128 - keycode 0x02 = F2 129 - control keycode 0x02 = F2 130 - alt keycode 0x02 = Console_2 131 - control alt keycode 0x02 = Console_2 132 - keycode 0x03 = F3 133 - control keycode 0x03 = F3 134 - alt keycode 0x03 = Console_3 135 - control alt keycode 0x03 = Console_3 136 - keycode 0x04 = F4 137 - control keycode 0x04 = F4 138 - alt keycode 0x04 = Console_4 139 - control alt keycode 0x04 = Console_4 140 - keycode 0x05 = F5 141 - control keycode 0x05 = F5 142 - alt keycode 0x05 = Console_5 143 - control alt keycode 0x05 = Console_5 144 - keycode 0x06 = F6 145 - control keycode 0x06 = F6 146 - alt keycode 0x06 = Console_6 147 - control alt keycode 0x06 = Console_6 148 - keycode 0x07 = F7 149 - control keycode 0x07 = F7 150 - alt keycode 0x07 = Console_7 151 - control alt keycode 0x07 = Console_7 152 - keycode 0x08 = F8 153 - control keycode 0x08 = F8 154 - alt keycode 0x08 = Console_8 155 - control alt keycode 0x08 = Console_8 156 - keycode 0x09 = F9 157 - control keycode 0x09 = F9 158 - alt keycode 0x09 = Console_9 159 - control alt keycode 0x09 = Console_9 160 - keycode 0x0a = F10 161 - control keycode 0x0a = F10 162 - alt keycode 0x0a = Console_10 163 - control alt keycode 0x0a = Console_10 164 - keycode 0x0b = F11 165 - control keycode 0x0b = F11 166 - alt keycode 0x0b = Console_11 167 - control alt keycode 0x0b = Console_11 168 - keycode 0x0c = F12 169 - control keycode 0x0c = F12 170 - alt keycode 0x0c = Console_12 171 - control alt keycode 0x0c = Console_12 172 - keycode 0x0d = F13 173 - control keycode 0x0d = F13 174 - alt keycode 0x0d = Console_13 175 - control alt keycode 0x0d = Console_13 176 - keycode 0x0e = F14 177 - control keycode 0x0e = F14 178 - alt keycode 0x0e = Console_14 179 - control alt keycode 0x0e = Console_14 180 - 181 - keycode 0x11 = F17 182 - control keycode 0x11 = F17 183 - alt keycode 0x11 = Console_17 184 - control alt keycode 0x11 = Console_17 185 - keycode 0x12 = F18 186 - control keycode 0x12 = F18 187 - alt keycode 0x12 = Console_18 188 - control alt keycode 0x12 = Console_18 189 - keycode 0x13 = F19 190 - control keycode 0x13 = F19 191 - alt keycode 0x13 = Console_19 192 - control alt keycode 0x13 = Console_19 193 - keycode 0x14 = F20 194 - control keycode 0x14 = F20 195 - alt keycode 0x14 = Console_20 196 - control alt keycode 0x14 = Console_20 197 - 198 - 199 - keycode 0x3b = KP_7 200 - alt keycode 0x3b = Ascii_7 201 - altgr keycode 0x3b = Hex_7 202 - keycode 0x3c = KP_8 203 - alt keycode 0x3c = Ascii_8 204 - altgr keycode 0x3c = Hex_8 205 - keycode 0x3d = KP_9 206 - alt keycode 0x3d = Ascii_9 207 - altgr keycode 0x3d = Hex_9 208 - keycode 0x3e = KP_Subtract 209 - keycode 0x4e = KP_4 210 - alt keycode 0x4e = Ascii_4 211 - altgr keycode 0x4e = Hex_4 212 - keycode 0x4f = KP_5 213 - alt keycode 0x4f = Ascii_5 214 - altgr keycode 0x4f = Hex_5 215 - keycode 0x50 = KP_6 216 - alt keycode 0x50 = Ascii_6 217 - altgr keycode 0x50 = Hex_6 218 - keycode 0x62 = KP_1 219 - alt keycode 0x62 = Ascii_1 220 - altgr keycode 0x62 = Hex_1 221 - keycode 0x63 = KP_2 222 - alt keycode 0x63 = Ascii_2 223 - altgr keycode 0x63 = Hex_2 224 - keycode 0x64 = KP_3 225 - alt keycode 0x64 = Ascii_3 226 - altgr keycode 0x64 = Hex_3 227 - keycode 0x6b = KP_0 228 - alt keycode 0x6b = Ascii_0 229 - altgr keycode 0x6b = Hex_0 230 - keycode 0x6c = KP_Period 231 - # altgr control keycode 0x6c = Boot 232 - control alt keycode 0x6c = Boot 233 - keycode 0x65 = KP_Enter 234 - 235 - keycode 0x3f = Control 236 - 237 - # keycode 100 = AltGr 238 - 239 - keycode 0x23 = Find 240 - keycode 0x4d = Up 241 - keycode 0x39 = Prior 242 - shift keycode 0x39 = Scroll_Backward 243 - keycode 0x5f = Left 244 - alt keycode 0x5f = Decr_Console 245 - keycode 0x61 = Right 246 - alt keycode 0x61 = Incr_Console 247 - keycode 0x38 = Select 248 - keycode 0x60 = Down 249 - keycode 0x3a = Next 250 - shift keycode 0x3a = Scroll_Forward 251 - keycode 0x24 = Insert 252 - keycode 0x25 = Remove 253 - # altgr control keycode 0x25 = Boot 254 - control alt keycode 0x25 = Boot 255 - 256 - keycode 0x0f = Help Show_Memory Show_Registers 257 - control keycode 0x0f = Show_State 258 - 259 - keycode 0x10 = Do 260 - 261 - string F1 = "\033[[A" 262 - string F2 = "\033[[B" 263 - string F3 = "\033[[C" 264 - string F4 = "\033[[D" 265 - string F5 = "\033[[E" 266 - string F6 = "\033[17~" 267 - string F7 = "\033[18~" 268 - string F8 = "\033[19~" 269 - string F9 = "\033[20~" 270 - string F10 = "\033[21~" 271 - string F11 = "\033[23~" 272 - string F12 = "\033[24~" 273 - string F13 = "\033[25~" 274 - string F14 = "\033[26~" 275 - string F15 = "\033[28~" 276 - string F16 = "\033[29~" 277 - string F17 = "\033[31~" 278 - string F18 = "\033[32~" 279 - string F19 = "\033[33~" 280 - string F20 = "\033[34~" 281 - string Find = "\033[1~" 282 - string Insert = "\033[2~" 283 - string Remove = "\033[3~" 284 - string Select = "\033[4~" 285 - string Prior = "\033[5~" 286 - string Next = "\033[6~" 287 - string Macro = "\033[M" 288 - string Pause = "\033[P" 289 - compose '`' 'A' to '�' 290 - compose '`' 'a' to '�' 291 - compose '\'' 'A' to '�' 292 - compose '\'' 'a' to '�' 293 - compose '^' 'A' to '�' 294 - compose '^' 'a' to '�' 295 - compose '~' 'A' to '�' 296 - compose '~' 'a' to '�' 297 - compose '"' 'A' to '�' 298 - compose '"' 'a' to '�' 299 - compose 'O' 'A' to '�' 300 - compose 'o' 'a' to '�' 301 - compose '0' 'A' to '�' 302 - compose '0' 'a' to '�' 303 - compose 'A' 'A' to '�' 304 - compose 'a' 'a' to '�' 305 - compose 'A' 'E' to '�' 306 - compose 'a' 'e' to '�' 307 - compose ',' 'C' to '�' 308 - compose ',' 'c' to '�' 309 - compose '`' 'E' to '�' 310 - compose '`' 'e' to '�' 311 - compose '\'' 'E' to '�' 312 - compose '\'' 'e' to '�' 313 - compose '^' 'E' to '�' 314 - compose '^' 'e' to '�' 315 - compose '"' 'E' to '�' 316 - compose '"' 'e' to '�' 317 - compose '`' 'I' to '�' 318 - compose '`' 'i' to '�' 319 - compose '\'' 'I' to '�' 320 - compose '\'' 'i' to '�' 321 - compose '^' 'I' to '�' 322 - compose '^' 'i' to '�' 323 - compose '"' 'I' to '�' 324 - compose '"' 'i' to '�' 325 - compose '-' 'D' to '�' 326 - compose '-' 'd' to '�' 327 - compose '~' 'N' to '�' 328 - compose '~' 'n' to '�' 329 - compose '`' 'O' to '�' 330 - compose '`' 'o' to '�' 331 - compose '\'' 'O' to '�' 332 - compose '\'' 'o' to '�' 333 - compose '^' 'O' to '�' 334 - compose '^' 'o' to '�' 335 - compose '~' 'O' to '�' 336 - compose '~' 'o' to '�' 337 - compose '"' 'O' to '�' 338 - compose '"' 'o' to '�' 339 - compose '/' 'O' to '�' 340 - compose '/' 'o' to '�' 341 - compose '`' 'U' to '�' 342 - compose '`' 'u' to '�' 343 - compose '\'' 'U' to '�' 344 - compose '\'' 'u' to '�' 345 - compose '^' 'U' to '�' 346 - compose '^' 'u' to '�' 347 - compose '"' 'U' to '�' 348 - compose '"' 'u' to '�' 349 - compose '\'' 'Y' to '�' 350 - compose '\'' 'y' to '�' 351 - compose 'T' 'H' to '�' 352 - compose 't' 'h' to '�' 353 - compose 's' 's' to '�' 354 - compose '"' 'y' to '�' 355 - compose 's' 'z' to '�' 356 - compose 'i' 'j' to '�'
-172
drivers/tc/lk201-remap.c
··· 1 - /* 2 - * Keyboard mappings for DEC LK201/401/501 keyboards 3 - * 4 - * 17.05.99 Michael Engel (engel@unix-ag.org) 5 - * 6 - * DEC US keyboards generate keycodes in the range 0x55 - 0xfb 7 - * 8 - * This conflicts with Linux scancode conventions which define 9 - * 0x00-0x7f as "normal" and 0x80-0xff as "shifted" scancodes, so we 10 - * have to remap the keycodes to 0x00-0x7f with the scancodeRemap 11 - * array. The generated scancode is simply the number of the key counted 12 - * from the left upper to the right lower corner of the keyboard ... 13 - * 14 - * These scancodes are then being remapped (I hope ;-)) with the 15 - * lk501*map[] arrays which define scancode -> Linux code mapping 16 - * 17 - * Oh man is this horrible ;-) 18 - * 19 - * Scancodes with dual labels exist for keyboards as follows: 20 - * 21 - * code: left label / right label 22 - * 23 - * 0x73: LKx01, LK421 / LK443, LK444 24 - * 0x74: LKx01, LK421 / LK443, LK444 25 - * 0x7c: LKx01, LK421 / LK443, LK444 26 - * 0x8a: LKx01, LK421 / LK443, LK444 27 - * 0x8b: LKx01, LK421 / LK443, LK444 28 - * 0x8c: LKx01, LK421 / LK443, LK444 29 - * 0x8d: LKx01, LK421 / LK443, LK444 30 - * 0x8e: LKx01, LK421 / LK443, LK444 31 - * 0x8f: LKx01, LK421 / LK443, LK444 32 - * 0x9c: LKx01, LK421 / LK443, LK444 33 - * 0xa1: LKx01, LK421 / LK443, LK444 34 - * 0xa2: LKx01, LK421 / LK443, LK444 35 - * 0xa3: LKx01, LK421 / LK443, LK444 36 - * 0xa4: LKx01, LK421 / LK443, LK444 37 - * 0xad: LK421 / LK443, LK444 38 - * 0xc9: LKx01, LK421, LK443 / LK444 39 - * 0xf7: LKx01, LK443 / LK444 40 - */ 41 - 42 - unsigned char scancodeRemap[256] = { 43 - /* ----- */ 44 - /* 0 */ 0, 0, 0, 0, 45 - /* ----- */ 46 - /* 4 */ 0, 0, 0, 0, 47 - /* ----- */ 48 - /* 8 */ 0, 0, 0, 0, 49 - /* ----- */ 50 - /* c */ 0, 0, 0, 0, 51 - /* ----- */ 52 - /* 10 */ 0, 0, 0, 0, 53 - /* ----- */ 54 - /* 14 */ 0, 0, 0, 0, 55 - /* ----- */ 56 - /* 18 */ 0, 0, 0, 0, 57 - /* ----- */ 58 - /* 1c */ 0, 0, 0, 0, 59 - /* ----- */ 60 - /* 20 */ 0, 0, 0, 0, 61 - /* ----- */ 62 - /* 24 */ 0, 0, 0, 0, 63 - /* ----- */ 64 - /* 28 */ 0, 0, 0, 0, 65 - /* ----- */ 66 - /* 2c */ 0, 0, 0, 0, 67 - /* ----- */ 68 - /* 30 */ 0, 0, 0, 0, 69 - /* ----- */ 70 - /* 34 */ 0, 0, 0, 0, 71 - /* ----- */ 72 - /* 38 */ 0, 0, 0, 0, 73 - /* ----- */ 74 - /* 3c */ 0, 0, 0, 0, 75 - /* ----- */ 76 - /* 40 */ 0, 0, 0, 0, 77 - /* ----- */ 78 - /* 44 */ 0, 0, 0, 0, 79 - /* ----- */ 80 - /* 48 */ 0, 0, 0, 0, 81 - /* ----- */ 82 - /* 4c */ 0, 0, 0, 0, 83 - /* ----- */ 84 - /* 50 */ 0, 0, 0, 0, 85 - /* ----- ESC F1 F2 */ 86 - /* 54 */ 0, 0, 0x01, 0x02, 87 - /* ----- F3 F4 F5 */ 88 - /* 58 */ 0x03, 0x04, 0x05, 0, 89 - /* ----- */ 90 - /* 5c */ 0, 0, 0, 0, 91 - /* ----- */ 92 - /* 60 */ 0, 0, 0, 0, 93 - /* ----- F6 F7 F8 F9 */ 94 - /* 64 */ 0x06, 0x07, 0x08, 0x09, 95 - /* ----- F10 */ 96 - /* 68 */ 0x0a, 0, 0, 0, 97 - /* ----- */ 98 - /* 6c */ 0, 0, 0, 0, 99 - /* ----- F11 F12 F13/PRNT SCRN */ 100 - /* 70 */ 0, 0x0b, 0x0c, 0x0d, 101 - /* ----- F14/SCRL LCK */ 102 - /* 74 */ 0x0e, 0, 0, 0, 103 - /* ----- */ 104 - /* 78 */ 0, 0, 0, 0, 105 - /* ----- HELP/PAUSE DO */ 106 - /* 7c */ 0x0f, 0x10, 0, 0, 107 - /* ----- F17 F18 F19 F20 */ 108 - /* 80 */ 0x11, 0x12, 0x13, 0x14, 109 - /* ----- */ 110 - /* 84 */ 0, 0, 0, 0, 111 - /* ----- FIND/INSERT INSERT/HOME */ 112 - /* 88 */ 0, 0, 0x23, 0x24, 113 - /* ----- REMOVE/PG UP SELECT/DELETE PREVIOUS/END NEXT/PG DN */ 114 - /* 8c */ 0x25, 0x38, 0x39, 0x3a, 115 - /* ----- KP 0 */ 116 - /* 90 */ 0, 0, 0x6b, 0, 117 - /* ----- KP . KP ENTER KP 1 KP 2 */ 118 - /* 94 */ 0x6c, 0x65, 0x62, 0x63, 119 - /* ----- KP 3 KP 4 KP 5 KP 6 */ 120 - /* 98 */ 0x64, 0x4e, 0x4f, 0x50, 121 - /* ----- KP ,/KP + KP 7 KP 8 KP 9 */ 122 - /* 9c */ 0x51, 0x3b, 0x3c, 0x3d, 123 - /* ----- KP - KP F1/NUM LCK KP F2/KP / KP F3/KP * */ 124 - /* a0 */ 0x3e, 0x26, 0x27, 0x28, 125 - /* ----- KP F4/KP - LEFT */ 126 - /* a4 */ 0x29, 0, 0, 0x5f, 127 - /* ----- RIGHT DOWN UP SHIFT Rt */ 128 - /* a8 */ 0x61, 0x60, 0x4d, 0x5e, 129 - /* ----- ALT COMP Rt/CTRL Rt SHIFT CONTROL */ 130 - /* ac */ 0, 0, 0x52, 0x3f, 131 - /* ----- CAPS COMPOSE ALT Rt */ 132 - /* b0 */ 0x40, 0x67, 0, 0, 133 - /* ----- */ 134 - /* b4 */ 0, 0, 0, 0, 135 - /* ----- */ 136 - /* b8 */ 0, 0, 0, 0, 137 - /* ----- BKSP RET TAB ` */ 138 - /* bc */ 0x22, 0x37, 0x2a, 0x15, 139 - /* ----- 1 q a z */ 140 - /* c0 */ 0x16, 0x2b, 0x41, 0x54, 141 - /* ----- 2 w s */ 142 - /* c4 */ 0, 0x17, 0x2c, 0x42, 143 - /* ----- x </\\ 3 */ 144 - /* c8 */ 0x55, 0x53, 0, 0x18, 145 - /* ----- e d c */ 146 - /* cc */ 0x2d, 0x43, 0x56, 0, 147 - /* ----- 4 r f v */ 148 - /* d0 */ 0x19, 0x2e, 0x44, 0x57, 149 - /* ----- SPACE 5 t */ 150 - /* d4 */ 0x68, 0, 0x1a, 0x2f, 151 - /* ----- g b 6 */ 152 - /* d8 */ 0x45, 0x58, 0, 0x1b, 153 - /* ----- y h n */ 154 - /* dc */ 0x30, 0x46, 0x59, 0, 155 - /* ----- 7 u j m */ 156 - /* e0 */ 0x1c, 0x31, 0x47, 0x5a, 157 - /* ----- 8 i k */ 158 - /* e4 */ 0, 0x1d, 0x32, 0x48, 159 - /* ----- , 9 o */ 160 - /* e8 */ 0x5b, 0, 0x1e, 0x33, 161 - /* ----- l . 0 */ 162 - /* ec */ 0x49, 0x5c, 0, 0x1f, 163 - /* ----- p ; / */ 164 - /* f0 */ 0x34, 0, 0x4a, 0x5d, 165 - /* ----- = ] \\/\' */ 166 - /* f4 */ 0, 0x21, 0x36, 0x4c, 167 - /* ----- - [ \' */ 168 - /* f8 */ 0, 0x20, 0x35, 0x4b, 169 - /* ----- */ 170 - /* fc */ 0, 0, 0, 0, 171 - }; 172 -
-439
drivers/tc/lk201.c
··· 1 - /* 2 - * 3 - * This file is subject to the terms and conditions of the GNU General Public 4 - * License. See the file "COPYING" in the main directory of this archive 5 - * for more details. 6 - * 7 - * Copyright (C) 1999-2002 Harald Koerfgen <hkoerfg@web.de> 8 - * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki 9 - */ 10 - 11 - 12 - #include <linux/errno.h> 13 - #include <linux/tty.h> 14 - #include <linux/kernel.h> 15 - #include <linux/init.h> 16 - #include <linux/delay.h> 17 - #include <linux/kbd_ll.h> 18 - #include <linux/kbd_kern.h> 19 - #include <linux/vt_kern.h> 20 - 21 - #include <asm/keyboard.h> 22 - #include <asm/dec/tc.h> 23 - #include <asm/dec/machtype.h> 24 - #include <asm/dec/serial.h> 25 - 26 - #include "lk201.h" 27 - 28 - /* 29 - * Only handle DECstations that have an LK201 interface. 30 - * Maxine uses LK501 at the Access.Bus and various DECsystems 31 - * have no keyboard interface at all. 32 - */ 33 - #define LK_IFACE (mips_machtype == MACH_DS23100 || \ 34 - mips_machtype == MACH_DS5000_200 || \ 35 - mips_machtype == MACH_DS5000_1XX || \ 36 - mips_machtype == MACH_DS5000_2X0) 37 - /* 38 - * These use the Z8530 SCC. Others use the DZ11. 39 - */ 40 - #define LK_IFACE_ZS (mips_machtype == MACH_DS5000_1XX || \ 41 - mips_machtype == MACH_DS5000_2X0) 42 - 43 - /* Simple translation table for the SysRq keys */ 44 - 45 - #ifdef CONFIG_MAGIC_SYSRQ 46 - /* 47 - * Actually no translation at all, at least until we figure out 48 - * how to define SysRq for LK201 and friends. --macro 49 - */ 50 - unsigned char lk201_sysrq_xlate[128]; 51 - unsigned char *kbd_sysrq_xlate = lk201_sysrq_xlate; 52 - 53 - unsigned char kbd_sysrq_key = -1; 54 - #endif 55 - 56 - #define KEYB_LINE 3 57 - 58 - static int __init lk201_init(void *); 59 - static void __init lk201_info(void *); 60 - static void lk201_rx_char(unsigned char, unsigned char); 61 - 62 - static struct dec_serial_hook lk201_hook = { 63 - .init_channel = lk201_init, 64 - .init_info = lk201_info, 65 - .rx_char = NULL, 66 - .poll_rx_char = NULL, 67 - .poll_tx_char = NULL, 68 - .cflags = B4800 | CS8 | CSTOPB | CLOCAL, 69 - }; 70 - 71 - /* 72 - * This is used during keyboard initialisation 73 - */ 74 - static unsigned char lk201_reset_string[] = { 75 - LK_CMD_SET_DEFAULTS, 76 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 1), 77 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 2), 78 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 3), 79 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 4), 80 - LK_CMD_MODE(LK_MODE_DOWN_UP, 5), 81 - LK_CMD_MODE(LK_MODE_DOWN_UP, 6), 82 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 7), 83 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 8), 84 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 9), 85 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 10), 86 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 11), 87 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 12), 88 - LK_CMD_MODE(LK_MODE_DOWN, 13), 89 - LK_CMD_MODE(LK_MODE_RPT_DOWN, 14), 90 - LK_CMD_DIS_KEYCLK, 91 - LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4), 92 - }; 93 - 94 - static void *lk201_handle; 95 - 96 - static int lk201_send(unsigned char ch) 97 - { 98 - if (lk201_hook.poll_tx_char(lk201_handle, ch)) { 99 - printk(KERN_ERR "lk201: transmit timeout\n"); 100 - return -EIO; 101 - } 102 - return 0; 103 - } 104 - 105 - static inline int lk201_get_id(void) 106 - { 107 - return lk201_send(LK_CMD_REQ_ID); 108 - } 109 - 110 - static int lk201_reset(void) 111 - { 112 - int i, r; 113 - 114 - for (i = 0; i < sizeof(lk201_reset_string); i++) { 115 - r = lk201_send(lk201_reset_string[i]); 116 - if (r < 0) 117 - return r; 118 - } 119 - return 0; 120 - } 121 - 122 - static void lk201_report(unsigned char id[6]) 123 - { 124 - char *report = "lk201: keyboard attached, "; 125 - 126 - switch (id[2]) { 127 - case LK_STAT_PWRUP_OK: 128 - printk(KERN_INFO "%sself-test OK\n", report); 129 - break; 130 - case LK_STAT_PWRUP_KDOWN: 131 - /* The keyboard will resend the power-up ID 132 - after all keys are released, so we don't 133 - bother handling the error specially. Still 134 - there may be a short-circuit inside. 135 - */ 136 - printk(KERN_ERR "%skey down (stuck?), code: 0x%02x\n", 137 - report, id[3]); 138 - break; 139 - case LK_STAT_PWRUP_ERROR: 140 - printk(KERN_ERR "%sself-test failure\n", report); 141 - break; 142 - default: 143 - printk(KERN_ERR "%sunknown error: 0x%02x\n", 144 - report, id[2]); 145 - } 146 - } 147 - 148 - static void lk201_id(unsigned char id[6]) 149 - { 150 - /* 151 - * Report whether there is an LK201 or an LK401 152 - * The LK401 has ALT keys... 153 - */ 154 - switch (id[4]) { 155 - case 1: 156 - printk(KERN_INFO "lk201: LK201 detected\n"); 157 - break; 158 - case 2: 159 - printk(KERN_INFO "lk201: LK401 detected\n"); 160 - break; 161 - case 3: 162 - printk(KERN_INFO "lk201: LK443 detected\n"); 163 - break; 164 - case 4: 165 - printk(KERN_INFO "lk201: LK421 detected\n"); 166 - break; 167 - default: 168 - printk(KERN_WARNING 169 - "lk201: unknown keyboard detected, ID %d\n", id[4]); 170 - printk(KERN_WARNING "lk201: ... please report to " 171 - "<linux-mips@linux-mips.org>\n"); 172 - } 173 - } 174 - 175 - #define DEFAULT_KEYB_REP_DELAY (250/5) /* [5ms] */ 176 - #define DEFAULT_KEYB_REP_RATE 30 /* [cps] */ 177 - 178 - static struct kbd_repeat kbdrate = { 179 - DEFAULT_KEYB_REP_DELAY, 180 - DEFAULT_KEYB_REP_RATE 181 - }; 182 - 183 - static void parse_kbd_rate(struct kbd_repeat *r) 184 - { 185 - if (r->delay <= 0) 186 - r->delay = kbdrate.delay; 187 - if (r->rate <= 0) 188 - r->rate = kbdrate.rate; 189 - 190 - if (r->delay < 5) 191 - r->delay = 5; 192 - if (r->delay > 630) 193 - r->delay = 630; 194 - if (r->rate < 12) 195 - r->rate = 12; 196 - if (r->rate > 127) 197 - r->rate = 127; 198 - if (r->rate == 125) 199 - r->rate = 124; 200 - } 201 - 202 - static int write_kbd_rate(struct kbd_repeat *rep) 203 - { 204 - int delay, rate; 205 - int i; 206 - 207 - delay = rep->delay / 5; 208 - rate = rep->rate; 209 - for (i = 0; i < 4; i++) { 210 - if (lk201_hook.poll_tx_char(lk201_handle, 211 - LK_CMD_RPT_RATE(i))) 212 - return 1; 213 - if (lk201_hook.poll_tx_char(lk201_handle, 214 - LK_PARAM_DELAY(delay))) 215 - return 1; 216 - if (lk201_hook.poll_tx_char(lk201_handle, 217 - LK_PARAM_RATE(rate))) 218 - return 1; 219 - } 220 - return 0; 221 - } 222 - 223 - static int lk201_kbd_rate(struct kbd_repeat *rep) 224 - { 225 - if (rep == NULL) 226 - return -EINVAL; 227 - 228 - parse_kbd_rate(rep); 229 - 230 - if (write_kbd_rate(rep)) { 231 - memcpy(rep, &kbdrate, sizeof(struct kbd_repeat)); 232 - return -EIO; 233 - } 234 - 235 - memcpy(&kbdrate, rep, sizeof(struct kbd_repeat)); 236 - 237 - return 0; 238 - } 239 - 240 - static void lk201_kd_mksound(unsigned int hz, unsigned int ticks) 241 - { 242 - if (!ticks) 243 - return; 244 - 245 - /* 246 - * Can't set frequency and we "approximate" 247 - * duration by volume. ;-) 248 - */ 249 - ticks /= HZ / 32; 250 - if (ticks > 7) 251 - ticks = 7; 252 - ticks = 7 - ticks; 253 - 254 - if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_ENB_BELL)) 255 - return; 256 - if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_VOLUME(ticks))) 257 - return; 258 - if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_BELL)) 259 - return; 260 - } 261 - 262 - void kbd_leds(unsigned char leds) 263 - { 264 - unsigned char l = 0; 265 - 266 - if (!lk201_handle) /* FIXME */ 267 - return; 268 - 269 - /* FIXME -- Only Hold and Lock LEDs for now. --macro */ 270 - if (leds & LED_SCR) 271 - l |= LK_LED_HOLD; 272 - if (leds & LED_CAP) 273 - l |= LK_LED_LOCK; 274 - 275 - if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_ON)) 276 - return; 277 - if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(l))) 278 - return; 279 - if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_OFF)) 280 - return; 281 - if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(~l))) 282 - return; 283 - } 284 - 285 - int kbd_setkeycode(unsigned int scancode, unsigned int keycode) 286 - { 287 - return -EINVAL; 288 - } 289 - 290 - int kbd_getkeycode(unsigned int scancode) 291 - { 292 - return -EINVAL; 293 - } 294 - 295 - int kbd_translate(unsigned char scancode, unsigned char *keycode, 296 - char raw_mode) 297 - { 298 - *keycode = scancode; 299 - return 1; 300 - } 301 - 302 - char kbd_unexpected_up(unsigned char keycode) 303 - { 304 - return 0x80; 305 - } 306 - 307 - static void lk201_rx_char(unsigned char ch, unsigned char fl) 308 - { 309 - static unsigned char id[6]; 310 - static int id_i; 311 - 312 - static int shift_state = 0; 313 - static int prev_scancode; 314 - unsigned char c = scancodeRemap[ch]; 315 - 316 - if (fl != TTY_NORMAL && fl != TTY_OVERRUN) { 317 - printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n", fl); 318 - return; 319 - } 320 - 321 - /* Assume this is a power-up ID. */ 322 - if (ch == LK_STAT_PWRUP_ID && !id_i) { 323 - id[id_i++] = ch; 324 - return; 325 - } 326 - 327 - /* Handle the power-up sequence. */ 328 - if (id_i) { 329 - id[id_i++] = ch; 330 - if (id_i == 4) { 331 - /* OK, the power-up concluded. */ 332 - lk201_report(id); 333 - if (id[2] == LK_STAT_PWRUP_OK) 334 - lk201_get_id(); 335 - else { 336 - id_i = 0; 337 - printk(KERN_ERR "lk201: keyboard power-up " 338 - "error, skipping initialization\n"); 339 - } 340 - } else if (id_i == 6) { 341 - /* We got the ID; report it and start operation. */ 342 - id_i = 0; 343 - lk201_id(id); 344 - lk201_reset(); 345 - } 346 - return; 347 - } 348 - 349 - /* Everything else is a scancode/status response. */ 350 - id_i = 0; 351 - switch (ch) { 352 - case LK_STAT_RESUME_ERR: 353 - case LK_STAT_ERROR: 354 - case LK_STAT_INHIBIT_ACK: 355 - case LK_STAT_TEST_ACK: 356 - case LK_STAT_MODE_KEYDOWN: 357 - case LK_STAT_MODE_ACK: 358 - break; 359 - case LK_KEY_LOCK: 360 - shift_state ^= LK_LOCK; 361 - handle_scancode(c, (shift_state & LK_LOCK) ? 1 : 0); 362 - break; 363 - case LK_KEY_SHIFT: 364 - shift_state ^= LK_SHIFT; 365 - handle_scancode(c, (shift_state & LK_SHIFT) ? 1 : 0); 366 - break; 367 - case LK_KEY_CTRL: 368 - shift_state ^= LK_CTRL; 369 - handle_scancode(c, (shift_state & LK_CTRL) ? 1 : 0); 370 - break; 371 - case LK_KEY_COMP: 372 - shift_state ^= LK_COMP; 373 - handle_scancode(c, (shift_state & LK_COMP) ? 1 : 0); 374 - break; 375 - case LK_KEY_RELEASE: 376 - if (shift_state & LK_SHIFT) 377 - handle_scancode(scancodeRemap[LK_KEY_SHIFT], 0); 378 - if (shift_state & LK_CTRL) 379 - handle_scancode(scancodeRemap[LK_KEY_CTRL], 0); 380 - if (shift_state & LK_COMP) 381 - handle_scancode(scancodeRemap[LK_KEY_COMP], 0); 382 - if (shift_state & LK_LOCK) 383 - handle_scancode(scancodeRemap[LK_KEY_LOCK], 0); 384 - shift_state = 0; 385 - break; 386 - case LK_KEY_REPEAT: 387 - handle_scancode(prev_scancode, 1); 388 - break; 389 - default: 390 - prev_scancode = c; 391 - handle_scancode(c, 1); 392 - break; 393 - } 394 - tasklet_schedule(&keyboard_tasklet); 395 - } 396 - 397 - static void __init lk201_info(void *handle) 398 - { 399 - } 400 - 401 - static int __init lk201_init(void *handle) 402 - { 403 - /* First install handlers. */ 404 - lk201_handle = handle; 405 - kbd_rate = lk201_kbd_rate; 406 - kd_mksound = lk201_kd_mksound; 407 - 408 - lk201_hook.rx_char = lk201_rx_char; 409 - 410 - /* Then just issue a reset -- the handlers will do the rest. */ 411 - lk201_send(LK_CMD_POWER_UP); 412 - 413 - return 0; 414 - } 415 - 416 - void __init kbd_init_hw(void) 417 - { 418 - /* Maxine uses LK501 at the Access.Bus. */ 419 - if (!LK_IFACE) 420 - return; 421 - 422 - printk(KERN_INFO "lk201: DECstation LK keyboard driver v0.05.\n"); 423 - 424 - if (LK_IFACE_ZS) { 425 - /* 426 - * kbd_init_hw() is being called before 427 - * rs_init() so just register the kbd hook 428 - * and let zs_init do the rest :-) 429 - */ 430 - if (!register_dec_serial_hook(KEYB_LINE, &lk201_hook)) 431 - unregister_dec_serial_hook(KEYB_LINE); 432 - } else { 433 - /* 434 - * TODO: modify dz.c to allow similar hooks 435 - * for LK201 handling on DS2100, DS3100, and DS5000/200 436 - */ 437 - printk(KERN_ERR "lk201: support for DZ11 not yet ready.\n"); 438 - } 439 - }
-125
drivers/tc/lk201.h
··· 1 - /* 2 - * Commands to the keyboard processor 3 - */ 4 - 5 - #define LK_PARAM 0x80 /* start/end parameter list */ 6 - 7 - #define LK_CMD_RESUME 0x8b /* resume transmission to the host */ 8 - #define LK_CMD_INHIBIT 0x89 /* stop transmission to the host */ 9 - #define LK_CMD_LEDS_ON 0x13 /* light LEDs */ 10 - /* 1st param: led bitmask */ 11 - #define LK_CMD_LEDS_OFF 0x11 /* turn off LEDs */ 12 - /* 1st param: led bitmask */ 13 - #define LK_CMD_DIS_KEYCLK 0x99 /* disable the keyclick */ 14 - #define LK_CMD_ENB_KEYCLK 0x1b /* enable the keyclick */ 15 - /* 1st param: volume */ 16 - #define LK_CMD_DIS_CTLCLK 0xb9 /* disable the Ctrl keyclick */ 17 - #define LK_CMD_ENB_CTLCLK 0xbb /* enable the Ctrl keyclick */ 18 - #define LK_CMD_SOUND_CLK 0x9f /* emit a keyclick */ 19 - #define LK_CMD_DIS_BELL 0xa1 /* disable the bell */ 20 - #define LK_CMD_ENB_BELL 0x23 /* enable the bell */ 21 - /* 1st param: volume */ 22 - #define LK_CMD_BELL 0xa7 /* emit a bell */ 23 - #define LK_CMD_TMP_NORPT 0xd1 /* disable typematic */ 24 - /* for the currently pressed key */ 25 - #define LK_CMD_ENB_RPT 0xe3 /* enable typematic */ 26 - /* for RPT_DOWN groups */ 27 - #define LK_CMD_DIS_RPT 0xe1 /* disable typematic */ 28 - /* for RPT_DOWN groups */ 29 - #define LK_CMD_RPT_TO_DOWN 0xd9 /* set RPT_DOWN groups to DOWN */ 30 - #define LK_CMD_REQ_ID 0xab /* request the keyboard ID */ 31 - #define LK_CMD_POWER_UP 0xfd /* init power-up sequence */ 32 - #define LK_CMD_TEST_MODE 0xcb /* enter the factory test mode */ 33 - #define LK_CMD_TEST_EXIT 0x80 /* exit the factory test mode */ 34 - #define LK_CMD_SET_DEFAULTS 0xd3 /* set power-up defaults */ 35 - 36 - #define LK_CMD_MODE(m,div) (LK_PARAM|(((div)&0xf)<<3)|(((m)&0x3)<<1)) 37 - /* select the repeat mode */ 38 - /* for the selected key group */ 39 - #define LK_CMD_MODE_AR(m,div) ((((div)&0xf)<<3)|(((m)&0x3)<<1)) 40 - /* select the repeat mode */ 41 - /* and the repeat register */ 42 - /* for the selected key group */ 43 - /* 1st param: register number */ 44 - #define LK_CMD_RPT_RATE(r) (0x78|(((r)&0x3)<<1)) 45 - /* set the delay and repeat rate */ 46 - /* for the selected repeat register */ 47 - /* 1st param: initial delay */ 48 - /* 2nd param: repeat rate */ 49 - 50 - /* there are 4 leds, represent them in the low 4 bits of a byte */ 51 - #define LK_PARAM_LED_MASK(ledbmap) (LK_PARAM|((ledbmap)&0xf)) 52 - #define LK_LED_WAIT 0x1 /* Wait LED */ 53 - #define LK_LED_COMP 0x2 /* Compose LED */ 54 - #define LK_LED_LOCK 0x4 /* Lock LED */ 55 - #define LK_LED_HOLD 0x8 /* Hold Screen LED */ 56 - 57 - /* max volume is 0, lowest is 0x7 */ 58 - #define LK_PARAM_VOLUME(v) (LK_PARAM|((v)&0x7)) 59 - 60 - /* mode set command details, div is a key group number */ 61 - #define LK_MODE_DOWN 0x0 /* make only */ 62 - #define LK_MODE_RPT_DOWN 0x1 /* make and typematic */ 63 - #define LK_MODE_DOWN_UP 0x3 /* make and release */ 64 - 65 - /* there are 4 repeat registers */ 66 - #define LK_PARAM_AR(r) (LK_PARAM|((v)&0x3)) 67 - 68 - /* 69 - * Mappings between key groups and keycodes are as follows: 70 - * 71 - * 1: 0xbf - 0xff -- alphanumeric, 72 - * 2: 0x91 - 0xa5 -- numeric keypad, 73 - * 3: 0xbc -- Backspace, 74 - * 4: 0xbd - 0xbe -- Tab, Return, 75 - * 5: 0xb0 - 0xb2 -- Lock, Compose Character, 76 - * 6: 0xad - 0xaf -- Ctrl, Shift, 77 - * 7: 0xa6 - 0xa8 -- Left Arrow, Right Arrow, 78 - * 8: 0xa9 - 0xac -- Up Arrow, Down Arrow, Right Shift, 79 - * 9: 0x88 - 0x90 -- editor keypad, 80 - * 10: 0x56 - 0x62 -- F1 - F5, 81 - * 11: 0x63 - 0x6e -- F6 - F10, 82 - * 12: 0x6f - 0x7a -- F11 - F14, 83 - * 13: 0x7b - 0x7d -- Help, Do, 84 - * 14: 0x7e - 0x87 -- F17 - F20. 85 - * 86 - * Notes: 87 - * 1. Codes in the 0x00 - 0x40 range are reserved. 88 - * 2. The assignment of the 0x41 - 0x55 range is undiscovered, probably 10. 89 - */ 90 - 91 - /* delay is 5 - 630 ms; 0x00 and 0x7f are reserved */ 92 - #define LK_PARAM_DELAY(t) ((t)&0x7f) 93 - 94 - /* rate is 12 - 127 Hz; 0x00 - 0x0b and 0x7d (power-up!) are reserved */ 95 - #define LK_PARAM_RATE(r) (LK_PARAM|((r)&0x7f)) 96 - 97 - #define LK_SHIFT 1<<0 98 - #define LK_CTRL 1<<1 99 - #define LK_LOCK 1<<2 100 - #define LK_COMP 1<<3 101 - 102 - #define LK_KEY_SHIFT 0xae 103 - #define LK_KEY_CTRL 0xaf 104 - #define LK_KEY_LOCK 0xb0 105 - #define LK_KEY_COMP 0xb1 106 - 107 - #define LK_KEY_RELEASE 0xb3 /* all keys released */ 108 - #define LK_KEY_REPEAT 0xb4 /* repeat the last key */ 109 - 110 - /* status responses */ 111 - #define LK_STAT_RESUME_ERR 0xb5 /* keystrokes lost while inhibited */ 112 - #define LK_STAT_ERROR 0xb6 /* an invalid command received */ 113 - #define LK_STAT_INHIBIT_ACK 0xb7 /* transmission inhibited */ 114 - #define LK_STAT_TEST_ACK 0xb8 /* the factory test mode entered */ 115 - #define LK_STAT_MODE_KEYDOWN 0xb9 /* a key is down on a change */ 116 - /* to the DOWN_UP mode; */ 117 - /* the keycode follows */ 118 - #define LK_STAT_MODE_ACK 0xba /* the mode command succeeded */ 119 - 120 - #define LK_STAT_PWRUP_ID 0x01 /* the power-up response start mark */ 121 - #define LK_STAT_PWRUP_OK 0x00 /* the power-up self test OK */ 122 - #define LK_STAT_PWRUP_KDOWN 0x3d /* a key was down during the test */ 123 - #define LK_STAT_PWRUP_ERROR 0x3e /* keyboard self test failure */ 124 - 125 - extern unsigned char scancodeRemap[256];