summaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/keyboard.c
blob: 05044db496bff68c5c54042aa40ac909e44842ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 *  linux/arch/parisc/kernel/keyboard.c
 *
 *  Alex deVries <adevries@thepuffingroup.com>
 *  Copyright (1999) The Puffin Group
 *  Mostly rewritten by Philipp Rumpf <prumpf@tux.org>
 *  Copyright 2000 Philipp Rumpf
 */

#include <linux/keyboard.h>
#include <asm/keyboard.h>

static int def_setkeycode(unsigned int x, unsigned int y)
{
	return 0;
}

static int def_getkeycode(unsigned int x)
{
	return 0;
}

static int def_translate(unsigned char scancode, unsigned char *keycode,
	char raw)
{
	*keycode = scancode;

	return 1;
}

static char def_unexpected_up(unsigned char c)
{
	return 128;
}

static void def_leds(unsigned char leds)
{
}

static void def_init_hw(void)
{
}

static char def_sysrq_xlate[NR_KEYS];

static struct kbd_ops def_kbd_ops = {
	setkeycode:	def_setkeycode,
	getkeycode:	def_getkeycode,
	translate:	def_translate,
	unexpected_up:	def_unexpected_up,
	leds:		def_leds,
	init_hw:	def_init_hw,

	sysrq_key:	0xff,
	sysrq_xlate:	def_sysrq_xlate,
};

struct kbd_ops *kbd_ops = &def_kbd_ops;

void register_kbd_ops(struct kbd_ops *ops)
{
	if(ops->setkeycode)
		kbd_ops->setkeycode = ops->setkeycode;
	
	if(ops->getkeycode)
		kbd_ops->getkeycode = ops->getkeycode;
	
	if(ops->translate)
		kbd_ops->translate = ops->translate;
	
	if(ops->unexpected_up)
		kbd_ops->unexpected_up = ops->unexpected_up;
	
	if(ops->leds)
		kbd_ops->leds = ops->leds;
	
	if(ops->init_hw)
		kbd_ops->init_hw = ops->init_hw;
	
	kbd_ops->sysrq_key = ops->sysrq_key;
	kbd_ops->sysrq_xlate = ops->sysrq_xlate;
}