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
nexedi
linux
Commits
a7604c37
Commit
a7604c37
authored
Nov 05, 2002
by
Vojtech Pavlik
Browse files
Options
Browse Files
Download
Plain Diff
Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input
parents
9fa0108b
e5a84efa
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
110 additions
and
152 deletions
+110
-152
drivers/input/keyboard/atkbd.c
drivers/input/keyboard/atkbd.c
+18
-9
drivers/input/mouse/Makefile
drivers/input/mouse/Makefile
+1
-1
drivers/input/mouse/psmouse.c
drivers/input/mouse/psmouse.c
+21
-1
drivers/input/mouse/rpcmouse.c
drivers/input/mouse/rpcmouse.c
+19
-9
drivers/input/serio/rpckbd.c
drivers/input/serio/rpckbd.c
+40
-22
drivers/input/serio/serio.c
drivers/input/serio/serio.c
+4
-3
drivers/usb/input/hid-input.c
drivers/usb/input/hid-input.c
+1
-1
drivers/usb/input/usbkbd.c
drivers/usb/input/usbkbd.c
+3
-1
drivers/usb/input/usbmouse.c
drivers/usb/input/usbmouse.c
+3
-1
include/linux/logibusmouse.h
include/linux/logibusmouse.h
+0
-104
No files found.
drivers/input/keyboard/atkbd.c
View file @
a7604c37
...
...
@@ -379,15 +379,6 @@ static int atkbd_probe(struct atkbd *atkbd)
if
(
atkbd_command
(
atkbd
,
NULL
,
ATKBD_CMD_RESET_BAT
))
printk
(
KERN_WARNING
"atkbd.c: keyboard reset failed
\n
"
);
/*
* Next we check we can set LEDs on the keyboard. This should work on every
* keyboard out there. It also turns the LEDs off, which we want anyway.
*/
param
[
0
]
=
0
;
if
(
atkbd_command
(
atkbd
,
param
,
ATKBD_CMD_SETLEDS
))
return
-
1
;
/*
* Then we check the keyboard ID. We should get 0xab83 under normal conditions.
* Some keyboards report different values, but the first byte is always 0xab or
...
...
@@ -395,9 +386,19 @@ static int atkbd_probe(struct atkbd *atkbd)
*/
if
(
atkbd_command
(
atkbd
,
param
,
ATKBD_CMD_GETID
))
{
/*
* If the get ID command failed, we check if we can at least set the LEDs on
* the keyboard. This should work on every keyboard out there. It also turns
* the LEDs off, which we want anyway.
*/
param
[
0
]
=
0
;
if
(
atkbd_command
(
atkbd
,
param
,
ATKBD_CMD_SETLEDS
))
return
-
1
;
atkbd
->
id
=
0xabba
;
return
0
;
}
if
(
param
[
0
]
!=
0xab
&&
param
[
0
]
!=
0xac
)
return
-
1
;
atkbd
->
id
=
param
[
0
]
<<
8
;
...
...
@@ -405,6 +406,14 @@ static int atkbd_probe(struct atkbd *atkbd)
return
-
1
;
atkbd
->
id
|=
param
[
0
];
/*
* Set the LEDs to a defined state.
*/
param
[
0
]
=
0
;
if
(
atkbd_command
(
atkbd
,
param
,
ATKBD_CMD_SETLEDS
))
return
-
1
;
/*
* Disable autorepeat. We don't need it, as we do it in software anyway,
* because that way can get faster repeat, and have less system load (less
...
...
drivers/input/mouse/Makefile
View file @
a7604c37
...
...
@@ -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
...
...
drivers/input/mouse/psmouse.c
View file @
a7604c37
...
...
@@ -311,6 +311,26 @@ static int psmouse_extensions(struct psmouse *psmouse)
if
(
psmouse_noext
)
return
PSMOUSE_PS2
;
/*
* Try Synaptics TouchPad magic ID
*/
param
[
0
]
=
0
;
psmouse_command
(
psmouse
,
param
,
PSMOUSE_CMD_SETRES
);
psmouse_command
(
psmouse
,
param
,
PSMOUSE_CMD_SETRES
);
psmouse_command
(
psmouse
,
param
,
PSMOUSE_CMD_SETRES
);
psmouse_command
(
psmouse
,
param
,
PSMOUSE_CMD_SETRES
);
psmouse_command
(
psmouse
,
param
,
PSMOUSE_CMD_GETINFO
);
if
(
param
[
1
]
==
0x47
)
{
/* We could do more here. But it's sufficient just
to stop the subsequent probes from screwing the
thing up. */
psmouse
->
vendor
=
"Synaptics"
;
psmouse
->
name
=
"TouchPad"
;
return
PSMOUSE_PS2
;
}
/*
* Try Genius NetMouse magic init.
*/
...
...
@@ -348,7 +368,7 @@ static int psmouse_extensions(struct psmouse *psmouse)
int
i
;
static
int
logitech_4btn
[]
=
{
12
,
40
,
41
,
42
,
43
,
52
,
73
,
80
,
-
1
};
static
int
logitech_wheel
[]
=
{
52
,
75
,
76
,
80
,
81
,
83
,
88
,
-
1
};
static
int
logitech_wheel
[]
=
{
52
,
53
,
75
,
76
,
80
,
81
,
83
,
88
,
-
1
};
static
int
logitech_ps2pp
[]
=
{
12
,
13
,
40
,
41
,
42
,
43
,
50
,
51
,
52
,
53
,
73
,
75
,
76
,
80
,
81
,
83
,
88
,
96
,
97
,
-
1
};
psmouse
->
vendor
=
"Logitech"
;
...
...
drivers/input/mouse/rpcmouse.c
View file @
a7604c37
...
...
@@ -34,6 +34,7 @@ MODULE_DESCRIPTION("Acorn RiscPC mouse driver");
MODULE_LICENSE
(
"GPL"
);
static
short
rpcmouse_lastx
,
rpcmouse_lasty
;
static
unsigned
int
rpcmouse_lastb
;
static
struct
input_dev
rpcmouse_dev
=
{
.
evbit
=
{
BIT
(
EV_KEY
)
|
BIT
(
EV_REL
)
},
...
...
@@ -51,11 +52,12 @@ static struct input_dev rpcmouse_dev = {
static
void
rpcmouse_irq
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
short
x
,
y
,
dx
,
dy
,
b
;
struct
input_dev
*
dev
=
dev_id
;
short
x
,
y
,
dx
,
dy
;
unsigned
int
b
;
x
=
(
short
)
iomd_readl
(
IOMD_MOUSEX
);
y
=
(
short
)
iomd_readl
(
IOMD_MOUSEY
);
b
=
(
short
)
(
__raw_readl
(
0xe0310000
)
>>
4
)
&
7
;
dx
=
x
-
rpcmouse_lastx
;
dy
=
y
-
rpcmouse_lasty
;
...
...
@@ -63,14 +65,22 @@ 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
);
if
(
dx
)
input_report_rel
(
dev
,
REL_X
,
dx
);
if
(
dy
)
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
);
b
=
__raw_readl
(
0xe0310000
)
^
0x70
;
if
(
b
!=
rpcmouse_lastb
)
{
input_report_key
(
dev
,
BTN_LEFT
,
b
&
0x40
);
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
);
input_sync
(
&
rpcmouse_dev
)
;
rpcmouse_lastb
=
b
;
}
static
int
__init
rpcmouse_init
(
void
)
...
...
@@ -80,7 +90,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
;
}
...
...
drivers/input/serio/rpckbd.c
View file @
a7604c37
...
...
@@ -4,7 +4,9 @@
* Copyright (c) 2000-2001 Vojtech Pavlik
*
* Based on the work of:
* unknown author
* Russell King (thanks)
*
* 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
=
{
.
type
=
SERIO_8042
,
.
open
=
rpckbd_open
,
.
close
=
rpckbd_close
,
.
write
=
rpckbd_write
,
.
name
=
"RiscPC PS/2 kbd port"
,
.
phys
=
"rpckbd/serio0"
,
};
static
int
__init
rpckbd_init
(
void
)
{
free_irq
(
IRQ_KEYBOARDRX
,
NULL
);
free_irq
(
IRQ_KEYBOARDTX
,
NULL
);
serio_register_port
(
&
rpckbd_port
);
return
0
;
}
unregister_serio_port
(
&
rpckbd_port
);
static
void
__exit
rpckbd_exit
(
void
)
{
serio_unregister_port
(
&
rpckbd_port
);
}
module_init
(
rpckbd_init
);
...
...
drivers/input/serio/serio.c
View file @
a7604c37
...
...
@@ -115,7 +115,7 @@ static int serio_thread(void *nothing)
refrigerator
(
PF_IOTHREAD
);
}
while
(
!
signal_pending
(
current
));
printk
(
KERN_DEBUG
"serio: kseriod exiting"
);
printk
(
KERN_DEBUG
"serio: kseriod exiting
\n
"
);
unlock_kernel
();
complete_and_exit
(
&
serio_exited
,
0
);
...
...
@@ -139,8 +139,9 @@ void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags
{
if
(
serio
->
dev
&&
serio
->
dev
->
interrupt
)
serio
->
dev
->
interrupt
(
serio
,
data
,
flags
);
else
serio_rescan
(
serio
);
else
if
(
!
flags
)
serio_rescan
(
serio
);
}
void
serio_register_port
(
struct
serio
*
serio
)
...
...
drivers/usb/input/hid-input.c
View file @
a7604c37
...
...
@@ -348,7 +348,7 @@ static void hidinput_configure_usage(struct hid_device *device, struct hid_field
set_bit
(
usage
->
type
,
input
->
evbit
);
while
(
usage
->
code
<=
max
&&
test_and_set_bit
(
usage
->
code
,
bit
))
{
usage
->
code
=
find_next_zero_bit
(
bit
,
usage
->
code
,
max
+
1
);
usage
->
code
=
find_next_zero_bit
(
bit
,
max
+
1
,
usage
->
code
);
}
if
(
usage
->
code
>
max
)
return
;
...
...
drivers/usb/input/usbkbd.c
View file @
a7604c37
...
...
@@ -180,8 +180,10 @@ static int usb_kbd_open(struct input_dev *dev)
return
0
;
kbd
->
irq
->
dev
=
kbd
->
usbdev
;
if
(
usb_submit_urb
(
kbd
->
irq
,
GFP_KERNEL
))
if
(
usb_submit_urb
(
kbd
->
irq
,
GFP_KERNEL
))
{
kbd
->
open
--
;
return
-
EIO
;
}
return
0
;
}
...
...
drivers/usb/input/usbmouse.c
View file @
a7604c37
...
...
@@ -104,8 +104,10 @@ static int usb_mouse_open(struct input_dev *dev)
return
0
;
mouse
->
irq
->
dev
=
mouse
->
usbdev
;
if
(
usb_submit_urb
(
mouse
->
irq
,
GFP_KERNEL
))
if
(
usb_submit_urb
(
mouse
->
irq
,
GFP_KERNEL
))
{
mouse
->
open
--
;
return
-
EIO
;
}
return
0
;
}
...
...
include/linux/logibusmouse.h
deleted
100644 → 0
View file @
9fa0108b
#ifndef _LINUX_BUSMOUSE_H
#define _LINUX_BUSMOUSE_H
/*
* linux/include/linux/busmouse.h: header file for Logitech Bus Mouse driver
* by James Banks
*
* based on information gleamed from various mouse drivers on the net
*
* Heavily modified by David giller (rafetmad@oxy.edu)
*
* Minor modifications for Linux 0.96c-pl1 by Nathan Laredo
* gt7080a@prism.gatech.edu (13JUL92)
*
* Microsoft BusMouse support by Teemu Rantanen (tvr@cs.hut.fi) (02AUG92)
*
* Microsoft Bus Mouse support modified by Derrick Cole (cole@concert.net)
* 8/28/92
*
* Microsoft Bus Mouse support folded into 0.97pl4 code
* by Peter Cervasio (pete%q106fm.uucp@wupost.wustl.edu) (08SEP92)
* Changes: Logitech and Microsoft support in the same kernel.
* Defined new constants in busmouse.h for MS mice.
* Added int mse_busmouse_type to distinguish busmouse types
* Added a couple of new functions to handle differences in using
* MS vs. Logitech (where the int variable wasn't appropriate).
*
*/
#define MOUSE_IRQ 5
#define LOGITECH_BUSMOUSE 0
/* Minor device # for Logitech */
#define MICROSOFT_BUSMOUSE 2
/* Minor device # for Microsoft */
/*--------- LOGITECH BUSMOUSE ITEMS -------------*/
#define LOGIBM_BASE 0x23c
#define MSE_DATA_PORT 0x23c
#define MSE_SIGNATURE_PORT 0x23d
#define MSE_CONTROL_PORT 0x23e
#define MSE_INTERRUPT_PORT 0x23e
#define MSE_CONFIG_PORT 0x23f
#define LOGIBM_EXTENT 0x4
#define MSE_ENABLE_INTERRUPTS 0x00
#define MSE_DISABLE_INTERRUPTS 0x10
#define MSE_READ_X_LOW 0x80
#define MSE_READ_X_HIGH 0xa0
#define MSE_READ_Y_LOW 0xc0
#define MSE_READ_Y_HIGH 0xe0
/* Magic number used to check if the mouse exists */
#define MSE_CONFIG_BYTE 0x91
#define MSE_DEFAULT_MODE 0x90
#define MSE_SIGNATURE_BYTE 0xa5
/* useful Logitech Mouse macros */
#define MSE_INT_OFF() outb(MSE_DISABLE_INTERRUPTS, MSE_CONTROL_PORT)
#define MSE_INT_ON() outb(MSE_ENABLE_INTERRUPTS, MSE_CONTROL_PORT)
/*--------- MICROSOFT BUSMOUSE ITEMS -------------*/
#define MSBM_BASE 0x23d
#define MS_MSE_DATA_PORT 0x23d
#define MS_MSE_SIGNATURE_PORT 0x23e
#define MS_MSE_CONTROL_PORT 0x23c
#define MS_MSE_CONFIG_PORT 0x23f
#define MSBM_EXTENT 0x3
#define MS_MSE_ENABLE_INTERRUPTS 0x11
#define MS_MSE_DISABLE_INTERRUPTS 0x10
#define MS_MSE_READ_BUTTONS 0x00
#define MS_MSE_READ_X 0x01
#define MS_MSE_READ_Y 0x02
#define MS_MSE_START 0x80
#define MS_MSE_COMMAND_MODE 0x07
/* useful microsoft busmouse macros */
#define MS_MSE_INT_OFF() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
outb(MS_MSE_DISABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
#define MS_MSE_INT_ON() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
outb(MS_MSE_ENABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
struct
mouse_status
{
unsigned
char
buttons
;
unsigned
char
latch_buttons
;
int
dx
;
int
dy
;
int
present
;
int
ready
;
int
active
;
wait_queue_head_t
wait
;
struct
fasync_struct
*
fasyncptr
;
};
/* Function Prototypes */
#endif
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