Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/pci/emu10k1/emu10k1_main.c | static int snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu,
const struct firmware *fw_entry) {
int n, i;
int reg;
int value;
__always_unused unsigned int write_post;
unsigned long flags;
if (!fw_entry)
return -EIO;
/* GPIO7 -> FPGA PGMN
* GPIO6 -... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emu10k1_main.c |
static int alloc_pm_buffer(struct snd_emu10k1 *emu) {
int size;
size = ARRAY_SIZE(saved_regs);
if (emu->audigy)
size += ARRAY_SIZE(saved_regs_audigy);
emu->saved_ptr = vmalloc(array3_size(4, NUM_G, size));
if (!emu->saved_ptr)
return -ENOMEM;
if (snd_emu10k1_efx_alloc_pm_buffer(emu) < 0)
retur... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emu10k1_main.c | void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu) {
int i;
const unsigned char *reg;
unsigned int *val;
snd_emu10k1_audio_enable(emu);
if (emu->audigy)
outl(emu->saved_a_iocfg, emu->port + A_IOCFG);
outl(emu->saved_hcfg, emu->port + HCFG);
val = emu->saved_ptr;
for (reg = saved_regs; *reg != ... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emu10k1_synth.c | static int snd_emu10k1_synth_probe(struct device *_dev) {
struct snd_seq_device *dev = to_seq_dev(_dev);
struct snd_emux *emux;
struct snd_emu10k1 *hw;
struct snd_emu10k1_synth_arg *arg;
unsigned long flags;
arg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (arg == NULL)
return -EINVAL;
if (arg->seq_ports <=... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c | static int snd_emu10k1_gpr_ctl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct snd_emu10k1_fx8010_ctl *ctl =
(struct snd_emu10k1_fx8010_ctl *)kcontrol->private_value;
if (ctl->min == 0 && ctl->max == 1)
uinfo->type = SNDRV_CTL_ELEM_TYPE_BO... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static void snd_emu10k1_audigy_write_op(struct snd_emu10k1_fx8010_code *icode,
unsigned int *ptr, u32 op, u32 r, u32 a,
u32 x, u32 y) {
u_int32_t *code;
if (snd_BUG_ON(*ptr >= 1024))
return;
code = icode->code + (*ptr) * 2;
set... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc) {
pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE;
return snd_emu10k1_ptr_read(emu, pc, 0);
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int snd_emu10k1_gpr_poke(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_code *icode,
bool in_kernel) {
int gpr;
u32 val;
for (gpr = 0; gpr < (emu->audigy ? 0x200 : 0x100); gpr++) {
if (!test_bit(gpr, icode->gpr_valid))
continue... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int snd_emu10k1_tram_poke(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_code *icode,
bool in_kernel) {
int tram;
u32 addr, val;
for (tram = 0; tram < (emu->audigy ? 0x100 : 0xa0); tram++) {
if (!test_bit(tram, icode->tram_valid))
... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int snd_emu10k1_code_poke(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_code *icode,
bool in_kernel) {
u32 pc, lo, hi;
for (pc = 0; pc < (emu->audigy ? 2 * 1024 : 2 * 512); pc += 2) {
if (!test_bit(pc / 2, icode->code_valid))
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static unsigned int *copy_tlv(const unsigned int __user *_tlv, bool in_kernel) {
unsigned int data[2];
unsigned int *tlv;
if (!_tlv)
return NULL;
if (in_kernel)
memcpy(data, (__force void *)_tlv, sizeof(data));
else if (copy_from_user(data, _tlv, sizeof(data)))
return NULL;
if (data[1] >= MAX_... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int copy_gctl(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_control_gpr *dst,
struct snd_emu10k1_fx8010_control_gpr *src, int idx,
bool in_kernel) {
struct snd_emu10k1_fx8010_control_gpr __user *_src;
struct snd_emu10k1_fx8010_control_old_g... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int copy_ctl_elem_id(const struct emu10k1_ctl_elem_id *list, int i,
struct emu10k1_ctl_elem_id *ret, bool in_kernel) {
struct emu10k1_ctl_elem_id __user *_id =
(struct emu10k1_ctl_elem_id __user *)&list[i];
if (in_kernel)
*ret = list[i];
else if (copy_from_user(ret, ... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_code *icode,
bool in_kernel) {
unsigned int i;
struct emu10k1_ctl_elem_id id;
struct snd_emu10k1_fx8010_ctl *ctl;
struct snd_card *card = emu->card;
i... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c | static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_code *icode,
bool in_kernel) {
int err = 0;
mutex_lock(&emu->fx8010.lock);
err = snd_emu10k1_verify_controls(emu, icode, in_kernel);
if (err < 0)
goto __e... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c | static int snd_emu10k1_icode_peek(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_code *icode) {
int err;
mutex_lock(&emu->fx8010.lock);
strscpy(icode->name, emu->fx8010.name, sizeof(icode->name));
err = snd_emu10k1_gpr_peek(emu, icode);
if (err >= 0)
err = snd_emu10... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_pcm_rec *ipcm) {
unsigned int i;
int err = 0;
struct snd_emu10k1_fx8010_pcm *pcm;
if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
return -EINVAL;
ipcm->substream =
array_index_nosp... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static void
snd_emu10k1_init_mono_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
const char *name, int gpr, int defval) {
ctl->id.iface = (__force int)SNDRV_CTL_ELEM_IFACE_MIXER;
strcpy(ctl->id.name, name);
ctl->vcount = ctl->count = 1;
ctl->gpr[0] = gpr + 0;
ctl->value[0] ... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static void
snd_emu10k1_init_stereo_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
const char *name, int gpr, int defval) {
ctl->id.iface = (__force int)SNDRV_CTL_ELEM_IFACE_MIXER;
strcpy(ctl->id.name, name);
ctl->vcount = ctl->count = 2;
ctl->gpr[0] = gpr + 0;
ctl->value... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c | static void _volume(struct snd_emu10k1_fx8010_code *icode, u32 *ptr, u32 dst,
u32 src, u32 vol) {
OP(icode, ptr, iMAC0, dst, C_00000000, src, vol);
OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff);
OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000001);
OP(icod... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c | static void _volume_add(struct snd_emu10k1_fx8010_code *icode, u32 *ptr,
u32 dst, u32 src, u32 vol) {
OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff);
OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000002);
OP(icode, ptr, iMACINT0, dst, dst, src, C_00000001)... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c | void snd_emu10k1_free_efx(struct snd_emu10k1 *emu) {
if (emu->audigy)
snd_emu10k1_ptr_write(emu, A_DBG, 0, emu->fx8010.dbg = A_DBG_SINGLE_STEP);
else
snd_emu10k1_ptr_write(emu, DBG, 0,
emu->fx8010.dbg = EMU10K1_DBG_SINGLE_STEP);
}
#if 0 /* FIXME: who use them? */
int snd_emu10k1_... | [
1,
1
] |
Linux Kernel | sound/pci/emu10k1/emufx.c | int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size) {
u8 size_reg = 0;
if (size != 0) {
size = (size - 1) >> 13;
while (size) {
size >>= 1;
size_reg++;
}
size = 0x2000 << size_reg;
}
if ((emu->fx8010.etram_pages.bytes / 2) == size)
return 0;
spin_lock_irq(&em... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static void snd_emu10k1_fx8010_info(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_info *info) {
const char *const *fxbus, *const *extin, *const *extout;
unsigned short fxbus_mask, extin_mask, extout_mask;
int res;
info->internal_tram_size = emu->fx8010.itram_size;
in... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emufx.c |
static int snd_emu10k1_fx8010_release(struct snd_hwdep *hw, struct file *file) {
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int snd_emu10k1_spdif_get_mask(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
ucontrol->value.iec958.status[0] = 0xff;
ucontrol->value.iec958.status[1] = 0xff;
ucontrol->value.iec958.status[2] = 0xff;
ucontrol->value.iec958.status[3] = 0xff;
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int snd_emu1010_adc_pads_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int mask = kcontrol->private_value & 0xff;
ucontrol->value.integer.value[0] = (emu->emu1010.adc_pads & mask... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int snd_emu1010_optical_out_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[2] = {"SPDIF", "ADAT"};
return snd_ctl_enum_info(uinfo, 1, 2, texts);
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c | static int snd_emu10k1_spdif_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
int change;
unsigned int val;
unsigned long flags;
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int snd_emu10k1_attn_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
unsigned long flags;
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
struct snd_emu10k1_pcm_mixer *mix =
&emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int
snd_emu10k1_efx_send_routing_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
unsigned long flags;
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
struct snd_emu10k1_pcm_mixer *mix... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int
snd_emu10k1_efx_send_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
unsigned long flags;
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
struct snd_emu10k1_pcm_mixer *mix =... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int snd_emu10k1_efx_attn_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
unsigned long flags;
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
struct snd_emu10k1_pcm_mixer *mix = &e... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static int snd_audigy_capture_boost_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int val;
if (ucontrol->value.integer.value[0])
val = 0x0f0f;
else
val = 0;
return snd_... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumixer.c |
static struct snd_kcontrol *ctl_find(struct snd_card *card, const char *name) {
struct snd_ctl_elem_id sid;
memset(&sid, 0, sizeof(sid));
strcpy(sid.name, name);
sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
return snd_ctl_find_id(card, &sid);
} | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumpu401.c | static void do_emu10k1_midi_interrupt(struct snd_emu10k1 *emu,
struct snd_emu10k1_midi *midi,
unsigned int status) {
unsigned char byte;
if (midi->rmidi == NULL) {
snd_emu10k1_intr_disable(emu, midi->tx_enable | midi->rx_enable);
r... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emumpu401.c |
static void snd_emu10k1_midi_interrupt2(struct snd_emu10k1 *emu,
unsigned int status) {
do_emu10k1_midi_interrupt(emu, &emu->midi2, status);
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emumpu401.c | static int snd_emu10k1_midi_cmd(struct snd_emu10k1 *emu,
struct snd_emu10k1_midi *midi,
unsigned char cmd, int ack) {
unsigned long flags;
int timeout, ok;
spin_lock_irqsave(&midi->input_lock, flags);
mpu401_write_data(emu, midi, 0x00);
mpu401_... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emumpu401.c |
static int
snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream) {
struct snd_emu10k1 *emu;
struct snd_emu10k1_midi *midi =
(struct snd_emu10k1_midi *)substream->rmidi->private_data;
unsigned long flags;
emu = midi->emu;
if (snd_BUG_ON(!emu))
return -ENXIO;
spin_lock_irqsave(&midi... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emumpu401.c |
static int
snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream) {
struct snd_emu10k1 *emu;
struct snd_emu10k1_midi *midi =
(struct snd_emu10k1_midi *)substream->rmidi->private_data;
unsigned long flags;
int err = 0;
emu = midi->emu;
if (snd_BUG_ON(!emu))
return -ENXIO;
spin_l... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
static snd_pcm_uframes_t
snd_emu10k1_efx_playback_pointer(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_pcm *epcm = runtime->private_data;
unsigned int ptr;
if (!epcm->running)
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
static unsigned int snd_emu10k1_capture_rate_reg(unsigned int rate) {
switch (rate) {
case 8000:
return ADCCR_SAMPLERATE_8;
case 11025:
return ADCCR_SAMPLERATE_11;
case 16000:
return ADCCR_SAMPLERATE_16;
case 22050:
return ADCCR_SAMPLERATE_22;
case 24000:
return ADCCR_SAMPLERATE_24;
c... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
static unsigned int emu10k1_calc_pitch_target(unsigned int rate) {
unsigned int pitch_target;
pitch_target = (rate << 8) / 375;
pitch_target = (pitch_target >> 1) + (pitch_target & 1);
return pitch_target;
}
#define PITCH_48000 0x00004000
#define PITCH_96000 0x00008000
#define PITCH_85000 0x00007155 | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
static int snd_emu10k1_playback_hw_free(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_pcm *epcm;
if (runtime->private_data == NULL)
return 0;
epcm = runtime->private_data;
if ... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
static int snd_emu10k1_playback_prepare(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_pcm *epcm = runtime->private_data;
unsigned int start_addr, end_addr;
start_addr = epcm->start_... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
static void snd_emu10k1_playback_stop_voice(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *evoice) {
unsigned int voice;
if (evoice == NULL)
return;
voice = evoice->number;
snd_emu10k1_voice_intr_disable(emu, voice);
snd_emu10k1_ptr_write(emu, PTRX_PITCHTA... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c | static snd_pcm_uframes_t
snd_emu10k1_capture_pointer(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_pcm *epcm = runtime->private_data;
unsigned int ptr;
if (!epcm->running)
return... | [
1,
1
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
static int snd_emu10k1_capture_mic_close(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
emu->capture_interrupt = NULL;
emu->pcm_capture_mic_substream = NULL;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device) {
struct snd_pcm *pcm;
struct snd_pcm_substream *substream;
int err;
err = snd_pcm_new(emu->card, "emu10k1", device, 1, 0, &pcm);
if (err < 0)
return err;
pcm->private_data = emu;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c |
int snd_emu10k1_pcm_mic(struct snd_emu10k1 *emu, int device) {
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(emu->card, "emu10k1 mic", device, 0, 1, &pcm);
if (err < 0)
return err;
pcm->private_data = emu;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_mic_ops);
pcm->info_f... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emupcm.c | static int
snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
unsigned int i;
memset(&pcm->pcm_r... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emuproc.c | static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
u32 pc;
struct snd_emu10k1 *emu = entry->private_data;
snd_iprintf(buffer, "FX8010 Instruction List '%s'\n", emu->fx8010.name);
snd_iprintf(buffer, " Code dump :... | [
0,
1
] |
Linux Kernel | sound/pci/emu10k1/emuproc.c |
static void snd_emu_proc_io_reg_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_emu10k1 *emu = entry->private_data;
unsigned long value;
unsigned long flags;
int i;
snd_iprintf(buffer, "IO Registers:\n\n");
for (i = 0; i < 0x40; i += 4) {... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emuproc.c |
static void snd_emu_proc_io_reg_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_emu10k1 *emu = entry->private_data;
unsigned long flags;
char line[64];
u32 reg, val;
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/emuproc.c |
static unsigned int snd_ptr_read(struct snd_emu10k1 *emu, unsigned int iobase,
unsigned int reg, unsigned int chn) {
unsigned long flags;
unsigned int regptr, val;
regptr = (reg << 16) | chn;
spin_lock_irqsave(&emu->emu_lock, flags);
outl(regptr, emu->port + iobase + PTR);
... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emuproc.c |
static void snd_emu_proc_ptr_reg_write20(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
snd_emu_proc_ptr_reg_write(entry, buffer, 0x20);
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/emuproc.c |
static void snd_emu_proc_ptr_reg_read00a(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40, 64);
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/io.c | int snd_emu10k1_spi_write(struct snd_emu10k1 *emu, unsigned int data) {
unsigned int reset, set;
unsigned int reg, tmp;
int n, result;
int err = 0;
spin_lock(&emu->spi_lock);
if (emu->card_capabilities->ca0108_chip)
reg = 0x3c; /* PTR20, reg 0x3c */
else {
/* For other chip types the SPI register... | [
1,
1
] |
Linux Kernel | sound/pci/emu10k1/io.c | int snd_emu1010_fpga_write(struct snd_emu10k1 *emu, u32 reg, u32 value) {
unsigned long flags;
if (reg > 0x3f)
return 1;
reg += 0x40;
if (value > 0x3f) /* 0 to 0x3f are values */
return 1;
spin_lock_irqsave(&emu->emu_lock, flags);
outl(reg, emu->port + A_IOCFG);
udelay(10);
outl(reg | 0x80,
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/io.c | void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu,
unsigned int voicenum) {
unsigned long flags;
unsigned int sol;
spin_lock_irqsave(&emu->emu_lock, flags);
if (voicenum >= 32) {
outl(SOLEH << 16, emu->port + PTR);
sol = inl(emu->port + DATA);
so... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/io.c |
void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait) {
volatile unsigned count;
unsigned int newtime = 0, curtime;
curtime = inl(emu->port + WC) >> 6;
while (wait-- > 0) {
count = 0;
while (count++ < 16384) {
newtime = inl(emu->port + WC) >> 6;
if (newtime != curtime)
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/io.c |
unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97,
unsigned short reg) {
struct snd_emu10k1 *emu = ac97->private_data;
unsigned long flags;
unsigned short val;
spin_lock_irqsave(&emu->emu_lock, flags);
outb(reg, emu->port + AC97ADDRESS);
val = inw(emu->port + ... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/memory.c | static inline void set_silent_ptb(struct snd_emu10k1 *emu, int page) {
int i;
page *= UNIT_PAGES;
for (i = 0; i < UNIT_PAGES; i++, page++) {
__set_ptb_entry(emu, page, emu->silent_page.addr);
dev_dbg(emu->card->dev, "mapped silent page %d to entry %.8x\n", page,
(unsigned int)__get_ptb_entry(... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/memory.c | static void emu10k1_memblk_init(struct snd_emu10k1_memblk *blk) {
blk->mapped_page = -1;
INIT_LIST_HEAD(&blk->mapped_link);
INIT_LIST_HEAD(&blk->mapped_order_link);
blk->map_locked = 0;
blk->first_page = get_aligned_page(blk->mem.offset);
blk->last_page = get_aligned_page(blk->mem.offset + blk->mem.size - ... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/memory.c | static int map_memblk(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk) {
int page, pg;
struct list_head *next;
page = search_empty_map_area(emu, blk->pages, &next);
if (page < 0)
return page;
if (page == 0) {
dev_err(emu->card->dev, "trying to map zero (reserved) page\n");
return -EINVAL;... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/memory.c | static int is_valid_page(struct snd_emu10k1 *emu, dma_addr_t addr) {
if (addr & ~emu->dma_mask) {
dev_err_ratelimited(emu->card->dev,
"max memory size is 0x%lx (addr = 0x%lx)!!\n",
emu->dma_mask, (unsigned long)addr);
return 0;
}
if (addr & (EMUPAGESIZE - 1)... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/memory.c | int snd_emu10k1_alloc_pages_maybe_wider(struct snd_emu10k1 *emu, size_t size,
struct snd_dma_buffer *dmab) {
if (emu->iommu_workaround) {
size_t npages = DIV_ROUND_UP(size, PAGE_SIZE);
size_t size_real = npages * PAGE_SIZE;
if (size_real < size + 1024)
size +... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/memory.c | static void get_single_page_range(struct snd_util_memhdr *hdr,
struct snd_emu10k1_memblk *blk,
int *first_page_ret, int *last_page_ret) {
struct list_head *p;
struct snd_emu10k1_memblk *q;
int first_page, last_page;
first_page = blk->first_page... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c | static int
snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substream,
int channel_id) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_emu10k1_voice *channel = &(emu->p16v_voices[channel_id]);
struct snd_emu10k1_pcm *epcm;
struct snd_pcm_r... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c | static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
// struct snd_emu10k1_pcm *epcm = runtime->private_data;
emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0;
/* FIXME: maybe zero others */
return... | [
1,
1
] |
Linux Kernel | sound/pci/emu10k1/p16v.c |
static int
snd_p16v_pcm_open_playback_front(struct snd_pcm_substream *substream) {
return snd_p16v_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL);
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c |
static void snd_p16v_intr_disable(struct snd_emu10k1 *emu,
unsigned int intrenb) {
unsigned long flags;
unsigned int disable;
spin_lock_irqsave(&emu->emu_lock, flags);
disable = inl(emu->port + INTE2) & (~intrenb);
outl(disable, emu->port + INTE2);
spin_unlock_irqrestore(... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c | static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
int cmd) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime;
struct snd_emu10k1_pcm *epcm;
int channel;
int result = 0;
struct snd_pcm_substream ... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c | static snd_pcm_uframes_t
snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream) {
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_pcm *epcm = runtime->private_data;
snd_pcm_uframes_t ptr, ptr1, ptr2 = 0;
int chann... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c |
static int snd_p16v_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 255;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c |
static int snd_p16v_capture_source_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
ucontrol->value.enumerated.item[0] = emu->p16v_capture_source;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c |
static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change = 0;
u32 tmp;
val = ucontrol->value.enumerated.item[0];
if (val > 3)
... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c | int snd_p16v_mixer(struct snd_emu10k1 *emu) {
int i, err;
struct snd_card *card = emu->card;
for (i = 0; i < ARRAY_SIZE(p16v_mixer_controls); i++) {
err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i], emu));
if (err < 0)
return err;
}
return 0;
}
#ifdef CONFIG_PM_SLEEP
#define NUM_C... | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/p16v.c |
void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu) {
vfree(emu->p16v_saved);
} | [
0,
0
] |
Linux Kernel | sound/pci/emu10k1/timer.c |
int snd_emu10k1_timer(struct snd_emu10k1 *emu, int device) {
struct snd_timer *timer = NULL;
struct snd_timer_id tid;
int err;
tid.dev_class = SNDRV_TIMER_CLASS_CARD;
tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE;
tid.card = emu->card->number;
tid.device = device;
tid.subdevice = 0;
err = snd_timer_new(e... | [
1,
0
] |
Linux Kernel | sound/pci/emu10k1/voice.c | int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int number,
struct snd_emu10k1_voice **rvoice) {
unsigned long flags;
int result;
if (snd_BUG_ON(!rvoice))
return -EINVAL;
if (snd_BUG_ON(!number))
return -EINVAL;
spin_lock_irqsave(&emu->voice_lock, flags);
... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c | static unsigned int snd_es1371_src_read(struct ensoniq *ensoniq,
unsigned short reg) {
unsigned int temp, i, orig, r;
temp = orig = snd_es1371_wait_src_ready(ensoniq);
/* expose the SRC state bits */
r = temp &
(ES_1371_SRC_DISABLE | ES_1371_DIS_P1 | ES_1371_DIS_P... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static void snd_es1371_adc_rate(struct ensoniq *ensoniq, unsigned int rate) {
unsigned int n, truncm, freq;
mutex_lock(&ensoniq->src_mutex);
n = rate / 3000;
if ((1 << n) & ((1 << 15) | (1 << 13) | (1 << 11) | (1 << 9)))
n--;
truncm = (21 * n - 1) | 1;
freq = ((48000UL << 15) / rate) * n;
if (rate >... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int snd_ensoniq_playback2_open(struct snd_pcm_substream *substream) {
struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
ensoniq->mode |= ES_MODE_PLAY2;
ensoniq->playback2_substream = substream;
runtime->hw = snd_ensoniq_playback2;
snd... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int snd_ensoniq_playback1_close(struct snd_pcm_substream *substream) {
struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq->playback1_substream = NULL;
ensoniq->mode &= ~ES_MODE_PLAY1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int snd_ensoniq_capture_close(struct snd_pcm_substream *substream) {
struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq->capture_substream = NULL;
spin_lock_irq(&ensoniq->reg_lock);
#ifdef CHIP1370
ensoniq->u.es1370.pclkdiv_lock &= ~ES_MODE_CAPTURE;
#endif
ensoniq->mode &= ~ES_MODE_... | [
0,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int snd_ens1373_spdif_mask_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
ucontrol->value.iec958.status[0] = 0xff;
ucontrol->value.iec958.status[1] = 0xff;
ucontrol->value.iec958.status[2] = 0xff;
ucontrol->value.iec958.status[3] = 0xff;
... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int snd_ens1373_spdif_stream_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
val = ((u32)ucontrol->value.iec958.status[0] << 0) |
((u32)ucontrol... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int snd_es1371_spdif_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
unsigned int nval1, nval2;
int change;
nval1 = ucontrol->value.integer.value[0] ? ES_1373_SPDIF_THRU : 0;
nval2 = ucont... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c | static int snd_ensoniq_get_joystick_port(struct ensoniq *ensoniq, int dev) {
return joystick[dev] ? 0x200 : 0;
}
#endif | [
0,
0
] |
Linux Kernel | sound/pci/ens1370.c | static int snd_ensoniq_create_gameport(struct ensoniq *ensoniq, int dev) {
struct gameport *gp;
int io_port;
io_port = snd_ensoniq_get_joystick_port(ensoniq, dev);
switch (io_port) {
case 0:
return -ENOSYS;
case 1:
for (io_port = 0x200; io_port <= 0x218; io_port += 8)
if (request_region(io_... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c | static void snd_ensoniq_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct ensoniq *ensoniq = entry->private_data;
snd_iprintf(buffer, "Ensoniq AudioPCI " CHIP_NAME "\n\n");
snd_iprintf(buffer, "Joystick enable : %s\n",
ensoniq->ctrl ... | [
0,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int
snd_ensoniq_midi_input_open(struct snd_rawmidi_substream *substream) {
struct ensoniq *ensoniq = substream->rmidi->private_data;
spin_lock_irq(&ensoniq->reg_lock);
ensoniq->uartm |= ES_MODE_INPUT;
ensoniq->midi_input = substream;
if (!(ensoniq->uartm & ES_MODE_OUTPUT)) {
outb(ES_CNTRL(3), ES_... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int
snd_ensoniq_midi_output_open(struct snd_rawmidi_substream *substream) {
struct ensoniq *ensoniq = substream->rmidi->private_data;
spin_lock_irq(&ensoniq->reg_lock);
ensoniq->uartm |= ES_MODE_OUTPUT;
ensoniq->midi_output = substream;
if (!(ensoniq->uartm & ES_MODE_INPUT)) {
outb(ES_CNTRL(3), E... | [
1,
0
] |
Linux Kernel | sound/pci/ens1370.c |
static int snd_ensoniq_midi(struct ensoniq *ensoniq, int device) {
struct snd_rawmidi *rmidi;
int err;
err = snd_rawmidi_new(ensoniq->card, "ES1370/1", device, 1, 1, &rmidi);
if (err < 0)
return err;
strcpy(rmidi->name, CHIP_NAME);
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c | static void snd_es1938_mixer_write(struct es1938 *chip, unsigned char reg,
unsigned char val) {
unsigned long flags;
spin_lock_irqsave(&chip->mixer_lock, flags);
outb(reg, SLSB_REG(chip, MIXERADDR));
outb(val, SLSB_REG(chip, MIXERDATA));
spin_unlock_irqrestore(&chip->mixer_l... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c | static int snd_es1938_mixer_read(struct es1938 *chip, unsigned char reg) {
int data;
unsigned long flags;
spin_lock_irqsave(&chip->mixer_lock, flags);
outb(reg, SLSB_REG(chip, MIXERADDR));
data = inb(SLSB_REG(chip, MIXERDATA));
spin_unlock_irqrestore(&chip->mixer_lock, flags);
dev_dbg(chip->card->dev, "Mi... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c | static void snd_es1938_rate_set(struct es1938 *chip,
struct snd_pcm_substream *substream, int mode) {
unsigned int bits, div0;
struct snd_pcm_runtime *runtime = substream->runtime;
if (runtime->rate_num == clocks[0].num)
bits = 128 - runtime->rate_den;
else
bits = 256 - r... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c | static int snd_es1938_playback1_trigger(struct snd_pcm_substream *substream,
int cmd) {
struct es1938 *chip = snd_pcm_substream_chip(substream);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
snd_es1938_mixer_write(chip, ESSSB_IREG_AUDIO2... | [
0,
0
] |
Linux Kernel | sound/pci/es1938.c | static int snd_es1938_capture_prepare(struct snd_pcm_substream *substream) {
struct es1938 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int u, is8, mono;
unsigned int size = snd_pcm_lib_buffer_bytes(substream);
unsigned int count = snd_pcm_lib_period_bytes(s... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.