Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29015
b: refs/heads/master
c: 5fa28ea
h: refs/heads/master
i:
  29013: d77e225
  29011: cd91cd4
  29007: 6d37c23
v: v3
  • Loading branch information
Roman Zippel authored and Linus Torvalds committed Jun 23, 2006
1 parent 38c944b commit 9d9229d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb7d390df391402c9630940d5a2ea1571fc5cde2
refs/heads/master: 5fa28ea42f28342ca6efaa2d23789f3fec5adff6
34 changes: 22 additions & 12 deletions trunk/drivers/input/keyboard/amikbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/input.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/keyboard.h>

#include <asm/amigaints.h>
#include <asm/amigahw.h>
Expand All @@ -45,7 +46,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Amiga keyboard driver");
MODULE_LICENSE("GPL");

static unsigned char amikbd_keycode[0x78] = {
static unsigned char amikbd_keycode[0x78] __initdata = {
[0] = KEY_GRAVE,
[1] = KEY_1,
[2] = KEY_2,
Expand Down Expand Up @@ -170,12 +171,9 @@ static irqreturn_t amikbd_interrupt(int irq, void *dummy, struct pt_regs *fp)
scancode >>= 1;

if (scancode < 0x78) { /* scancodes < 0x78 are keys */

scancode = amikbd_keycode[scancode];

input_regs(amikbd_dev, fp);

if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */
if (scancode == 98) { /* CapsLock is a toggle switch key on Amiga */
input_report_key(amikbd_dev, scancode, 1);
input_report_key(amikbd_dev, scancode, 0);
} else {
Expand All @@ -191,7 +189,7 @@ static irqreturn_t amikbd_interrupt(int irq, void *dummy, struct pt_regs *fp)

static int __init amikbd_init(void)
{
int i;
int i, j;

if (!AMIGAHW_PRESENT(AMI_KEYBOARD))
return -EIO;
Expand All @@ -214,14 +212,26 @@ static int __init amikbd_init(void)
amikbd_dev->id.version = 0x0100;

amikbd_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
amikbd_dev->keycode = amikbd_keycode;
amikbd_dev->keycodesize = sizeof(unsigned char);
amikbd_dev->keycodemax = ARRAY_SIZE(amikbd_keycode);

for (i = 0; i < 0x78; i++)
if (amikbd_keycode[i])
set_bit(amikbd_keycode[i], amikbd_dev->keybit);

set_bit(i, amikbd_dev->keybit);

for (i = 0; i < MAX_NR_KEYMAPS; i++) {
static u_short temp_map[NR_KEYS] __initdata;
if (!key_maps[i])
continue;
memset(temp_map, 0, sizeof(temp_map));
for (j = 0; j < 0x78; j++) {
if (!amikbd_keycode[j])
continue;
temp_map[j] = key_maps[i][amikbd_keycode[j]];
}
for (j = 0; j < NR_KEYS; j++) {
if (!temp_map[j])
temp_map[j] = 0xf200;
}
memcpy(key_maps[i], temp_map, sizeof(temp_map));
}
ciaa.cra &= ~0x41; /* serial data in, turn off TA */
request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd", amikbd_interrupt);

Expand Down

0 comments on commit 9d9229d

Please sign in to comment.