Commit ecddb048 authored by Russell King's avatar Russell King

Merge flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5

into flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5-rmk
parents 32e71bf0 3a3914cc
This diff is collapsed.
......@@ -107,7 +107,7 @@ config MOUSE_AMIGA
The module will be called amimouse.o. If you want to compile it as a
module, say M here and read <file.:Documentation/modules.txt>.
config MOUSE_ACORN
config MOUSE_RISCPC
tristate "Acorn RiscPC mouse"
depends on ARCH_ACORN && INPUT && INPUT_MOUSE
help
......
......@@ -5,7 +5,7 @@
# Each configuration option enables a list of files.
obj-$(CONFIG_MOUSE_AMIGA) += amimouse.o
obj-$(CONFIG_MOUSE_ACORN) += rpcmouse.o
obj-$(CONFIG_MOUSE_RISCPC) += rpcmouse.o
obj-$(CONFIG_MOUSE_INPORT) += inport.o
obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o
obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o
......
......@@ -51,11 +51,12 @@ static struct input_dev rpcmouse_dev = {
static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
{
struct input_dev *dev = dev_id;
short x, y, dx, dy, b;
x = (short) iomd_readl(IOMD_MOUSEX);
y = (short) iomd_readl(IOMD_MOUSEY);
b = (short) (__raw_readl(0xe0310000) >> 4) & 7;
b = (short) (__raw_readl(0xe0310000) ^ 0x70);
dx = x - rpcmouse_lastx;
dy = y - rpcmouse_lasty;
......@@ -63,14 +64,14 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
rpcmouse_lastx = x;
rpcmouse_lasty = y;
input_report_rel(&rpcmouse_dev, REL_X, dx);
input_report_rel(&rpcmouse_dev, REL_Y, dy);
input_report_rel(dev, REL_X, dx);
input_report_rel(dev, REL_Y, -dy);
input_report_key(&rpcmouse_dev, BTN_LEFT, b & 0x10);
input_report_key(&rpcmouse_dev, BTN_MIDDLE, b & 0x20);
input_report_key(&rpcmouse_dev, BTN_RIGHT, b & 0x40);
input_report_key(dev, BTN_LEFT, b & 0x40);
input_report_key(dev, BTN_MIDDLE, b & 0x20);
input_report_key(dev, BTN_RIGHT, b & 0x10);
input_sync(&rpcmouse_dev);
input_sync(dev);
}
static int __init rpcmouse_init(void)
......@@ -80,7 +81,7 @@ static int __init rpcmouse_init(void)
rpcmouse_lastx = (short) iomd_readl(IOMD_MOUSEX);
rpcmouse_lasty = (short) iomd_readl(IOMD_MOUSEY);
if (request_irq(IRQ_VSYNCPULSE, rpcmouse_irq, SA_SHIRQ, "rpcmouse", NULL)) {
if (request_irq(IRQ_VSYNCPULSE, rpcmouse_irq, SA_SHIRQ, "rpcmouse", &rpcmouse_dev)) {
printk(KERN_ERR "rpcmouse: unable to allocate VSYNC interrupt\n");
return -1;
}
......@@ -95,7 +96,7 @@ static int __init rpcmouse_init(void)
static void __exit rpcmouse_exit(void)
{
input_unregister_device(&rpcmouse_dev);
free_irq(IRQ_VSYNCPULSE, NULL);
free_irq(IRQ_VSYNCPULSE, &rpcmouse_dev);
}
module_init(rpcmouse_init);
......
......@@ -83,7 +83,7 @@ config SERIO_PARKBD
The module will be called parkbd.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config SERIO_ACORN
config SERIO_RPCKBD
tristate "Acorn RiscPC keyboard controller"
depends on ARCH_ACORN && SERIO
help
......
......@@ -22,7 +22,6 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/hardware/amba_kmi.h>
#include <asm/mach/amba_kmi.h>
extern struct pt_regs *kbd_pt_regs;
......
......@@ -4,7 +4,9 @@
* Copyright (c) 2000-2001 Vojtech Pavlik
*
* Based on the work of:
* unknown author
* Russell King
*
* Fixes by Russell King.
*/
/*
......@@ -32,44 +34,42 @@
*/
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/serio.h>
#include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/iomd.h>
#include <asm/hardware/iomd.h>
#include <asm/system.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
MODULE_LICENSE("GPL");
static inline void rpckbd_write(unsigned char val)
extern struct pt_regs *kbd_pt_regs;
static int rpckbd_write(struct serio *port, unsigned char val)
{
while (!(iomd_readb(IOMD_KCTRL) & (1 << 7)))
cpu_relax();
iomd_writeb(val, IOMD_KARTTX);
}
static struct serio rpckbd_port =
{
.type = SERIO_8042,
.write = rpckbd_write,
.name = "RiscPC PS/2 kbd port",
.phys = "rpckbd/serio0",
};
return 0;
}
static void rpckbd_rx(int irq, void *dev_id, struct pt_regs *regs)
{
struct serio *port = dev_id;
unsigned int byte;
kbd_pt_regs = regs;
while (iomd_readb(IOMD_KCTRL) & (1 << 5)) {
byte = iomd_readb(IOMD_KARTRX);
serio_interrupt(&rpckbd_port, byte, 0);
serio_interrupt(port, byte, 0);
}
}
......@@ -77,34 +77,52 @@ static void rpckbd_tx(int irq, void *dev_id, struct pt_regs *regs)
{
}
static int __init rpckbd_init(void)
static int rpckbd_open(struct serio *port)
{
/* Reset the keyboard state machine. */
iomd_writeb(0, IOMD_KCTRL);
iomd_writeb(8, IOMD_KCTRL);
iomd_readb(IOMD_KARTRX);
if (request_irq(IRQ_KEYBOARDRX, rpckbd_rx, 0, "rpckbd", NULL) != 0) {
printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ!\n")
if (request_irq(IRQ_KEYBOARDRX, rpckbd_rx, 0, "rpckbd", port) != 0) {
printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n");
return -EBUSY;
}
if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", NULL) != 0) {
printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ!\n")
if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) {
printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n");
free_irq(IRQ_KEYBOARDRX, NULL);
return -EBUSY;
}
register_serio_port(&rpckbd_port);
return 0;
}
static void __exit rpckbd_exit(void)
static void rpckbd_close(struct serio *port)
{
free_irq(IRQ_KEYBOARDRX, port);
free_irq(IRQ_KEYBOARDTX, port);
}
static struct serio rpckbd_port =
{
free_irq(IRQ_KEYBOARDRX, NULL);
free_irq(IRQ_KEYBOARDTX, NULL);
.type = SERIO_8042,
.open = rpckbd_open,
.close = rpckbd_close,
.write = rpckbd_write,
.name = "RiscPC PS/2 kbd port",
.phys = "rpckbd/serio0",
};
unregister_serio_port(&rpckbd_port);
static int __init rpckbd_init(void)
{
serio_register_port(&rpckbd_port);
return 0;
}
static void __exit rpckbd_exit(void)
{
serio_unregister_port(&rpckbd_port);
}
module_init(rpckbd_init);
......
......@@ -551,7 +551,7 @@ static void mtd_notify_add(struct mtd_info* mtd)
disk->major = MAJOR_NR;
disk->first_minor = mtd->index;
disk->fops = &mtd_fops;
sprintf(disk->disk_name, "mtd%d", mtd->index);
sprintf(disk->disk_name, "mtdblock%d", mtd->index);
mtddisk[mtd->index] = disk;
set_capacity(disk, mtd->size / 512);
......
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