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
34151589
Commit
34151589
authored
Aug 26, 2002
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Plain Diff
Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-input
parents
541d91b8
0ceeaa7b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
11 deletions
+76
-11
drivers/char/Config.in
drivers/char/Config.in
+1
-1
drivers/char/keyboard.c
drivers/char/keyboard.c
+68
-9
drivers/input/Config.in
drivers/input/Config.in
+1
-1
drivers/input/serio/i8042.c
drivers/input/serio/i8042.c
+6
-0
No files found.
drivers/char/Config.in
View file @
34151589
...
@@ -57,7 +57,7 @@ if [ "$CONFIG_IT8712" = "y" ]; then
...
@@ -57,7 +57,7 @@ if [ "$CONFIG_IT8712" = "y" ]; then
bool 'Enable Qtronix 990P Keyboard Support' CONFIG_QTRONIX_KEYBOARD
bool 'Enable Qtronix 990P Keyboard Support' CONFIG_QTRONIX_KEYBOARD
if [ "$CONFIG_QTRONIX_KEYBOARD" = "y" ]; then
if [ "$CONFIG_QTRONIX_KEYBOARD" = "y" ]; then
define_bool CONFIG_IT8172_CIR y
define_bool CONFIG_IT8172_CIR y
else
fi
bool 'Enable Smart Card Reader 0 Support ' CONFIG_IT8172_SCR0
bool 'Enable Smart Card Reader 0 Support ' CONFIG_IT8172_SCR0
bool 'Enable Smart Card Reader 1 Support ' CONFIG_IT8172_SCR1
bool 'Enable Smart Card Reader 1 Support ' CONFIG_IT8172_SCR1
fi
fi
...
...
drivers/char/keyboard.c
View file @
34151589
...
@@ -40,7 +40,6 @@
...
@@ -40,7 +40,6 @@
#include <linux/kbd_diacr.h>
#include <linux/kbd_diacr.h>
#include <linux/vt_kern.h>
#include <linux/vt_kern.h>
#include <linux/sysrq.h>
#include <linux/sysrq.h>
#include <linux/pm.h>
#include <linux/input.h>
#include <linux/input.h>
static
void
kbd_disconnect
(
struct
input_handle
*
handle
);
static
void
kbd_disconnect
(
struct
input_handle
*
handle
);
...
@@ -50,6 +49,22 @@ extern void ctrl_alt_del(void);
...
@@ -50,6 +49,22 @@ extern void ctrl_alt_del(void);
* Exported functions/variables
* Exported functions/variables
*/
*/
#ifndef KBD_DEFMODE
#define KBD_DEFMODE ((1 << VC_REPEAT) | (1 << VC_META))
#endif
#ifndef KBD_DEFLEDS
/*
* Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
* This seems a good reason to start with NumLock off.
*/
#define KBD_DEFLEDS 0
#endif
#ifndef KBD_DEFLOCK
#define KBD_DEFLOCK 0
#endif
struct
pt_regs
*
kbd_pt_regs
;
struct
pt_regs
*
kbd_pt_regs
;
void
compute_shiftstate
(
void
);
void
compute_shiftstate
(
void
);
...
@@ -94,6 +109,7 @@ const int NR_TYPES = ARRAY_SIZE(max_vals);
...
@@ -94,6 +109,7 @@ const int NR_TYPES = ARRAY_SIZE(max_vals);
struct
kbd_struct
kbd_table
[
MAX_NR_CONSOLES
];
struct
kbd_struct
kbd_table
[
MAX_NR_CONSOLES
];
static
struct
kbd_struct
*
kbd
=
kbd_table
;
static
struct
kbd_struct
*
kbd
=
kbd_table
;
static
struct
kbd_struct
kbd0
;
int
spawnpid
,
spawnsig
;
int
spawnpid
,
spawnsig
;
...
@@ -124,6 +140,21 @@ static struct ledptr {
...
@@ -124,6 +140,21 @@ static struct ledptr {
unsigned
char
valid
:
1
;
unsigned
char
valid
:
1
;
}
ledptrs
[
3
];
}
ledptrs
[
3
];
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
unsigned
char
kbd_sysrq_xlate
[
128
]
=
"
\000\033
1234567890-=
\177\t
"
/* 0x00 - 0x0f */
"qwertyuiop[]
\r\000
as"
/* 0x10 - 0x1f */
"dfghjkl;'`
\000\\
zxcv"
/* 0x20 - 0x2f */
"bnm,./
\000
*
\000
\000\201\202\203\204\205
"
/* 0x30 - 0x3f */
"
\206\207\210\211\212\000\000
789-456+1"
/* 0x40 - 0x4f */
"230
\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000
"
/* 0x50 - 0x5f */
"
\r\000
/"
;
/* 0x60 - 0x6f */
static
int
sysrq_down
;
#endif
static
int
sysrq_alt
;
/*
/*
* Translation of scancodes to keycodes. We set them on only the first attached
* Translation of scancodes to keycodes. We set them on only the first attached
* keyboard - for per-keyboard setting, /dev/input/event is more useful.
* keyboard - for per-keyboard setting, /dev/input/event is more useful.
...
@@ -329,7 +360,7 @@ void compute_shiftstate(void)
...
@@ -329,7 +360,7 @@ void compute_shiftstate(void)
if
(
!
key_down
[
i
])
if
(
!
key_down
[
i
])
continue
;
continue
;
k
=
i
*
BITS_PER_LONG
;
k
=
i
*
BITS_PER_LONG
;
for
(
j
=
0
;
j
<
BITS_PER_LONG
;
j
++
,
k
++
)
{
for
(
j
=
0
;
j
<
BITS_PER_LONG
;
j
++
,
k
++
)
{
...
@@ -877,8 +908,6 @@ DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
...
@@ -877,8 +908,6 @@ DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC)
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC)
static
int
x86_sysrq_alt
=
0
;
static
unsigned
short
x86_keycodes
[
256
]
=
static
unsigned
short
x86_keycodes
[
256
]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
...
@@ -918,7 +947,7 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
...
@@ -918,7 +947,7 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
return
0
;
return
0
;
}
}
if
(
keycode
==
KEY_SYSRQ
&&
x86_
sysrq_alt
)
{
if
(
keycode
==
KEY_SYSRQ
&&
sysrq_alt
)
{
put_queue
(
vc
,
0x54
|
up_flag
);
put_queue
(
vc
,
0x54
|
up_flag
);
return
0
;
return
0
;
}
}
...
@@ -933,9 +962,6 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
...
@@ -933,9 +962,6 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
put_queue
(
vc
,
0x37
|
up_flag
);
put_queue
(
vc
,
0x37
|
up_flag
);
}
}
if
(
keycode
==
KEY_LEFTALT
||
keycode
==
KEY_RIGHTALT
)
x86_sysrq_alt
=
!
up_flag
;
return
0
;
return
0
;
}
}
...
@@ -973,10 +999,26 @@ void kbd_keycode(unsigned int keycode, int down)
...
@@ -973,10 +999,26 @@ void kbd_keycode(unsigned int keycode, int down)
kbd
=
kbd_table
+
fg_console
;
kbd
=
kbd_table
+
fg_console
;
if
(
keycode
==
KEY_LEFTALT
||
keycode
==
KEY_RIGHTALT
)
sysrq_alt
=
down
;
rep
=
(
down
==
2
);
if
((
raw_mode
=
(
kbd
->
kbdmode
==
VC_RAW
)))
if
((
raw_mode
=
(
kbd
->
kbdmode
==
VC_RAW
)))
if
(
emulate_raw
(
vc
,
keycode
,
!
down
<<
7
))
if
(
emulate_raw
(
vc
,
keycode
,
!
down
<<
7
))
printk
(
KERN_WARNING
"keyboard.c: can't emulate rawmode for keycode %d
\n
"
,
keycode
);
printk
(
KERN_WARNING
"keyboard.c: can't emulate rawmode for keycode %d
\n
"
,
keycode
);
#ifdef CONFIG_MAGIC_SYSRQ
/* Handle the SysRq Hack */
if
(
keycode
==
KEY_SYSRQ
&&
!
rep
)
{
sysrq_down
=
sysrq_alt
&&
down
;
return
;
}
if
(
sysrq_down
&&
down
&&
!
rep
)
{
handle_sysrq
(
kbd_sysrq_xlate
[
keycode
],
kbd_pt_regs
,
tty
);
return
;
}
#endif
if
(
kbd
->
kbdmode
==
VC_MEDIUMRAW
)
{
if
(
kbd
->
kbdmode
==
VC_MEDIUMRAW
)
{
/*
/*
* This is extended medium raw mode, with keys above 127
* This is extended medium raw mode, with keys above 127
...
@@ -997,7 +1039,10 @@ void kbd_keycode(unsigned int keycode, int down)
...
@@ -997,7 +1039,10 @@ void kbd_keycode(unsigned int keycode, int down)
raw_mode
=
1
;
raw_mode
=
1
;
}
}
rep
=
(
down
==
2
);
if
(
down
)
set_bit
(
keycode
,
key_down
);
else
clear_bit
(
keycode
,
key_down
);
if
(
rep
&&
(
!
vc_kbd_mode
(
kbd
,
VC_REPEAT
)
||
(
tty
&&
if
(
rep
&&
(
!
vc_kbd_mode
(
kbd
,
VC_REPEAT
)
||
(
tty
&&
(
!
L_ECHO
(
tty
)
&&
tty
->
driver
.
chars_in_buffer
(
tty
)))))
{
(
!
L_ECHO
(
tty
)
&&
tty
->
driver
.
chars_in_buffer
(
tty
)))))
{
...
@@ -1053,6 +1098,8 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
...
@@ -1053,6 +1098,8 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
return
;
return
;
kbd_keycode
(
keycode
,
down
);
kbd_keycode
(
keycode
,
down
);
tasklet_schedule
(
&
keyboard_tasklet
);
tasklet_schedule
(
&
keyboard_tasklet
);
do_poke_blanked_console
=
1
;
schedule_console_callback
();
}
}
static
char
kbd_name
[]
=
"kbd"
;
static
char
kbd_name
[]
=
"kbd"
;
...
@@ -1121,6 +1168,18 @@ static struct input_handler kbd_handler = {
...
@@ -1121,6 +1168,18 @@ static struct input_handler kbd_handler = {
int
__init
kbd_init
(
void
)
int
__init
kbd_init
(
void
)
{
{
int
i
;
kbd0
.
ledflagstate
=
kbd0
.
default_ledflagstate
=
KBD_DEFLEDS
;
kbd0
.
ledmode
=
LED_SHOW_FLAGS
;
kbd0
.
lockstate
=
KBD_DEFLOCK
;
kbd0
.
slockstate
=
0
;
kbd0
.
modeflags
=
KBD_DEFMODE
;
kbd0
.
kbdmode
=
VC_XLATE
;
for
(
i
=
0
;
i
<
MAX_NR_CONSOLES
;
i
++
)
kbd_table
[
i
]
=
kbd0
;
tasklet_enable
(
&
keyboard_tasklet
);
tasklet_enable
(
&
keyboard_tasklet
);
tasklet_schedule
(
&
keyboard_tasklet
);
tasklet_schedule
(
&
keyboard_tasklet
);
input_register_handler
(
&
kbd_handler
);
input_register_handler
(
&
kbd_handler
);
...
...
drivers/input/Config.in
View file @
34151589
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
mainmenu_option next_comment
mainmenu_option next_comment
comment 'Input device support'
comment 'Input device support'
tristate 'Input core support' CONFIG_INPUT
define_tristate CONFIG_INPUT y
comment 'Userland interfaces'
comment 'Userland interfaces'
dep_tristate ' Mouse interface' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
dep_tristate ' Mouse interface' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
...
...
drivers/input/serio/i8042.c
View file @
34151589
...
@@ -61,6 +61,8 @@ struct timer_list i8042_timer;
...
@@ -61,6 +61,8 @@ struct timer_list i8042_timer;
static
unsigned
long
i8042_start
;
static
unsigned
long
i8042_start
;
#endif
#endif
extern
struct
pt_regs
*
kbd_pt_regs
;
static
unsigned
long
i8042_unxlate_seen
[
128
/
BITS_PER_LONG
];
static
unsigned
long
i8042_unxlate_seen
[
128
/
BITS_PER_LONG
];
static
unsigned
char
i8042_unxlate_table
[
128
]
=
{
static
unsigned
char
i8042_unxlate_table
[
128
]
=
{
0
,
118
,
22
,
30
,
38
,
37
,
46
,
54
,
61
,
62
,
70
,
69
,
78
,
85
,
102
,
13
,
0
,
118
,
22
,
30
,
38
,
37
,
46
,
54
,
61
,
62
,
70
,
69
,
78
,
85
,
102
,
13
,
...
@@ -346,6 +348,10 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -346,6 +348,10 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned
char
str
,
data
;
unsigned
char
str
,
data
;
unsigned
int
dfl
;
unsigned
int
dfl
;
#ifdef CONFIG_VT
kbd_pt_regs
=
regs
;
#endif
spin_lock_irqsave
(
&
i8042_lock
,
flags
);
spin_lock_irqsave
(
&
i8042_lock
,
flags
);
while
((
str
=
i8042_read_status
())
&
I8042_STR_OBF
)
{
while
((
str
=
i8042_read_status
())
&
I8042_STR_OBF
)
{
...
...
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