32 #include <linux/module.h>
34 #include <linux/input.h>
37 #include <linux/keyboard.h>
48 static unsigned char amikbd_keycode[0x78]
__initdata = {
147 static const char *amikbd_messages[8] = {
148 [0] =
KERN_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n",
150 [2] =
KERN_WARNING "amikbd: keyboard buffer overflow\n",
151 [3] =
KERN_WARNING "amikbd: keyboard controller failure\n",
152 [4] =
KERN_ERR "amikbd: keyboard selftest failure\n",
153 [5] =
KERN_INFO "amikbd: initiate power-up key stream\n",
154 [6] =
KERN_INFO "amikbd: terminate power-up key stream\n",
161 unsigned char scancode,
down;
163 scancode = ~
ciaa.sdr;
168 down = !(scancode & 1);
171 if (scancode < 0x78) {
172 if (scancode == 98) {
173 input_report_key(dev, scancode, 1);
174 input_report_key(dev, scancode, 0);
176 input_report_key(dev, scancode, down);
181 printk(amikbd_messages[scancode - 0x78]);
188 struct input_dev *
dev;
191 dev = input_allocate_device();
193 dev_err(&pdev->
dev,
"Not enough memory for input device\n");
197 dev->name = pdev->
name;
198 dev->phys =
"amikbd/input0";
200 dev->id.vendor = 0x0001;
201 dev->id.product = 0x0001;
202 dev->id.version = 0x0100;
203 dev->dev.parent = &pdev->
dev;
207 for (i = 0; i < 0x78; i++)
214 memset(temp_map, 0,
sizeof(temp_map));
215 for (j = 0; j < 0x78; j++) {
216 if (!amikbd_keycode[j])
220 for (j = 0; j <
NR_KEYS; j++) {
222 temp_map[
j] = 0xf200;
232 err = input_register_device(dev);
236 platform_set_drvdata(pdev, dev);
241 fail2: input_free_device(dev);
247 struct input_dev *dev = platform_get_drvdata(pdev);
249 platform_set_drvdata(pdev,
NULL);
251 input_unregister_device(dev);
258 .name =
"amiga-keyboard",
263 static int __init amikbd_init(
void)
270 static void __exit amikbd_exit(
void)