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
bb5cc62f
Commit
bb5cc62f
authored
Feb 12, 2003
by
Pete Zaitcev
Committed by
Vojtech Pavlik
Feb 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Let newly connected keyboards pickup the LED state.
parent
8e3039ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
drivers/char/keyboard.c
drivers/char/keyboard.c
+20
-3
No files found.
drivers/char/keyboard.c
View file @
bb5cc62f
...
...
@@ -894,9 +894,9 @@ static inline unsigned char getleds(void)
* Aside from timing (which isn't really that important for
* keyboard interrupts as they happen often), using the software
* interrupt routines for this thing allows us to easily mask
* this when we don't want any of the above to happen.
Not yet
*
used, but this allows for easy and efficient race-condi
tion
*
prevention later on
.
* this when we don't want any of the above to happen.
*
This allows for easy and efficient race-condition preven
tion
*
for kbd_refresh_leds => input_event(dev, EV_LED, ...) => ..
.
*/
static
void
kbd_bh
(
unsigned
long
dummy
)
...
...
@@ -918,6 +918,22 @@ static void kbd_bh(unsigned long dummy)
DECLARE_TASKLET_DISABLED
(
keyboard_tasklet
,
kbd_bh
,
0
);
/*
* This allows a newly plugged keyboard to pick the LED state.
*/
void
kbd_refresh_leds
(
struct
input_handle
*
handle
)
{
unsigned
char
leds
=
ledstate
;
tasklet_disable
(
&
keyboard_tasklet
);
if
(
leds
!=
0xff
)
{
input_event
(
handle
->
dev
,
EV_LED
,
LED_SCROLLL
,
!!
(
leds
&
0x01
));
input_event
(
handle
->
dev
,
EV_LED
,
LED_NUML
,
!!
(
leds
&
0x02
));
input_event
(
handle
->
dev
,
EV_LED
,
LED_CAPSL
,
!!
(
leds
&
0x04
));
}
tasklet_enable
(
&
keyboard_tasklet
);
}
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC)
static
unsigned
short
x86_keycodes
[
256
]
=
...
...
@@ -1160,6 +1176,7 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
handle
->
name
=
kbd_name
;
input_open_device
(
handle
);
kbd_refresh_leds
(
handle
);
return
handle
;
}
...
...
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