Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/isa/sb/emu8000.c | static void init_dma(struct snd_emu8000 *emu) {
EMU8000_SMALR_WRITE(emu, 0);
EMU8000_SMARR_WRITE(emu, 0);
EMU8000_SMALW_WRITE(emu, 0);
EMU8000_SMARW_WRITE(emu, 0);
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000.c |
int snd_emu8000_load_chorus_fx(struct snd_emu8000 *emu, int mode,
const void __user *buf, long len) {
struct soundfont_chorus_fx rec;
if (mode < SNDRV_EMU8000_CHORUS_PREDEFINED ||
mode >= SNDRV_EMU8000_CHORUS_NUMBERS) {
snd_printk(KERN_WARNING "invalid chorus mode %d for up... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000.c |
void snd_emu8000_update_reverb_mode(struct snd_emu8000 *emu) {
int effect = emu->reverb_mode;
int i;
if (effect < 0 || effect >= SNDRV_EMU8000_REVERB_NUMBERS ||
(effect >= SNDRV_EMU8000_REVERB_PREDEFINED && !reverb_defined[effect]))
return;
for (i = 0; i < 28; i++) {
int port;
if (reverb_cmd... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000.c |
static int mixer_chorus_reverb_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_emu8000 *emu = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] =
kcontrol->private_value ? emu->chorus_mode : emu->reverb_mode;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000.c | static int mixer_fm_depth_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 255;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000.c | static int snd_emu8000_create_mixer(struct snd_card *card,
struct snd_emu8000 *emu) {
struct snd_kcontrol *kctl;
int i, err = 0;
if (snd_BUG_ON(!emu || !card))
return -EINVAL;
spin_lock_init(&emu->control_lock);
memset(emu->controls, 0, sizeof(emu->controls));
for ... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_callback.c |
void snd_emu8000_ops_setup(struct snd_emu8000 *hw) {
hw->emu->ops = emu8000_ops;
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000_callback.c | static void terminate_voice(struct snd_emux_voice *vp) {
struct snd_emu8000 *hw;
hw = vp->hw;
EMU8000_DCYSUSV_WRITE(hw, vp->ch, 0x807F);
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000_callback.c |
static void set_fmmod(struct snd_emu8000 *hw, struct snd_emux_voice *vp) {
unsigned short fmmod;
short pitch;
unsigned char cutoff;
int modulation;
pitch = (char)(vp->reg.parm.fmmod >> 8);
cutoff = (vp->reg.parm.fmmod & 0xff);
modulation = vp->chan->gm_modulation + vp->chan->midi_pressure;
pitch += (M... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_callback.c | static void snd_emu8000_tweak_voice(struct snd_emu8000 *emu, int i) {
EMU8000_ENVVOL_WRITE(emu, i, 0x8000);
EMU8000_ENVVAL_WRITE(emu, i, 0x8000);
EMU8000_DCYSUS_WRITE(emu, i, 0x7F7F);
EMU8000_ATKHLDV_WRITE(emu, i, 0x7F7F);
EMU8000_ATKHLD_WRITE(emu, i, 0x7F7F);
EMU8000_PEFE_WRITE(emu, i, 0); /* mod ... | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000_callback.c | static int load_fx(struct snd_emux *emu, int type, int mode,
const void __user *buf, long len) {
struct snd_emu8000 *hw;
hw = emu->hw;
buf += 16;
len -= 16;
switch (type) {
case SNDRV_EMU8000_LOAD_CHORUS_FX:
return snd_emu8000_load_chorus_fx(hw, mode, buf, len);
case SNDRV_EMU8000... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static void emu8k_close_dram(struct snd_emu8000 *emu) {
int i;
for (i = 0; i < 2; i++)
snd_emux_unlock_voice(emu->emu, i);
for (; i < EMU8000_DRAM_VOICES; i++) {
snd_emu8000_dma_chan(emu, i, EMU8000_RAM_CLOSE);
snd_emux_unlock_voice(emu->emu, i);
}
}
#define OFFSET_SAMPLERATE 1011119 /* base = 441... | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static inline int emu8k_get_curpos(struct snd_emu8k_pcm *rec, int ch) {
int val = EMU8000_CCCA_READ(rec->emu, ch) & 0xfffffff;
val -= rec->loop_start[ch] - 1;
return val;
} | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static void emu8k_pcm_timer_func(struct timer_list *t) {
struct snd_emu8k_pcm *rec = from_timer(rec, t, timer);
int ptr, delta;
spin_lock(&rec->timer_lock);
ptr = emu8k_get_curpos(rec, 0);
if (ptr < rec->last_ptr)
delta = ptr + rec->buf_size - rec->last_ptr;
else
delta = ptr - rec->last_ptr;
rec... | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static void start_voice(struct snd_emu8k_pcm *rec, int ch) {
unsigned long flags;
struct snd_emu8000 *hw = rec->emu;
unsigned int temp, aux;
int pt = calc_pitch_target(rec->pitch);
EMU8000_IFATN_WRITE(hw, ch, 0xff00);
EMU8000_VTFT_WRITE(hw, ch, 0xffff);
EMU8000_CVCF_WRITE(hw, ch, 0xffff);
/* trigger en... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static void stop_voice(struct snd_emu8k_pcm *rec, int ch) {
unsigned long flags;
struct snd_emu8000 *hw = rec->emu;
EMU8000_DCYSUSV_WRITE(hw, ch, 0x807F);
spin_lock_irqsave(&rec->timer_lock, flags);
if (rec->timer_running) {
del_timer(&rec->timer);
rec->timer_running = 0;
}
spin_unlock_irqrestor... | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static int emu8k_pcm_silence(struct snd_pcm_substream *subs, int voice,
unsigned long pos, unsigned long count) {
struct snd_emu8k_pcm *rec = subs->runtime->private_data;
pos = (pos << 1) + rec->loop_start[voice];
count <<= 1;
LOOP_WRITE(rec, pos, NULL, count, FILL_SILENCE);
retu... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static int emu8k_pcm_copy_kernel(struct snd_pcm_substream *subs, int voice,
unsigned long pos, void *src,
unsigned long count) {
struct snd_emu8k_pcm *rec = subs->runtime->private_data;
pos = bytes_to_frames(subs->runtime, pos);
count = bytes_to_f... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static int emu8k_pcm_silence(struct snd_pcm_substream *subs, int voice,
unsigned long pos, unsigned long count) {
struct snd_emu8k_pcm *rec = subs->runtime->private_data;
pos = bytes_to_frames(subs->runtime, pos);
count = bytes_to_frames(subs->runtime, count);
LOOP_WRITE(rec, pos, ... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static int emu8k_pcm_hw_free(struct snd_pcm_substream *subs) {
struct snd_emu8k_pcm *rec = subs->runtime->private_data;
if (rec->block) {
int ch;
for (ch = 0; ch < rec->voices; ch++)
stop_voice(rec, ch);
if (rec->dram_opened)
emu8k_close_dram(rec->emu);
snd_util_mem_free(rec->emu->memhd... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_pcm.c | static int emu8k_pcm_prepare(struct snd_pcm_substream *subs) {
struct snd_emu8k_pcm *rec = subs->runtime->private_data;
rec->pitch = 0xe000 + calc_rate_offset(subs->runtime->rate);
rec->last_ptr = 0;
rec->period_pos = 0;
rec->buf_size = subs->runtime->buffer_size;
rec->period_size = subs->runtime->period_... | [
1,
0
] |
Linux Kernel | sound/isa/sb/emu8000_synth.c | static int snd_emu8000_remove(struct device *_dev) {
struct snd_seq_device *dev = to_seq_dev(_dev);
struct snd_emu8000 *hw;
if (dev->driver_data == NULL)
return 0;
hw = dev->driver_data;
if (hw->pcm)
snd_device_free(dev->card, hw->pcm);
snd_emux_free(hw->emu);
snd_util_memhdr_free(hw->memhdr);
... | [
0,
0
] |
Linux Kernel | sound/isa/sb/jazz16.c |
static int jazz16_configure_ports(unsigned long port, unsigned long mpu_port,
int idx) {
unsigned char val;
if (!request_region(0x201, 1, "jazz16 config")) {
snd_printk(KERN_ERR "config port region is already in use.\n");
return -EBUSY;
}
outb(SB_JAZZ16_WAKEUP - idx, ... | [
1,
0
] |
Linux Kernel | sound/isa/sb/jazz16.c | static int jazz16_detect_board(unsigned long port, unsigned long mpu_port) {
int err;
int val;
struct snd_sb chip;
if (!request_region(port, 0x10, "jazz16")) {
snd_printk(KERN_ERR "I/O port region is already in use.\n");
return -EBUSY;
}
chip.port = port;
err = snd_sbdsp_reset(&chip);
if (err... | [
1,
0
] |
Linux Kernel | sound/isa/sb/jazz16.c |
static int jazz16_configure_board(struct snd_sb *chip, int mpu_irq) {
static const unsigned char jazz_irq_bits[] = {0, 0, 2, 3, 0, 1, 0, 4,
0, 2, 5, 0, 0, 0, 0, 6};
static const unsigned char jazz_dma_bits[] = {0, 1, 0, 2, 0, 3, 0, 4};
if (jazz_dma_bits[chip->dma8... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb16.c | static int snd_sb16_isa_suspend(struct device *dev, unsigned int n,
pm_message_t state) {
return snd_sb16_suspend(dev_get_drvdata(dev), state);
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb16_csp.c | static void snd_sb_csp_free(struct snd_hwdep *hwdep) {
int i;
struct snd_sb_csp *p = hwdep->private_data;
if (p) {
if (p->running & SNDRV_SB_CSP_ST_RUNNING)
snd_sb_csp_stop(p);
for (i = 0; i < ARRAY_SIZE(p->csp_programs); ++i)
release_firmware(p->csp_programs[i]);
kfree(p);
}
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb16_csp.c | static int set_mode_register(struct snd_sb *chip, unsigned char mode) {
unsigned char dsp_cmd[2];
dsp_cmd[0] = 0x04;
dsp_cmd[1] = mode; /* mode */
return command_seq(chip, dsp_cmd, 2);
} | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb16_csp.c | static int snd_sb_csp_load_user(struct snd_sb_csp *p,
const unsigned char __user *buf, int size,
int load_flags) {
int err;
unsigned char *kbuf;
kbuf = memdup_user(buf, size);
if (IS_ERR(kbuf))
return PTR_ERR(kbuf);
err = snd_sb_csp_load(p,... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb16_csp.c |
static int snd_sb_qsound_build(struct snd_sb_csp *p) {
struct snd_card *card;
struct snd_kcontrol *kctl;
int err;
if (snd_BUG_ON(!p))
return -EINVAL;
card = p->chip->card;
p->qpos_left = p->qpos_right = SNDRV_SB_CSP_QSOUND_MAX_RIGHT / 2;
p->qpos_changed = 0;
spin_lock_init(&p->q_lock);
kctl =... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb16_csp.c | static int snd_sb_csp_qsound_transfer(struct snd_sb_csp *p) {
int err = -ENXIO;
spin_lock(&p->q_lock);
if (p->running & SNDRV_SB_CSP_ST_QSOUND) {
set_codec_parameter(p->chip, 0xe0, 0x01);
set_codec_parameter(p->chip, 0x00, p->qpos_left);
set_codec_parameter(p->chip, 0x02, 0x00);
/* right channel... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb16_main.c | static void snd_sb16_csp_capture_prepare(struct snd_sb *chip,
struct snd_pcm_runtime *runtime) {
if (chip->hardware == SB_HW_16CSP) {
struct snd_sb_csp *csp = chip->csp;
if (csp->running & SNDRV_SB_CSP_ST_LOADED) {
if ((csp->mode & SNDRV_SB_CSP_MODE_DSP_READ) &... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb16_main.c |
static int snd_sb16_playback_close(struct snd_pcm_substream *substream) {
unsigned long flags;
struct snd_sb *chip = snd_pcm_substream_chip(substream);
snd_sb16_csp_playback_close(chip);
spin_lock_irqsave(&chip->open_lock, flags);
chip->playback_substream = NULL;
chip->mode &= ~SB_MODE_PLAYBACK;
spin_un... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb16_main.c |
static int snd_sb16_dma_control_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_sb *chip = snd_kcontrol_chip(kcontrol);
unsigned long flags;
spin_lock_irqsave(&chip->reg_lock, flags);
ucontrol->value.enumerated.item[0] = snd_sb16_get_dma... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb16_main.c |
int snd_sb16dsp_pcm(struct snd_sb *chip, int device) {
struct snd_card *card = chip->card;
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(card, "SB16 DSP", device, 1, 1, &pcm);
if (err < 0)
return err;
sprintf(pcm->name, "DSP v%i.%i", chip->version >> 8, chip->version & 0xff);
pcm->info_flags = SND... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb8.c | static int snd_sb8_suspend(struct device *dev, unsigned int n,
pm_message_t state) {
struct snd_card *card = dev_get_drvdata(dev);
struct snd_sb8 *acard = card->private_data;
struct snd_sb *chip = acard->chip;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_sbmixer_suspend... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb8_main.c | irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip) {
struct snd_pcm_substream *substream;
snd_sb_ack_8bit(chip);
switch (chip->mode) {
case SB_MODE_PLAYBACK_16:
if (chip->hardware != SB_HW_JAZZ16)
break;
fallthrough;
case SB_MODE_PLAYBACK_8:
substream = chip->playback_substream;
if (... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb8_main.c |
static snd_pcm_uframes_t
snd_sb8_capture_pointer(struct snd_pcm_substream *substream) {
struct snd_sb *chip = snd_pcm_substream_chip(substream);
size_t ptr;
int dma;
if (chip->mode & SB_MODE_CAPTURE_8)
dma = chip->dma8;
else if (chip->mode & SB_MODE_CAPTURE_16)
dma = chip->dma16;
else
return 0... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb8_main.c |
static int snd_sb8_close(struct snd_pcm_substream *substream) {
unsigned long flags;
struct snd_sb *chip = snd_pcm_substream_chip(substream);
chip->playback_substream = NULL;
chip->capture_substream = NULL;
spin_lock_irqsave(&chip->open_lock, flags);
chip->open &= ~SB_OPEN_PCM;
if (substream->stream == ... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb8_midi.c | irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip) {
struct snd_rawmidi *rmidi;
int max = 64;
char byte;
if (!chip)
return IRQ_NONE;
rmidi = chip->rmidi;
if (!rmidi) {
inb(SBP(chip, DATA_AVAIL));
return IRQ_NONE;
}
spin_lock(&chip->midi_input_lock);
while (max-- > 0) {
if (i... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb8_midi.c | static int
snd_sb8dsp_midi_output_close(struct snd_rawmidi_substream *substream) {
unsigned long flags;
struct snd_sb *chip;
chip = substream->rmidi->private_data;
del_timer_sync(&chip->midi_timer);
spin_lock_irqsave(&chip->open_lock, flags);
chip->open &= ~(SB_OPEN_MIDI_OUTPUT | SB_OPEN_MIDI_OUTPUT_TRIGGE... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb8_midi.c | static void
snd_sb8dsp_midi_output_write(struct snd_rawmidi_substream *substream) {
unsigned long flags;
struct snd_sb *chip;
char byte;
int max = 32;
chip = substream->rmidi->private_data;
while (max-- > 0) {
spin_lock_irqsave(&chip->open_lock, flags);
if (snd_rawmidi_transmit_peek(substream, &byt... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb_common.c |
int snd_sbdsp_reset(struct snd_sb *chip) {
int i;
outb(1, SBP(chip, RESET));
udelay(10);
outb(0, SBP(chip, RESET));
udelay(30);
for (i = BUSY_LOOPS; i; i--)
if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
if (inb(SBP(chip, READ)) == 0xaa)
return 0;
else
break;
}
snd_printdd(... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb_common.c |
static int snd_sbdsp_version(struct snd_sb *chip) {
unsigned int result;
snd_sbdsp_command(chip, SB_DSP_GET_VERSION);
result = (short)snd_sbdsp_get_byte(chip) << 8;
result |= (short)snd_sbdsp_get_byte(chip);
return result;
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb_mixer.c |
static int snd_sbmixer_put_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 16) & 0x07;
int mas... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb_mixer.c | static int snd_sbmixer_info_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
int mask = (kcontrol->private_value >> 24) & 0xff;
uinfo->type =
mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.in... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb_mixer.c | static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[5] = {"CD", "Mic", "Line", "Synth", "Master"};
return snd_ctl_enum_info(uinfo, 1, 5, texts);
} | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb_mixer.c |
static int
snd_als4k_mono_capture_route_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int change;
unsigned char nval, oval;
if (ucontrol->value.enumerated.item[0] > 2)
retur... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb_mixer.c |
static int snd_sb8mixer_get_mux(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
unsigned long flags;
unsigned char oval;
spin_lock_irqsave(&sb->mixer_lock, flags);
oval = snd_sbmixer_read(sb, SB_DSP_CAPTU... | [
0,
0
] |
Linux Kernel | sound/isa/sb/sb_mixer.c |
static int snd_sb8mixer_put_mux(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int change;
unsigned char nval, oval;
if (ucontrol->value.enumerated.item[0] > 2)
return -EINVAL;
... | [
1,
0
] |
Linux Kernel | sound/isa/sb/sb_mixer.c |
static void restore_mixer(struct snd_sb *chip, const unsigned char *regs,
int num_regs) {
unsigned char *val = chip->saved_regs;
if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
return;
for (; num_regs; num_regs--)
snd_sbmixer_write(chip, *regs++, *val++);
} | [
1,
0
] |
Linux Kernel | sound/isa/sc6000.c | static unsigned char sc6000_dma_to_softcfg(int dma) {
unsigned char val = 0;
switch (dma) {
case 0:
val = 1;
break;
case 1:
val = 2;
break;
case 3:
val = 3;
break;
default:
break;
}
return val;
} | [
1,
0
] |
Linux Kernel | sound/isa/sscape.c |
static inline struct soundscape *get_card_soundscape(struct snd_card *c) {
return (struct soundscape *)(c->private_data);
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static inline unsigned char sscape_read_unsafe(unsigned io_base,
enum GA_REG reg) {
outb(reg, ODIE_ADDR_IO(io_base));
return inb(ODIE_DATA_IO(io_base));
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static int host_read_ctrl_unsafe(unsigned io_base, unsigned timeout) {
int data;
while (((data = host_read_unsafe(io_base)) < 0) && (timeout != 0)) {
udelay(100);
--timeout;
}
return data;
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static int host_write_ctrl_unsafe(unsigned io_base, unsigned char data,
unsigned timeout) {
int err;
while (!(err = host_write_unsafe(io_base, data)) && (timeout != 0)) {
udelay(100);
--timeout;
}
return err;
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static inline int verify_mpu401(const struct snd_mpu401 *mpu) {
return ((inb(MPU401C(mpu)) & 0xc0) == 0x80);
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static inline void initialise_mpu401(const struct snd_mpu401 *mpu) {
outb(0, MPU401D(mpu));
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static void activate_ad1845_unsafe(unsigned io_base) {
unsigned char val = sscape_read_unsafe(io_base, GA_HMCTL_REG);
sscape_write_unsafe(io_base, GA_HMCTL_REG, (val & 0xcf) | 0x10);
sscape_write_unsafe(io_base, GA_CDCFG_REG, 0x80);
} | [
1,
0
] |
Linux Kernel | sound/isa/sscape.c | static void sscape_start_dma_unsafe(unsigned io_base, enum GA_REG reg) {
sscape_write_unsafe(io_base, reg, sscape_read_unsafe(io_base, reg) | 0x01);
sscape_write_unsafe(io_base, reg, sscape_read_unsafe(io_base, reg) & 0xfe);
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static int sscape_upload_microcode(struct snd_card *card, int version) {
struct soundscape *sscape = get_card_soundscape(card);
const struct firmware *init_fw = NULL;
char name[14];
int err;
snprintf(name, sizeof(name), "sndscape.co%d", version);
err = request_firmware(&init_fw, name, card->dev);
if (er... | [
1,
0
] |
Linux Kernel | sound/isa/sscape.c |
static int sscape_midi_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uctl) {
struct snd_wss *chip = snd_kcontrol_chip(kctl);
struct snd_card *card = chip->card;
register struct soundscape *s = get_card_soundscape(card);
unsigned long flags;
spin_lock_irqsave(&s->lock, ... | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c | static int mpu401_open(struct snd_mpu401 *mpu) {
if (!verify_mpu401(mpu)) {
snd_printk(KERN_ERR "sscape: MIDI disabled, "
"please load firmware\n");
return -ENODEV;
}
return 0;
} | [
0,
0
] |
Linux Kernel | sound/isa/sscape.c |
static int snd_sscape_probe(struct device *pdev, unsigned int dev) {
struct snd_card *card;
struct soundscape *sscape;
int ret;
ret = snd_devm_card_new(pdev, index[dev], id[dev], THIS_MODULE,
sizeof(struct soundscape), &card);
if (ret < 0)
return ret;
sscape = get_card_sound... | [
1,
0
] |
Linux Kernel | sound/isa/sscape.c | static inline int get_next_autoindex(int i) {
while (i < SNDRV_CARDS && port[i] != SNDRV_AUTO_PORT)
++i;
return i;
} | [
1,
0
] |
Linux Kernel | sound/isa/sscape.c |
static int __init sscape_init(void) {
int err;
err = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS);
#ifdef CONFIG_PNP
if (!err)
isa_registered = 1;
err = pnp_register_card_driver(&sscape_pnpc_driver);
if (!err)
pnp_registered = 1;
if (isa_registered)
err = 0;
#endif
return err;
} | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront.c |
static struct snd_hwdep *snd_wavefront_new_fx(struct snd_card *card, int hw_dev,
snd_wavefront_card_t *acard,
unsigned long port)
{
struct snd_hwdep *fx_processor;
if (snd_wavefront_fx_start(&acard->wavefront)) {
snd_... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront.c |
static int snd_wavefront_card_new(struct device *pdev, int dev,
struct snd_card **cardp) {
struct snd_card *card;
snd_wavefront_card_t *acard;
int err;
err = snd_devm_card_new(pdev, index[dev], id[dev], THIS_MODULE,
sizeof(snd_wavefront_card_t), &car... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_fx.c |
static int wavefront_fx_idle(snd_wavefront_t *dev)
{
int i;
unsigned int x = 0x80;
for (i = 0; i < 1000; i++) {
x = inb(dev->fx_status);
if ((x & 0x80) == 0) {
break;
}
}
if (x & 0x80) {
snd_printk("FX device never idle.\n");
return 0;
}
return (1);
} | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_fx.c |
static void wavefront_fx_mute(snd_wavefront_t *dev, int onoff)
{
if (!wavefront_fx_idle(dev)) {
return;
}
outb(onoff ? 0x02 : 0x00, dev->fx_op);
} | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_fx.c | int snd_wavefront_fx_ioctl(struct snd_hwdep *sdev, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct snd_card *card;
snd_wavefront_card_t *acard;
snd_wavefront_t *dev;
wavefront_fx_info r;
unsigned short *page_data = NULL;
unsigned short *pd;
int err = 0;
card... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_fx.c | int snd_wavefront_fx_start(snd_wavefront_t *dev) {
unsigned int i;
int err;
const struct firmware *firmware = NULL;
if (dev->fx_initialized)
return 0;
err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
dev->card->dev);
if (err < 0) {
err = -1;
goto out;
... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_midi.c |
static inline int output_ready(snd_wavefront_midi_t *midi)
{
return !(wf_mpu_status(midi) & OUTPUT_READY);
} | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_midi.c |
static int
snd_wavefront_midi_input_close(struct snd_rawmidi_substream *substream) {
unsigned long flags;
snd_wavefront_midi_t *midi;
snd_wavefront_mpu_id mpu;
if (snd_BUG_ON(!substream || !substream->rmidi))
return -ENXIO;
if (snd_BUG_ON(!substream->rmidi->private_data))
return -ENXIO;
mpu = *((... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c |
static const char *wavefront_errorstr(int errnum)
{
int i;
for (i = 0; wavefront_errors[i].errstr; i++) {
if (wavefront_errors[i].errno == errnum) {
return wavefront_errors[i].errstr;
}
}
return "Unknown WaveFront error";
} | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c |
static inline int wavefront_status(snd_wavefront_t *dev)
{
return inb(dev->status_port);
} | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c |
static int demunge_int32(unsigned char *src, int src_size)
{
int i;
int outval = 0;
for (i = src_size - 1; i >= 0; i--) {
outval = (outval << 7) + src[i];
}
return outval;
} | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c | static unsigned char *demunge_buf(unsigned char *src, unsigned char *dst,
unsigned int src_bytes)
{
int i;
unsigned char *end = src + src_bytes;
for (i = 0; src != end; i++) {
dst[i] = *src++;
dst[i] |= (*src++) << 7;
}
return dst;
} | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c | static int wavefront_delete_sample(snd_wavefront_t *dev, int sample_num)
{
unsigned char wbuf[2];
int x;
wbuf[0] = sample_num & 0x7f;
wbuf[1] = sample_num >> 7;
x = snd_wavefront_cmd(dev, WFC_DELETE_SAMPLE, NULL, wbuf);
if (!x)
dev->sample_status[sample_num] = WF_ST_EMPTY;
return x;
} | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c | static int wavefront_get_sample_status(snd_wavefront_t *dev, int assume_rom)
{
int i;
unsigned char rbuf[32], wbuf[32];
unsigned int sc_real, sc_alias, sc_multi;
if (snd_wavefront_cmd(dev, WFC_GET_NSAMPLES, rbuf, wbuf)) {
snd_printk("cannot request sample count.\n");
return -1;
}
sc_real = sc_ali... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c | static int wavefront_get_program_status(snd_wavefront_t *dev)
{
unsigned char progbuf[WF_PROGRAM_BYTES];
wavefront_program prog;
unsigned char prognum;
int i, x, l, cnt;
for (i = 0; i < WF_MAX_PROGRAM; i++) {
prognum = i;
x = snd_wavefront_cmd(dev, WFC_UPLOAD_PROGRAM, progbuf, &prognum);
if (x ... | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c |
static int wavefront_send_patch(snd_wavefront_t *dev,
wavefront_patch_info *header)
{
unsigned char buf[WF_PATCH_BYTES + 2];
unsigned char *bptr;
DPRINT(WF_DEBUG_LOAD_PATCH, "downloading patch %d\n", header->number);
if (header->number >= ARRAY_SIZE(dev->patch_status))
re... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c |
static int wavefront_send_alias(snd_wavefront_t *dev,
wavefront_patch_info *header)
{
unsigned char alias_hdr[WF_ALIAS_BYTES];
DPRINT(WF_DEBUG_LOAD_PATCH,
"download alias, %d is "
"alias for %d\n",
header->number, header->hdr.a.OriginalSample);
if (he... | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c | static int wavefront_send_multisample(snd_wavefront_t *dev,
wavefront_patch_info *header) {
int i;
int num_samples;
unsigned char *msample_hdr;
if (header->number >= WF_MAX_SAMPLE)
return -EINVAL;
msample_hdr = kmalloc(WF_MSAMPLE_BYTES, GFP_KERNEL);
if (!msample_h... | [
1,
1
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c |
static int wavefront_find_free_sample(snd_wavefront_t *dev)
{
int i;
for (i = 0; i < WF_MAX_SAMPLE; i++) {
if (!(dev->sample_status[i] & WF_SLOT_FILLED)) {
return i;
}
}
snd_printk("no free sample slots!\n");
return -1;
}
#if 0
static int
wavefront_find_free_patch (snd_wavefront_t *dev)
{
... | [
0,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c | static int snd_wavefront_interrupt_bits(int irq)
{
int bits;
switch (irq) {
case 9:
bits = 0x00;
break;
case 5:
bits = 0x08;
break;
case 12:
bits = 0x10;
break;
case 15:
bits = 0x18;
break;
default:
snd_printk("invalid IRQ %d\n", irq);
bits = -1;
}
return bi... | [
1,
0
] |
Linux Kernel | sound/isa/wavefront/wavefront_synth.c | static int wavefront_download_firmware(snd_wavefront_t *dev, char *path)
{
const unsigned char *buf;
int len, err;
int section_cnt_downloaded = 0;
const struct firmware *firmware;
err = request_firmware(&firmware, path, dev->card->dev);
if (err < 0) {
snd_printk(KERN_ERR "firmware (%s) download failed... | [
1,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c | static inline void wss_outb(struct snd_wss *chip, u8 offset, u8 val) {
outb(val, chip->port + offset);
} | [
0,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c |
static void snd_wss_wait(struct snd_wss *chip) {
int timeout;
for (timeout = 250;
timeout > 0 && (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); timeout--)
udelay(100);
} | [
0,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c |
unsigned char snd_cs4236_ext_in(struct snd_wss *chip, unsigned char reg) {
wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | 0x17);
wss_outb(chip, CS4231P(REG), reg | (chip->image[CS4236_EXT_REG] & 0x01));
#if 1
return wss_inb(chip, CS4231P(REG));
#else
{
unsigned char res;
res = wss_inb(chip, CS4231P(RE... | [
0,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c |
static int snd_wss_timer_stop(struct snd_timer *timer) {
unsigned long flags;
struct snd_wss *chip = snd_timer_chip(timer);
spin_lock_irqsave(&chip->reg_lock, flags);
chip->image[CS4231_ALT_FEATURE_1] &= ~CS4231_TIMER_ENABLE;
snd_wss_out(chip, CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1]);
spin_... | [
0,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c |
static int snd_wss_playback_close(struct snd_pcm_substream *substream) {
struct snd_wss *chip = snd_pcm_substream_chip(substream);
chip->playback_substream = NULL;
snd_wss_close(chip, WSS_MODE_PLAY);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c | static void snd_wss_thinkpad_twiddle(struct snd_wss *chip, int on) {
int tmp;
if (!chip->thinkpad_flag)
return;
outb(0x1c, AD1848_THINKPAD_CTL_PORT1);
tmp = inb(AD1848_THINKPAD_CTL_PORT2);
if (on)
tmp |= AD1848_THINKPAD_CS4248_ENABLE_BIT;
else
/* turn it off */
tmp &= ~AD1848_THINKPAD_CS... | [
0,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c |
const char *snd_wss_chip_id(struct snd_wss *chip) {
switch (chip->hardware) {
case WSS_HW_CS4231:
return "CS4231";
case WSS_HW_CS4231A:
return "CS4231A";
case WSS_HW_CS4232:
return "CS4232";
case WSS_HW_CS4232A:
return "CS4232A";
case WSS_HW_CS4235:
return "CS4235";
case WSS_HW_CS4236... | [
0,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c |
int snd_wss_get_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_wss *chip = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff;
int mask = (kcontrol->priva... | [
1,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c |
int snd_wss_put_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_wss *chip = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
int shift_left = (... | [
1,
0
] |
Linux Kernel | sound/isa/wss/wss_lib.c | int snd_wss_mixer(struct snd_wss *chip) {
struct snd_card *card;
unsigned int idx;
int err;
int count = ARRAY_SIZE(snd_wss_controls);
if (snd_BUG_ON(!chip || !chip->pcm))
return -EINVAL;
card = chip->card;
strcpy(card->mixername, chip->pcm->name);
if (chip->hardware & WSS_HW_AD1848_MASK)
cou... | [
1,
0
] |
Linux Kernel | sound/mips/ad1843.c | static void ad1843_read_multi(struct snd_ad1843 *ad1843, int argcount, ...) {
va_list ap;
const struct ad1843_bitfield *fp;
int w = 0, mask, *value, reg = -1;
va_start(ap, argcount);
while (--argcount >= 0) {
fp = va_arg(ap, const struct ad1843_bitfield *);
value = va_arg(ap, int *);
if (reg == -... | [
1,
0
] |
Linux Kernel | sound/mips/ad1843.c | int ad1843_set_gain(struct snd_ad1843 *ad1843, int id, int newval) {
const struct ad1843_gain *gp = ad1843_gain[id];
unsigned short mask = (1 << gp->lfield->nbits) - 1;
int lg = (newval >> 0) & mask;
int rg = (newval >> 8) & mask;
int lm = (lg == 0) ? 1 : 0;
int rm = (rg == 0) ? 1 : 0;
if (gp->negative)... | [
1,
0
] |
Linux Kernel | sound/mips/ad1843.c |
void ad1843_setup_adc(struct snd_ad1843 *ad1843, unsigned int framerate,
snd_pcm_format_t fmt, unsigned int channels) {
int da_fmt = 0;
switch (fmt) {
case SNDRV_PCM_FORMAT_S8:
da_fmt = 0;
break;
case SNDRV_PCM_FORMAT_U8:
da_fmt = 0;
break;
case SNDRV_PCM_FORMAT_S16_LE:... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.