Rev 549 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
519 | mauro | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Mauro Marinoni <mauro.marinoni@unipv.it> |
||
10 | * |
||
11 | * |
||
12 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
13 | * |
||
14 | * http://www.sssup.it |
||
15 | * http://retis.sssup.it |
||
16 | * http://shark.sssup.it |
||
17 | */ |
||
18 | |||
19 | #include <kernel/func.h> |
||
20 | |||
21 | /* System */ |
||
22 | extern int input_init(void); |
||
23 | extern int input_exit(void); |
||
24 | |||
25 | extern int serio_init(void); |
||
26 | extern int serio_exit(void); |
||
27 | |||
28 | /* Controllers */ |
||
29 | extern int i8042_init(void); |
||
30 | extern int i8042_exit(void); |
||
31 | |||
32 | /*extern int serport_init(void); |
||
33 | extern int serport_exit(void);*/ |
||
34 | |||
35 | /* Handlers */ |
||
36 | extern int evbug_init(void); |
||
37 | extern int evbug_exit(void); |
||
38 | |||
549 | mauro | 39 | static int input_installed = FALSE; |
40 | static int evbug_installed = FALSE; |
||
519 | mauro | 41 | |
42 | /* Init the Linux Input Layer */ |
||
549 | mauro | 43 | int INPUT26_installed(void) |
44 | { |
||
45 | return input_installed; |
||
46 | } |
||
47 | |||
519 | mauro | 48 | int INPUT26_init() { |
49 | |||
50 | int ret; |
||
51 | |||
52 | if (input_installed == TRUE) return 0; |
||
53 | |||
54 | ret = input_init(); |
||
55 | if (ret) { |
||
56 | printk(KERN_ERR "Input_Init return: %d\n", ret); |
||
57 | return -1; |
||
58 | } |
||
59 | |||
60 | ret = serio_init(); |
||
61 | if (ret) { |
||
62 | printk(KERN_ERR "Serio_Init return: %d\n", ret); |
||
826 | mauro | 63 | return -2; |
519 | mauro | 64 | } |
65 | |||
66 | ret = i8042_init(); |
||
67 | if (ret) { |
||
68 | printk(KERN_ERR "i8042_Init return: %d\n", ret); |
||
826 | mauro | 69 | return -3; |
519 | mauro | 70 | } |
71 | |||
72 | /* TODO |
||
73 | ret = serport_init(); |
||
74 | if (ret) { |
||
75 | printk(KERN_ERR "SerPort_Init return: %d\n", ret); |
||
76 | return -1; |
||
77 | } */ |
||
78 | |||
79 | input_installed = TRUE; |
||
80 | |||
81 | return ret; |
||
82 | } |
||
83 | |||
84 | int INPUT26_close() { |
||
85 | |||
86 | if (input_installed == TRUE) { |
||
87 | i8042_exit(); |
||
88 | serio_exit(); |
||
89 | input_exit(); |
||
90 | |||
91 | return 0; |
||
92 | } else |
||
93 | return -1; |
||
94 | } |
||
95 | |||
538 | mauro | 96 | /* Init the Linux Event Debug Driver */ |
549 | mauro | 97 | int EVBUG26_installed(void) |
98 | { |
||
99 | return evbug_installed; |
||
100 | } |
||
101 | |||
519 | mauro | 102 | int EVBUG26_init() { |
103 | evbug_init(); |
||
104 | |||
549 | mauro | 105 | evbug_installed = TRUE; |
106 | |||
519 | mauro | 107 | return 0; |
108 | } |
||
109 | |||
110 | int EVBUG26_close() { |
||
111 | evbug_exit(); |
||
112 | |||
549 | mauro | 113 | evbug_installed = FALSE; |
114 | |||
519 | mauro | 115 | return 0; |
116 | } |
||
117 |