Subversion Repositories shark

Rev

Rev 1063 | 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
 
1063 tullio 19
/*
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License as published by
22
 * the Free Software Foundation; either version 2 of the License, or
23
 * (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program; if not, write to the Free Software
32
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33
 *
34
 */
35
 
519 mauro 36
#include <kernel/func.h>
37
 
38
/* System */
39
extern int input_init(void);
40
extern int input_exit(void);
41
 
42
extern int serio_init(void);
43
extern int serio_exit(void);
44
 
45
/* Controllers */
46
extern int i8042_init(void);
47
extern int i8042_exit(void);
48
 
49
/*extern int serport_init(void);
50
extern int serport_exit(void);*/
51
 
52
/* Handlers */
53
extern int evbug_init(void);
54
extern int evbug_exit(void);
55
 
549 mauro 56
static int      input_installed = FALSE;
57
static int      evbug_installed = FALSE;
519 mauro 58
 
59
/* Init the Linux Input Layer */
549 mauro 60
int INPUT26_installed(void)
61
{
62
        return input_installed;
63
}
64
 
519 mauro 65
int INPUT26_init() {
66
 
67
        int ret;
68
 
69
        if (input_installed == TRUE) return 0;
70
 
71
        ret = input_init();
72
        if (ret) {
73
                printk(KERN_ERR "Input_Init return: %d\n", ret);
74
                return -1;
75
        }
76
 
77
        ret = serio_init();
78
        if (ret) {
79
                printk(KERN_ERR "Serio_Init return: %d\n", ret);
826 mauro 80
                return -2;
519 mauro 81
        }
82
 
83
        ret = i8042_init();
84
        if (ret) {
85
                printk(KERN_ERR "i8042_Init return: %d\n", ret);
826 mauro 86
                return -3;
519 mauro 87
        }
88
 
89
        /* TODO
90
        ret = serport_init();
91
        if (ret) {
92
                printk(KERN_ERR "SerPort_Init return: %d\n", ret);
93
                return -1;
94
        } */
95
 
96
        input_installed = TRUE;
97
 
98
        return ret;
99
}
100
 
101
int INPUT26_close() {
102
 
103
        if (input_installed == TRUE) {
104
                i8042_exit();
105
                serio_exit();
106
                input_exit();
107
 
108
                return 0;
109
        } else
110
                return -1;
111
}
112
 
538 mauro 113
/* Init the Linux Event Debug Driver */
549 mauro 114
int EVBUG26_installed(void)
115
{
116
        return evbug_installed;
117
}
118
 
519 mauro 119
int EVBUG26_init() {
120
        evbug_init();
121
 
549 mauro 122
        evbug_installed = TRUE;
123
 
519 mauro 124
        return 0;
125
}
126
 
127
int EVBUG26_close() {
128
        evbug_exit();
129
 
549 mauro 130
        evbug_installed = FALSE;
131
 
519 mauro 132
        return 0;
133
}
134