-
Notifications
You must be signed in to change notification settings - Fork 54.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keyboard: Use BIOS Keyboard variable to set Numlock
The PC BIOS does provide a NUMLOCK flag containing the desired state of this LED. This patch sets the current state according to the data in the bios. [ hpa: fixed __weak declaration without definition, changed "inline" to "static inline" ] Signed-Off-By: Joshua Cov <joshuacov@googlemail.com> Link: http://lkml.kernel.org/r/CAKL7Q7rvq87TNS1T_Km8fW_5OzS%2BSbYazLXKxW-6ztOxo3zorg@mail.gmail.com Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
- Loading branch information
Joshua Cov
authored and
H. Peter Anvin
committed
May 8, 2012
1 parent
c2c21e9
commit b2d0b7a
Showing
5 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef _ASM_PARISC_KBDLEDS_H | ||
#define _ASM_PARISC_KBDLEDS_H | ||
|
||
/* | ||
* On HIL keyboards of PARISC machines there is no NumLock key and | ||
* everyone expects the keypad to be used for numbers. That's why | ||
* we can safely turn on the NUMLOCK bit. | ||
*/ | ||
|
||
static inline int kbd_defleds(void) | ||
{ | ||
#if defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD) | ||
return 1 << VC_NUMLOCK; | ||
#else | ||
return 0; | ||
#endif | ||
} | ||
|
||
#endif /* _ASM_PARISC_KBDLEDS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef _ASM_X86_KBDLEDS_H | ||
#define _ASM_X86_KBDLEDS_H | ||
|
||
/* | ||
* Some laptops take the 789uiojklm,. keys as number pad when NumLock is on. | ||
* This seems a good reason to start with NumLock off. That's why on X86 we | ||
* ask the bios for the correct state. | ||
*/ | ||
|
||
#include <asm/setup.h> | ||
|
||
static inline int kbd_defleds(void) | ||
{ | ||
return boot_params.kbd_status & 0x20 ? (1 << VC_NUMLOCK) : 0; | ||
} | ||
|
||
#endif /* _ASM_X86_KBDLEDS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters