OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-mips64/] [keyboard.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * This file is subject to the terms and conditions of the GNU General Public
3
 * License.  See the file "COPYING" in the main directory of this archive
4
 * for more details.
5
 *
6
 * Copyright (C) 1994 - 1999 Ralf Baechle
7
 */
8
#ifndef _ASM_KEYBOARD_H
9
#define _ASM_KEYBOARD_H
10
 
11
#ifdef __KERNEL__
12
 
13
#include <linux/config.h>
14
#include <linux/delay.h>
15
#include <linux/ioport.h>
16
#include <linux/kd.h>
17
#include <linux/pm.h>
18
 
19
#define DISABLE_KBD_DURING_INTERRUPTS 0
20
 
21
#ifdef CONFIG_PC_KEYB
22
 
23
extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
24
extern int pckbd_getkeycode(unsigned int scancode);
25
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
26
                           char raw_mode);
27
extern char pckbd_unexpected_up(unsigned char keycode);
28
extern void pckbd_leds(unsigned char leds);
29
extern void pckbd_init_hw(void);
30
extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *);
31
extern pm_callback pm_kbd_request_override;
32
extern unsigned char pckbd_sysrq_xlate[128];
33
extern void kbd_forward_char (int ch);
34
 
35
#define kbd_setkeycode          pckbd_setkeycode
36
#define kbd_getkeycode          pckbd_getkeycode
37
#define kbd_translate           pckbd_translate
38
#define kbd_unexpected_up       pckbd_unexpected_up
39
#define kbd_leds                pckbd_leds
40
#define kbd_init_hw             pckbd_init_hw
41
#define kbd_sysrq_xlate         pckbd_sysrq_xlate
42
 
43
#define SYSRQ_KEY 0x54
44
 
45
/* Some stoneage hardware needs delays after some operations.  */
46
#define kbd_pause() do { } while(0)
47
 
48
struct kbd_ops {
49
        /* Keyboard driver resource allocation  */
50
        void (*kbd_request_region)(void);
51
        int (*kbd_request_irq)(void (*handler)(int, void *, struct pt_regs *));
52
 
53
        /* PSaux driver resource management  */
54
        int (*aux_request_irq)(void (*handler)(int, void *, struct pt_regs *));
55
        void (*aux_free_irq)(void);
56
 
57
        /* Methods to access the keyboard processor's I/O registers  */
58
        unsigned char (*kbd_read_input)(void);
59
        void (*kbd_write_output)(unsigned char val);
60
        void (*kbd_write_command)(unsigned char val);
61
        unsigned char (*kbd_read_status)(void);
62
};
63
 
64
extern struct kbd_ops *kbd_ops;
65
#define kbd_controller_present() (kbd_ops != 0)
66
 
67
/* Do the actual calls via kbd_ops vector  */
68
#define kbd_request_region() kbd_ops->kbd_request_region()
69
#define kbd_request_irq(handler) kbd_ops->kbd_request_irq(handler)
70
 
71
#define aux_request_irq(hand, dev_id) kbd_ops->aux_request_irq(hand)
72
#define aux_free_irq(dev_id) kbd_ops->aux_free_irq()
73
 
74
#define kbd_read_input() kbd_ops->kbd_read_input()
75
#define kbd_write_output(val) kbd_ops->kbd_write_output(val)
76
#define kbd_write_command(val) kbd_ops->kbd_write_command(val)
77
#define kbd_read_status() kbd_ops->kbd_read_status()
78
 
79
#else
80
 
81
extern int kbd_setkeycode(unsigned int scancode, unsigned int keycode);
82
extern int kbd_getkeycode(unsigned int scancode);
83
extern int kbd_translate(unsigned char scancode, unsigned char *keycode,
84
        char raw_mode);
85
extern char kbd_unexpected_up(unsigned char keycode);
86
extern void kbd_leds(unsigned char leds);
87
extern void kbd_init_hw(void);
88
extern unsigned char *kbd_sysrq_xlate;
89
 
90
extern unsigned char kbd_sysrq_key;
91
#define SYSRQ_KEY kbd_sysrq_key
92
 
93
#endif
94
 
95
#endif /* __KERNEL */
96
 
97
#endif /* _ASM_KEYBOARD_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.