1
2
3
4
5
6
7
8 #ifndef __SOUND_SB16_CSP_H
9 #define __SOUND_SB16_CSP_H
10
11 #include <sound/sb.h>
12 #include <sound/hwdep.h>
13 #include <linux/firmware.h>
14 #include <uapi/sound/sb16_csp.h>
15
16 struct snd_sb_csp;
17
18
19 enum {
20 CSP_PROGRAM_MULAW,
21 CSP_PROGRAM_ALAW,
22 CSP_PROGRAM_ADPCM_INIT,
23 CSP_PROGRAM_ADPCM_PLAYBACK,
24 CSP_PROGRAM_ADPCM_CAPTURE,
25
26 CSP_PROGRAM_COUNT
27 };
28
29
30
31
32 struct snd_sb_csp_ops {
33 int (*csp_use) (struct snd_sb_csp * p);
34 int (*csp_unuse) (struct snd_sb_csp * p);
35 int (*csp_autoload) (struct snd_sb_csp * p, snd_pcm_format_t pcm_sfmt, int play_rec_mode);
36 int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
37 int (*csp_stop) (struct snd_sb_csp * p);
38 int (*csp_qsound_transfer) (struct snd_sb_csp * p);
39 };
40
41
42
43
44 struct snd_sb_csp {
45 struct snd_sb *chip;
46 int used;
47 char codec_name[16];
48 unsigned short func_nr;
49 unsigned int acc_format;
50 int acc_channels;
51 int acc_width;
52 int acc_rates;
53 int mode;
54 int run_channels;
55 int run_width;
56 int version;
57 int running;
58
59 struct snd_sb_csp_ops ops;
60
61 spinlock_t q_lock;
62 int q_enabled;
63 int qpos_left;
64 int qpos_right;
65 int qpos_changed;
66
67 struct snd_kcontrol *qsound_switch;
68 struct snd_kcontrol *qsound_space;
69
70 struct mutex access_mutex;
71
72 const struct firmware *csp_programs[CSP_PROGRAM_COUNT];
73 };
74
75 int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
76 #endif