Commit 18b8c734 authored by Vojtech Pavlik's avatar Vojtech Pavlik

Some fixes after conflict merge, in rpcmouse.c and rpckbd.c

parent ccb83656
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Acorn RiscPC mouse driver for Linux/ARM * Acorn RiscPC mouse driver for Linux/ARM
* *
* Copyright (c) 2000-2002 Vojtech Pavlik * Copyright (c) 2000-2002 Vojtech Pavlik
* Copyright (C) 1996-1998 Russell King * Copyright (C) 1996-2002 Russell King
* *
*/ */
...@@ -34,7 +34,6 @@ MODULE_DESCRIPTION("Acorn RiscPC mouse driver"); ...@@ -34,7 +34,6 @@ MODULE_DESCRIPTION("Acorn RiscPC mouse driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static short rpcmouse_lastx, rpcmouse_lasty; static short rpcmouse_lastx, rpcmouse_lasty;
static unsigned int rpcmouse_lastb;
static struct input_dev rpcmouse_dev = { static struct input_dev rpcmouse_dev = {
.evbit = { BIT(EV_KEY) | BIT(EV_REL) }, .evbit = { BIT(EV_KEY) | BIT(EV_REL) },
...@@ -53,12 +52,11 @@ static struct input_dev rpcmouse_dev = { ...@@ -53,12 +52,11 @@ static struct input_dev rpcmouse_dev = {
static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs) static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct input_dev *dev = dev_id; struct input_dev *dev = dev_id;
short x, y, dx, dy; short x, y, dx, dy, b;
unsigned int b;
x = (short) iomd_readl(IOMD_MOUSEX); x = (short) iomd_readl(IOMD_MOUSEX);
y = (short) iomd_readl(IOMD_MOUSEY); y = (short) iomd_readl(IOMD_MOUSEY);
b = (short) (__raw_readl(0xe0310000) >> 4) & 7; b = (short) (__raw_readl(0xe0310000) ^ 0x70);
dx = x - rpcmouse_lastx; dx = x - rpcmouse_lastx;
dy = y - rpcmouse_lasty; dy = y - rpcmouse_lasty;
...@@ -66,21 +64,14 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -66,21 +64,14 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
rpcmouse_lastx = x; rpcmouse_lastx = x;
rpcmouse_lasty = y; rpcmouse_lasty = y;
if (dx) input_report_rel(dev, REL_X, dx);
input_report_rel(dev, REL_X, dx); input_report_rel(dev, REL_Y, -dy);
if (dy)
input_report_rel(dev, REL_Y, -dy);
b = __raw_readl(0xe0310000) ^ 0x70; input_report_key(dev, BTN_LEFT, b & 0x40);
if (b != rpcmouse_lastb) { input_report_key(dev, BTN_MIDDLE, b & 0x20);
input_report_key(dev, BTN_LEFT, b & 0x40); input_report_key(dev, BTN_RIGHT, b & 0x10);
input_report_key(dev, BTN_MIDDLE, b & 0x20);
input_report_key(dev, BTN_RIGHT, b & 0x10);
}
if (b != rpcmouse_lastb || dx || dy)
input_sync(dev);
rpcmouse_lastb = b; input_sync(dev);
} }
static int __init rpcmouse_init(void) static int __init rpcmouse_init(void)
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
* $Id: rpckbd.c,v 1.7 2001/09/25 10:12:07 vojtech Exp $ * $Id: rpckbd.c,v 1.7 2001/09/25 10:12:07 vojtech Exp $
* *
* Copyright (c) 2000-2001 Vojtech Pavlik * Copyright (c) 2000-2001 Vojtech Pavlik
* * Copyright (c) 2002 Russell King
* Based on the work of:
* Russell King (thanks)
*
* Fixes by Russell King.
*/ */
/* /*
...@@ -44,7 +40,7 @@ ...@@ -44,7 +40,7 @@
#include <asm/hardware/iomd.h> #include <asm/hardware/iomd.h>
#include <asm/system.h> #include <asm/system.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik, Russell King");
MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver"); MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -85,12 +81,12 @@ static int rpckbd_open(struct serio *port) ...@@ -85,12 +81,12 @@ static int rpckbd_open(struct serio *port)
iomd_readb(IOMD_KARTRX); iomd_readb(IOMD_KARTRX);
if (request_irq(IRQ_KEYBOARDRX, rpckbd_rx, 0, "rpckbd", port) != 0) { if (request_irq(IRQ_KEYBOARDRX, rpckbd_rx, 0, "rpckbd", port) != 0) {
printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ!\n"); printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n");
return -EBUSY; return -EBUSY;
} }
if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) { if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) {
printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ!\n"); printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n");
free_irq(IRQ_KEYBOARDRX, NULL); free_irq(IRQ_KEYBOARDRX, NULL);
return -EBUSY; return -EBUSY;
} }
...@@ -110,7 +106,7 @@ static struct serio rpckbd_port = ...@@ -110,7 +106,7 @@ static struct serio rpckbd_port =
.open = rpckbd_open, .open = rpckbd_open,
.close = rpckbd_close, .close = rpckbd_close,
.write = rpckbd_write, .write = rpckbd_write,
.name = "RiscPC PS/2 kbd port", .name = "RiscPC PS/2 kbd port",
.phys = "rpckbd/serio0", .phys = "rpckbd/serio0",
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment