Blame |
Last modification |
View Log
| RSS feed
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Mauro Marinoni <mauro.marinoni@unipv.it>
*
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
#include <kernel/func.h>
/* System */
extern int input_init(void);
extern int input_exit(void);
extern int serio_init(void);
extern int serio_exit(void);
/* Controllers */
extern int i8042_init(void);
extern int i8042_exit(void);
/*extern int serport_init(void);
extern int serport_exit(void);*/
/* Devices */
extern int atkbd_init(void);
extern int atkbd_exit(void);
extern int pcspkr_init(void);
extern int pcspkr_exit(void);
extern int psmouse_init(void);
extern int psmouse_exit(void);
extern int ns558_init(void);
extern int ns558_exit(void);
extern int analog_init(void);
extern int analog_exit(void);
extern int joydump_init(void);
extern int joydump_exit(void);
/* Handlers */
extern int evbug_init(void);
extern int evbug_exit(void);
/*extern int evdev_init(void);
extern int evdev_exit(void);
extern int mousedev_init(void);
extern int mousedev_exit(void);
extern int joydev_init(void);
extern int joydev_exit(void);*/
int input_initialized = 0;
/* Init the Linux Input Layer */
int INPUT26_init() {
int ret;
ret = input_init();
if (ret) {
printk(KERN_DEBUG "Input_Init return: %d\n", ret);
return -1;
}
ret = serio_init();
if (ret) {
printk(KERN_DEBUG "Serio_Init return: %d\n", ret);
return -1;
}
ret = i8042_init();
if (ret) {
printk(KERN_DEBUG "i8042_Init return: %d\n", ret);
return -1;
}
/* TODO
ret = serport_init();
if (ret) {
printk(KERN_DEBUG "SerPort_Init return: %d\n", ret);
return -1;
} */
input_initialized = 1;
return ret;
}
int INPUT26_close() {
if (input_initialized) {
i8042_exit();
serio_exit();
input_exit();
}
return 0;
}
/* Init the Linux Keyboard Driver */
int KEYB26_init() {
int ret;
if (!input_initialized)
if (INPUT26_init()) {
printk(KERN_ERR "Unable to open Input SubSystem.\n");
return -1;
}
printk(KERN_DEBUG "AtKbd_Init start.\n");
ret = atkbd_init();
if (ret) {
printk(KERN_DEBUG "AtKbd_Init return: %d\n", ret);
return -1;
}
return 0;
}
int KEYB26_close() {
atkbd_exit();
return 0;
}
/* Init the Linux Speaker Driver */
int SPEAK26_init() {
int ret;
if (!input_initialized)
if (INPUT26_init()) {
printk(KERN_ERR "Unable to open Input SubSystem.\n");
return -1;
}
ret = pcspkr_init();
if (ret) {
printk(KERN_DEBUG "PcSpkr_Init return: %d\n", ret);
return -1;
}
return 0;
}
int SPEAK26_close() {
pcspkr_exit();
return 0;
}
/* Init the Linux Speaker Driver */
int MOUSE26_init() {
int ret;
if (!input_initialized)
if (INPUT26_init()) {
printk(KERN_ERR "Unable to open Input SubSystem.\n");
return -1;
}
ret = psmouse_init();
if (ret) {
printk(KERN_DEBUG "PsMouse_Init return: %d\n", ret);
return -1;
}
return 0;
}
int MOUSE26_close() {
psmouse_exit();
return 0;
}
/* Init the Linux Speaker Driver */
/*int joystick_init() {
int ret;
if (!input_initialized)
if (shark_input_init()) {
printk(KERN_ERR "Unable to open Input SubSystem.\n");
return -1;
}
ret = ns558_init();
if (ret) {
printk(KERN_DEBUG "Gameport_Init return: %d\n", ret);
return -1;
}
//ret = analog_init();
ret = joydump_init();
if (ret) {
printk(KERN_DEBUG "Joystick_Init return: %d\n", ret);
return -1;
}
return 0;
}
int joystick_exit() {
//analog_exit();
joydump_exit();
ns558_exit();
return 0;
}*/
int events_init() {
//mousedev_init();
//joydev_init();
//evdev_init();
evbug_init();
return 0;
}
int events_exit() {
evbug_exit();
//evdev_exit();
//joydev_exit();
//mousedev_exit();
return 0;
}