/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include <linux/delay.h>
#define KBD98_KEY 0x7f
#define KBD98_RELEASE 0x80
-static unsigned char kbd98_keycode[256] = {
+static unsigned char kbd98_keycode[256] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 43, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 41, 26, 28, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 27, 44, 45, 46, 47, 48, 49, 50,
struct jis_kbd_conv jis[16];
};
-void kbd98_interrupt(struct serio *serio, unsigned char data,
- unsigned int flags, struct pt_regs *regs)
+irqreturn_t kbd98_interrupt(struct serio *serio, unsigned char data,
+ unsigned int flags, struct pt_regs *regs)
{
struct kbd98 *kbd98 = serio->private;
unsigned char scancode, keycode;
switch (data) {
case KBD98_RET_ACK:
kbd98->ack = 1;
- return;
+ goto out;
case KBD98_RET_NAK:
kbd98->ack = -1;
- return;
+ goto out;
}
if (kbd98->cmdcnt) {
kbd98->cmdbuf[--kbd98->cmdcnt] = data;
- return;
+ goto out;
}
scancode = data & KBD98_KEY;
keycode = kbd98->jis[i].emul[kbd98->shift].keycode;
if (keycode == KBD98_KEY_NULL)
- return;
+ break;
if (press) {
kbd98->emul.scancode = scancode;
}
input_sync(&kbd98->dev);
- return;
+ break;
case KEY_CAPSLOCK:
input_report_key(&kbd98->dev, keycode, 1);
input_sync(&kbd98->dev);
input_report_key(&kbd98->dev, keycode, 0);
input_sync(&kbd98->dev);
- return;
+ break;
case KBD98_KEY_NULL:
- return;
+ break;
case 0:
printk(KERN_WARNING "kbd98.c: Unknown key (scancode %#x) %s.\n",
data & KBD98_KEY, data & KBD98_RELEASE ? "released" : "pressed");
- return;
+ break;
default:
input_report_key(&kbd98->dev, keycode, press);
input_sync(&kbd98->dev);
- }
+ break;
+ }
+
+out:
+ return IRQ_HANDLED;
}
/*
int i;
kbd98->cmdcnt = receive;
-
+
if (command & 0xff)
if (kbd98_sendbyte(kbd98, command & 0xff))
return (kbd98->cmdcnt = 0) - 1;
for (i = 0; i < receive; i++)
param[i] = kbd98->cmdbuf[(receive - 1) - i];
- if (kbd98->cmdcnt)
+ if (kbd98->cmdcnt)
return (kbd98->cmdcnt = 0) - 1;
return 0;
memset(kbd98, 0, sizeof(struct kbd98));
kbd98->emul.scancode = KBD98_KEY_UNKNOWN;
-
+
kbd98->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
kbd98->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_KANA);