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