1/*
2 *  linux/include/asm-arm/keyboard.h
3 *
4 *  Copyright (C) 1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 *  Keyboard driver definitions for ARM
11 */
12#ifndef __ASM_ARM_KEYBOARD_H
13#define __ASM_ARM_KEYBOARD_H
14
15#include <linux/kd.h>
16#include <linux/pm.h>
17
18/*
19 * We provide a unified keyboard interface when in VC_MEDIUMRAW
20 * mode.  This means that all keycodes must be common between
21 * all supported keyboards.  This unfortunately puts us at odds
22 * with the PC keyboard interface chip... but we can't do anything
23 * about that now.
24 */
25#ifdef __KERNEL__
26
27extern int  (*k_setkeycode)(unsigned int, unsigned int);
28extern int  (*k_getkeycode)(unsigned int);
29extern int  (*k_translate)(unsigned char, unsigned char *, char);
30extern char (*k_unexpected_up)(unsigned char);
31extern void (*k_leds)(unsigned char);
32
33
34static inline int kbd_setkeycode(unsigned int sc, unsigned int kc)
35{
36	int ret = -EINVAL;
37
38	if (k_setkeycode)
39		ret = k_setkeycode(sc, kc);
40
41	return ret;
42}
43
44static inline int kbd_getkeycode(unsigned int sc)
45{
46	int ret = -EINVAL;
47
48	if (k_getkeycode)
49		ret = k_getkeycode(sc);
50
51	return ret;
52}
53
54static inline void kbd_leds(unsigned char leds)
55{
56	if (k_leds)
57		k_leds(leds);
58}
59
60extern int k_sysrq_key;
61extern unsigned char *k_sysrq_xlate;
62
63#define SYSRQ_KEY		k_sysrq_key
64#define kbd_sysrq_xlate		k_sysrq_xlate
65#define kbd_translate		k_translate
66#define kbd_unexpected_up	k_unexpected_up
67
68#include <asm/arch/keyboard.h>
69
70#endif /* __KERNEL__ */
71
72#endif /* __ASM_ARM_KEYBOARD_H */
73