Subversion Repositories shark

Rev

Rev 522 | 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
 *   (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
 
522 mauro 19
//#define __MOUSE_DEBUG__ 1
519 mauro 20
 
21
#include <kernel/kern.h>
22
 
23
#include "../include/drivers/shark_input26.h"
24
#include "../include/drivers/shark_spk26.h"
25
 
26
/* Devices */
27
extern int pcspkr_init(void);
28
extern int pcspkr_exit(void);
29
 
30
/* Handlers */
31
extern int  speaker_init(void);
32
extern void speaker_exit(void);
33
 
34
/* Functions */
35
extern void spk_mksound(unsigned int hz, unsigned int ticks);
36
extern void spk_nosound(unsigned long ignored);
37
 
38
extern int input_installed;
39
 
40
/* User Functions */
41
 
42
void speaker_sound(unsigned int hz, unsigned int ticks)
43
{
44
        spk_mksound(hz, ticks);
45
}
46
 
47
void speaker_mute(void)
48
{
49
        spk_nosound(0);
50
}
51
 
52
/* Init the Linux Speaker Driver */
53
int SPEAK26_init()
54
{
55
        int ret;
56
 
57
        if (input_installed == FALSE)
58
                if (INPUT26_init()) {
59
                        printk(KERN_ERR "Unable to open Input SubSystem.\n");
60
                        return -1;
61
                }
62
 
63
        ret = pcspkr_init();
64
        if (ret) {
65
                printk(KERN_ERR "PcSpkr_Init return: %d\n", ret);
66
                return -1;
67
        }
68
 
69
        ret = speaker_init();
70
        if (ret) {
71
                printk(KERN_ERR "Speaker_Init return: %d\n", ret);
72
                return -1;
73
        }
74
 
75
        return 0;
76
}
77
 
78
int SPEAK26_close()
79
{
80
        speaker_exit();
81
        pcspkr_exit();
82
        return 0;
83
}
84