Subversion Repositories shark

Rev

Rev 519 | Rev 547 | 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
 *   (see the web pages for full authors list)
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
/*
20
 * Copyright (C) 2000 Paolo Gai
21
 *
22
 * This program is free software; you can redistribute it and/or modify
23
 * it under the terms of the GNU General Public License as published by
24
 * the Free Software Foundation; either version 2 of the License, or
25
 * (at your option) any later version.
26
 *
27
 * This program is distributed in the hope that it will be useful,
28
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 * GNU General Public License for more details.
31
 *
32
 * You should have received a copy of the GNU General Public License
33
 * along with this program; if not, write to the Free Software
34
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35
 *
36
 */
37
 
522 mauro 38
//#define __MOUSE_DEBUG__ 1
519 mauro 39
 
40
#include <kernel/kern.h>
41
 
42
#include "../include/drivers/shark_input26.h"
43
#include "../include/drivers/shark_spk26.h"
44
 
45
/* Devices */
46
extern int pcspkr_init(void);
47
extern int pcspkr_exit(void);
48
 
49
/* Handlers */
50
extern int  speaker_init(void);
51
extern void speaker_exit(void);
52
 
53
/* Functions */
54
extern void spk_mksound(unsigned int hz, unsigned int ticks);
55
extern void spk_nosound(unsigned long ignored);
56
 
57
extern int input_installed;
58
 
59
/* User Functions */
60
 
61
void speaker_sound(unsigned int hz, unsigned int ticks)
62
{
63
        spk_mksound(hz, ticks);
64
}
65
 
66
void speaker_mute(void)
67
{
68
        spk_nosound(0);
69
}
70
 
71
/* Init the Linux Speaker Driver */
72
int SPEAK26_init()
73
{
74
        int ret;
75
 
76
        if (input_installed == FALSE)
77
                if (INPUT26_init()) {
78
                        printk(KERN_ERR "Unable to open Input SubSystem.\n");
79
                        return -1;
80
                }
81
 
82
        ret = pcspkr_init();
83
        if (ret) {
84
                printk(KERN_ERR "PcSpkr_Init return: %d\n", ret);
85
                return -1;
86
        }
87
 
88
        ret = speaker_init();
89
        if (ret) {
90
                printk(KERN_ERR "Speaker_Init return: %d\n", ret);
91
                return -1;
92
        }
93
 
94
        return 0;
95
}
96
 
97
int SPEAK26_close()
98
{
99
        speaker_exit();
100
        pcspkr_exit();
101
        return 0;
102
}
103