0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __SOUND_SB16_CSP_H
0009 #define __SOUND_SB16_CSP_H
0010
0011 #include <sound/sb.h>
0012 #include <sound/hwdep.h>
0013 #include <linux/firmware.h>
0014 #include <uapi/sound/sb16_csp.h>
0015
0016 struct snd_sb_csp;
0017
0018
0019 enum {
0020 CSP_PROGRAM_MULAW,
0021 CSP_PROGRAM_ALAW,
0022 CSP_PROGRAM_ADPCM_INIT,
0023 CSP_PROGRAM_ADPCM_PLAYBACK,
0024 CSP_PROGRAM_ADPCM_CAPTURE,
0025
0026 CSP_PROGRAM_COUNT
0027 };
0028
0029
0030
0031
0032 struct snd_sb_csp_ops {
0033 int (*csp_use) (struct snd_sb_csp * p);
0034 int (*csp_unuse) (struct snd_sb_csp * p);
0035 int (*csp_autoload) (struct snd_sb_csp * p, snd_pcm_format_t pcm_sfmt, int play_rec_mode);
0036 int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
0037 int (*csp_stop) (struct snd_sb_csp * p);
0038 int (*csp_qsound_transfer) (struct snd_sb_csp * p);
0039 };
0040
0041
0042
0043
0044 struct snd_sb_csp {
0045 struct snd_sb *chip;
0046 int used;
0047 char codec_name[16];
0048 unsigned short func_nr;
0049 unsigned int acc_format;
0050 int acc_channels;
0051 int acc_width;
0052 int acc_rates;
0053 int mode;
0054 int run_channels;
0055 int run_width;
0056 int version;
0057 int running;
0058
0059 struct snd_sb_csp_ops ops;
0060
0061 spinlock_t q_lock;
0062 int q_enabled;
0063 int qpos_left;
0064 int qpos_right;
0065 int qpos_changed;
0066
0067 struct snd_kcontrol *qsound_switch;
0068 struct snd_kcontrol *qsound_space;
0069
0070 struct mutex access_mutex;
0071
0072 const struct firmware *csp_programs[CSP_PROGRAM_COUNT];
0073 };
0074
0075 int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
0076 #endif