diff options
author | Joshua Cov <joshuacov@googlemail.com> | 2012-04-13 21:08:26 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-05-08 14:19:41 -0700 |
commit | b2d0b7a061bfddd27155c7dcd53f365d9dc0c7c3 (patch) | |
tree | 8063c6df479723b7adc509ee2aad728889faa9a4 /arch/x86/include/asm/kbdleds.h | |
parent | c2c21e9bb17549e8add4ff76931bcec2e2d3ad48 (diff) | |
download | talos-op-linux-b2d0b7a061bfddd27155c7dcd53f365d9dc0c7c3.tar.gz talos-op-linux-b2d0b7a061bfddd27155c7dcd53f365d9dc0c7c3.zip |
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>
Diffstat (limited to 'arch/x86/include/asm/kbdleds.h')
-rw-r--r-- | arch/x86/include/asm/kbdleds.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kbdleds.h b/arch/x86/include/asm/kbdleds.h new file mode 100644 index 000000000000..f27ac5ff597d --- /dev/null +++ b/arch/x86/include/asm/kbdleds.h @@ -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 */ |