#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/init.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
static void snd_emu10k1_pcm_interrupt(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *voice)
{ … }
static void snd_emu10k1_pcm_ac97adc_interrupt(struct snd_emu10k1 *emu,
unsigned int status)
{ … }
static void snd_emu10k1_pcm_ac97mic_interrupt(struct snd_emu10k1 *emu,
unsigned int status)
{ … }
static void snd_emu10k1_pcm_efx_interrupt(struct snd_emu10k1 *emu,
unsigned int status)
{ … }
static void snd_emu10k1_pcm_free_voices(struct snd_emu10k1_pcm *epcm)
{ … }
static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm *epcm,
int type, int count, int channels)
{ … }
static const unsigned int efx_capture_channels[] = …;
static const struct snd_pcm_hw_constraint_list hw_constraints_efx_capture_channels = …;
static const unsigned int capture_buffer_sizes[31] = …;
static const struct snd_pcm_hw_constraint_list hw_constraints_capture_buffer_sizes = …;
static const unsigned int capture_rates[8] = …;
static const struct snd_pcm_hw_constraint_list hw_constraints_capture_rates = …;
static unsigned int snd_emu10k1_capture_rate_reg(unsigned int rate)
{ … }
static const unsigned int audigy_capture_rates[9] = …;
static const struct snd_pcm_hw_constraint_list hw_constraints_audigy_capture_rates = …;
static unsigned int snd_emu10k1_audigy_capture_rate_reg(unsigned int rate)
{ … }
static void snd_emu10k1_constrain_capture_rates(struct snd_emu10k1 *emu,
struct snd_pcm_runtime *runtime)
{ … }
static void snd_emu1010_constrain_efx_rate(struct snd_emu10k1 *emu,
struct snd_pcm_runtime *runtime)
{ … }
static unsigned int emu10k1_calc_pitch_target(unsigned int rate)
{ … }
#define PITCH_48000 …
#define PITCH_96000 …
#define PITCH_85000 …
#define PITCH_80726 …
#define PITCH_67882 …
#define PITCH_57081 …
static unsigned int emu10k1_select_interprom(unsigned int pitch_target)
{ … }
static u16 emu10k1_send_target_from_amount(u8 amount)
{ … }
static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice,
bool w_16, bool stereo,
unsigned int start_addr,
unsigned int end_addr,
const unsigned char *send_routing,
const unsigned char *send_amount)
{ … }
static void snd_emu10k1_pcm_init_voices(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice,
bool w_16, bool stereo,
unsigned int start_addr,
unsigned int end_addr,
struct snd_emu10k1_pcm_mixer *mix)
{ … }
static void snd_emu10k1_pcm_init_extra_voice(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice,
bool w_16,
unsigned int start_addr,
unsigned int end_addr)
{ … }
static int snd_emu10k1_playback_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static int snd_emu10k1_playback_hw_free(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_playback_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_efx_playback_prepare(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_hardware snd_emu10k1_efx_playback = …;
static int snd_emu10k1_capture_prepare(struct snd_pcm_substream *substream)
{ … }
static void snd_emu10k1_playback_fill_cache(struct snd_emu10k1 *emu,
unsigned voice,
u32 sample, bool stereo)
{ … }
static void snd_emu10k1_playback_prepare_voices(struct snd_emu10k1 *emu,
struct snd_emu10k1_pcm *epcm,
bool w_16, bool stereo,
int channels)
{ … }
static void snd_emu10k1_playback_commit_volume(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice,
unsigned int vattn)
{ … }
static void snd_emu10k1_playback_unmute_voice(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice,
bool stereo, bool master,
struct snd_emu10k1_pcm_mixer *mix)
{ … }
static void snd_emu10k1_playback_unmute_voices(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice,
bool stereo,
struct snd_emu10k1_pcm_mixer *mix)
{ … }
static void snd_emu10k1_playback_mute_voice(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice)
{ … }
static void snd_emu10k1_playback_mute_voices(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice,
bool stereo)
{ … }
static void snd_emu10k1_playback_commit_pitch(struct snd_emu10k1 *emu,
u32 voice, u32 pitch_target)
{ … }
static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice)
{ … }
static void snd_emu10k1_playback_stop_voice(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice)
{ … }
static void snd_emu10k1_playback_set_running(struct snd_emu10k1 *emu,
struct snd_emu10k1_pcm *epcm)
{ … }
static void snd_emu10k1_playback_set_stopped(struct snd_emu10k1 *emu,
struct snd_emu10k1_pcm *epcm)
{ … }
static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream *substream)
{ … }
static u64 snd_emu10k1_efx_playback_voice_mask(struct snd_emu10k1_pcm *epcm,
int channels)
{ … }
static void snd_emu10k1_efx_playback_freeze_voices(struct snd_emu10k1 *emu,
struct snd_emu10k1_pcm *epcm,
int channels)
{ … }
static void snd_emu10k1_efx_playback_unmute_voices(struct snd_emu10k1 *emu,
struct snd_emu10k1_pcm *epcm,
int channels)
{ … }
static void snd_emu10k1_efx_playback_stop_voices(struct snd_emu10k1 *emu,
struct snd_emu10k1_pcm *epcm,
int channels)
{ … }
static int snd_emu10k1_efx_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static snd_pcm_uframes_t snd_emu10k1_capture_pointer(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_hardware snd_emu10k1_playback = …;
static const struct snd_pcm_hardware snd_emu10k1_capture = …;
static const struct snd_pcm_hardware snd_emu10k1_capture_efx = …;
static void snd_emu10k1_pcm_mixer_notify1(struct snd_emu10k1 *emu, struct snd_kcontrol *kctl, int idx, int activate)
{ … }
static void snd_emu10k1_pcm_mixer_notify(struct snd_emu10k1 *emu, int idx, int activate)
{ … }
static void snd_emu10k1_pcm_efx_mixer_notify(struct snd_emu10k1 *emu, int idx, int activate)
{ … }
static void snd_emu10k1_pcm_free_substream(struct snd_pcm_runtime *runtime)
{ … }
static int snd_emu10k1_efx_playback_close(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_playback_set_constraints(struct snd_pcm_runtime *runtime)
{ … }
static int snd_emu10k1_efx_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_playback_close(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_capture_open(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_capture_close(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_capture_mic_open(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_capture_mic_close(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_capture_efx_close(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_emu10k1_playback_ops = …;
static const struct snd_pcm_ops snd_emu10k1_capture_ops = …;
static const struct snd_pcm_ops snd_emu10k1_efx_playback_ops = …;
int snd_emu10k1_pcm(struct snd_emu10k1 *emu, int device)
{ … }
int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device)
{ … }
static const struct snd_pcm_ops snd_emu10k1_capture_mic_ops = …;
int snd_emu10k1_pcm_mic(struct snd_emu10k1 *emu, int device)
{ … }
static int snd_emu10k1_pcm_efx_voices_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_emu10k1_pcm_efx_voices_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_emu10k1_pcm_efx_voices_mask_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_emu10k1_pcm_efx_voices_mask = …;
static const struct snd_pcm_ops snd_emu10k1_capture_efx_ops = …;
#define INITIAL_TRAM_SHIFT …
#define INITIAL_TRAM_POS(size) …
static void snd_emu10k1_fx8010_playback_irq(struct snd_emu10k1 *emu, void *private_data)
{ … }
static void snd_emu10k1_fx8010_playback_tram_poke1(unsigned short *dst_left,
unsigned short *dst_right,
unsigned short *src,
unsigned int count,
unsigned int tram_shift)
{ … }
static void fx8010_pb_trans_copy(struct snd_pcm_substream *substream,
struct snd_pcm_indirect *rec, size_t bytes)
{ … }
static int snd_emu10k1_fx8010_playback_transfer(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_fx8010_playback_hw_free(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_fx8010_playback_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
static snd_pcm_uframes_t snd_emu10k1_fx8010_playback_pointer(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_hardware snd_emu10k1_fx8010_playback = …;
static int snd_emu10k1_fx8010_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_emu10k1_fx8010_playback_close(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_emu10k1_fx8010_playback_ops = …;
int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device)
{ … }