Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f076d8e8
Commit
f076d8e8
authored
Jul 08, 2002
by
Vojtech Pavlik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes (to make it compile), cleanups (in comments) for Amiga and
Acorn RiscPC mice.
parent
476627b5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
66 deletions
+31
-66
drivers/input/mouse/amimouse.c
drivers/input/mouse/amimouse.c
+10
-28
drivers/input/mouse/rpcmouse.c
drivers/input/mouse/rpcmouse.c
+21
-38
No files found.
drivers/input/mouse/amimouse.c
View file @
f076d8e8
/*
*
$Id: amimouse.c,v 1.9 2001/09/25 10:12:07 vojtech Exp $
*
Amiga mouse driver for Linux/m68k
*
* Copyright (c) 2000-200
1
Vojtech Pavlik
* Copyright (c) 2000-200
2
Vojtech Pavlik
*
* Based on the work of:
* Michael Rausch James Banks
* Matther Dillon David Giller
* Nathan Laredo Linus Torvalds
* Johan Myreen Jes Sorensen
* Russel King
*/
/*
* Amiga mouse driver for Linux/m68k
* Russell King
*/
/*
* 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
* (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
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation
*/
#include <linux/module.h>
...
...
@@ -70,10 +52,10 @@ static void amimouse_interrupt(int irq, void *dummy, struct pt_regs *fp)
dx
=
nx
-
amimouse_lastx
;
dy
=
ny
-
amimouse_lasty
;
if
(
dx
<
-
127
)
dx
=
(
256
+
nx
)
-
lastx
;
if
(
dx
>
127
)
dx
=
(
nx
-
256
)
-
lastx
;
if
(
dy
<
-
127
)
dy
=
(
256
+
ny
)
-
lasty
;
if
(
dy
>
127
)
dy
=
(
ny
-
256
)
-
lasty
;
if
(
dx
<
-
127
)
dx
=
(
256
+
nx
)
-
amimouse_
lastx
;
if
(
dx
>
127
)
dx
=
(
nx
-
256
)
-
amimouse_
lastx
;
if
(
dy
<
-
127
)
dy
=
(
256
+
ny
)
-
amimouse_
lasty
;
if
(
dy
>
127
)
dy
=
(
ny
-
256
)
-
amimouse_
lasty
;
amimouse_lastx
=
nx
;
amimouse_lasty
=
ny
;
...
...
drivers/input/mouse/rpcmouse.c
View file @
f076d8e8
/*
*
$Id: rpcmouse.c,v 1.11 2001/09/25 10:12:07 vojtech Exp $
*
Acorn RiscPC mouse driver for Linux/ARM
*
* Copyright (c) 2000-2001 Vojtech Pavlik
* Copyright (c) 2000-2002 Vojtech Pavlik
* Copyright (C) 1996-1998 Russell King
*
* Based on the work of:
* Russel King
*/
/*
* Acorn RiscPC mouse driver for Linux/ARM
*/
/*
* 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
* (at your option) any later version.
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* 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
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
* This handles the Acorn RiscPCs mouse. We basically have a couple of
* hardware registers that track the sensor count for the X-Y movement and
* another register holding the button state. On every VSYNC interrupt we read
* the complete state and then work out if something has changed.
*/
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
...
...
@@ -41,14 +26,12 @@
#include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/iomd.h>
#include <asm/
hardware/
iomd.h>
MODULE_AUTHOR
(
"Vojtech Pavlik
<vojtech@ucw.cz>
"
);
MODULE_AUTHOR
(
"Vojtech Pavlik
, Russell King
"
);
MODULE_DESCRIPTION
(
"Acorn RiscPC mouse driver"
);
MODULE_LICENSE
(
"GPL"
);
#define IOMD_MOUSEBTN 0x800C4000
static
short
rpcmouse_lastx
,
rpcmouse_lasty
;
static
struct
input_dev
rpcmouse_dev
=
{
...
...
@@ -67,9 +50,9 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
{
short
x
,
y
,
dx
,
dy
,
b
;
x
=
(
short
)
i
n
l
(
IOMD_MOUSEX
);
y
=
(
short
)
i
n
l
(
IOMD_MOUSEY
);
b
=
(
short
)
inl
(
IOMD_MOUSEBTN
)
;
x
=
(
short
)
i
omd_read
l
(
IOMD_MOUSEX
);
y
=
(
short
)
i
omd_read
l
(
IOMD_MOUSEY
);
b
=
(
short
)
(
__raw_readl
(
0xe0310000
)
>>
4
)
&
7
;
dx
=
x
-
rpcmouse_lastx
;
dy
=
y
-
rpcmouse_lasty
;
...
...
@@ -80,15 +63,15 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
input_report_rel
(
&
rpcmouse_dev
,
REL_X
,
dx
);
input_report_rel
(
&
rpcmouse_dev
,
REL_Y
,
dy
);
input_report_key
(
&
ami
mouse_dev
,
BTN_LEFT
,
buttons
&
0x10
);
input_report_key
(
&
ami
mouse_dev
,
BTN_MIDDLE
,
buttons
&
0x20
);
input_report_key
(
&
ami
mouse_dev
,
BTN_RIGHT
,
buttons
&
0x40
);
input_report_key
(
&
rpc
mouse_dev
,
BTN_LEFT
,
buttons
&
0x10
);
input_report_key
(
&
rpc
mouse_dev
,
BTN_MIDDLE
,
buttons
&
0x20
);
input_report_key
(
&
rpc
mouse_dev
,
BTN_RIGHT
,
buttons
&
0x40
);
}
static
int
__init
rpcmouse_init
(
void
)
{
rpcmouse_lastx
=
(
short
)
i
n
l
(
IOMD_MOUSEX
);
rpcmouse_lasty
=
(
short
)
i
n
l
(
IOMD_MOUSEY
);
rpcmouse_lastx
=
(
short
)
i
omd_read
l
(
IOMD_MOUSEX
);
rpcmouse_lasty
=
(
short
)
i
omd_read
l
(
IOMD_MOUSEY
);
if
(
request_irq
(
IRQ_VSYNCPULSE
,
rpcmouse_irq
,
SA_SHIRQ
,
"rpcmouse"
,
NULL
))
{
printk
(
KERN_ERR
"rpcmouse: unable to allocate VSYNC interrupt
\n
"
);
...
...
@@ -96,7 +79,7 @@ static int __init rpcmouse_init(void)
}
input_register_device
(
&
rpcmouse_dev
);
printk
(
KERN_INFO
"input
%d
: Acorn RiscPC mouse irq %d"
,
IRQ_VSYNCPULSE
);
printk
(
KERN_INFO
"input: Acorn RiscPC mouse irq %d"
,
IRQ_VSYNCPULSE
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment