Subversion Repositories shark

Rev

Rev 538 | Go to most recent revision | Blame | Compare with Previous | 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
 */


/*
 * Copyright (C) 2000 Paolo Gai
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#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 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);

int     input_installed = FALSE;

/* Init the Linux Input Layer */
int INPUT26_init() {

        int ret;
       
        if (input_installed == TRUE) return 0;

        ret = input_init();
        if (ret) {
                printk(KERN_ERR "Input_Init return: %d\n", ret);
                return -1;
        }

        ret = serio_init();
        if (ret) {
                printk(KERN_ERR "Serio_Init return: %d\n", ret);
                return -1;
        }

        ret = i8042_init();
        if (ret) {
                printk(KERN_ERR "i8042_Init return: %d\n", ret);
                return -1;
        }

        /* TODO
        ret = serport_init();
        if (ret) {
                printk(KERN_ERR "SerPort_Init return: %d\n", ret);
                return -1;
        } */


        input_installed = TRUE;

        return ret;
}

int INPUT26_close() {

        if (input_installed == TRUE) {
                i8042_exit();
                serio_exit();
                input_exit();
               
                return 0;
        } else
                return -1;
}

/* Init the Linux Joystick Driver */
/*int JOY26_init() {

        int ret;

        if (input_installed == FALSE)
                if (INPUT26_init()) {
                        printk(KERN_ERR "Unable to open Input SubSystem.\n");
                        return -1;
                }

        ret = ns558_init();
        if (ret) {
                printk(KERN_ERR "Gameport_Init return: %d\n", ret);
                return -1;
        }

        //ret = analog_init();
        ret = joydump_init();
        if (ret) {
                printk(KERN_ERR "Joystick_Init return: %d\n", ret);
                return -1;
        }

        return 0;
}

int JOY26_close() {

        //analog_exit();
        joydump_exit();
        ns558_exit();
        return 0;
}*/


int EVBUG26_init() {
        evbug_init();

        return 0;
}

int EVBUG26_close() {
        evbug_exit();

        return 0;
}