Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/isa/es1688/es1688_lib.c |
static snd_pcm_uframes_t
snd_es1688_capture_pointer(struct snd_pcm_substream *substream) {
struct snd_es1688 *chip = snd_pcm_substream_chip(substream);
size_t ptr;
if (chip->trigger_value != 0x0f)
return 0;
ptr = snd_dma_pointer(chip->dma8, chip->dma_size);
return bytes_to_frames(substream->runtime, ptr... | [
0,
0
] |
Linux Kernel | sound/isa/es1688/es1688_lib.c | static int snd_es1688_playback_open(struct snd_pcm_substream *substream) {
struct snd_es1688 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
if (chip->capture_substream != NULL)
return -EAGAIN;
chip->playback_substream = substream;
runtime->hw = snd_es1688... | [
0,
0
] |
Linux Kernel | sound/isa/es1688/es1688_lib.c |
static int snd_es1688_get_mux(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol);
ucontrol->value.enumerated.item[0] =
snd_es1688_mixer_read(chip, ES1688_REC_DEV) & 7;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/isa/es1688/es1688_lib.c |
static int snd_es1688_put_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff;
int ... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_read(struct snd_es18xx *chip, unsigned char reg) {
unsigned long flags;
int ret, data;
spin_lock_irqsave(&chip->reg_lock, flags);
ret = snd_es18xx_dsp_command(chip, 0xC0);
if (ret < 0)
goto end;
ret = snd_es18xx_dsp_command(chip, reg);
if (ret < 0)
goto end;
data = snd_es1... | [
0,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_reset(struct snd_es18xx *chip) {
int i;
outb(0x03, chip->port + 0x06);
inb(chip->port + 0x06);
outb(0x00, chip->port + 0x06);
for (i = 0; i < MILLISECOND && !(inb(chip->port + 0x0E) & 0x80); i++)
;
if (inb(chip->port + 0x0A) != 0xAA)
return -1;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_playback_prepare(struct snd_pcm_substream *substream) {
struct snd_es18xx *chip = snd_pcm_substream_chip(substream);
if (substream->number == 0 && (chip->caps & ES18XX_PCM2))
return snd_es18xx_playback1_prepare(chip, substream);
else
return snd_es18xx_playback2_prepare(chip, substre... | [
0,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static snd_pcm_uframes_t
snd_es18xx_playback_pointer(struct snd_pcm_substream *substream) {
struct snd_es18xx *chip = snd_pcm_substream_chip(substream);
unsigned int size = snd_pcm_lib_buffer_bytes(substream);
int pos;
if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) {
if (!(chip->active & DAC2))... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int
snd_es18xx_get_spatializer_enable(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol);
unsigned char val = snd_es18xx_mixer_read(chip, 0x50);
ucontrol->value.integer.value[0] = !!(val & 8);
retu... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int
snd_es18xx_put_spatializer_enable(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol);
unsigned char oval, nval;
int change;
nval = ucontrol->value.integer.value[0] ? 0x0c : 0x04;
oval = snd_e... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_reg_bits(struct snd_es18xx *chip, unsigned char reg,
unsigned char mask, unsigned char val) {
if (reg < 0xa0)
return snd_es18xx_mixer_bits(chip, reg, mask, val);
else
return snd_es18xx_bits(chip, reg, mask, val);
} | [
0,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_reg_read(struct snd_es18xx *chip, unsigned char reg) {
if (reg < 0xa0)
return snd_es18xx_mixer_read(chip, reg);
else
return snd_es18xx_read(chip, reg);
}
#define ES18XX_SINGLE(xname, xindex, reg, shift, mask, flags) \
{.iface = SNDRV_CTL_ELEM_IFACE_MIXER, ... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_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.int... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_get_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol);
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
int shift_left = (... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_put_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol);
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
int shift_left = (... | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c | static int snd_es18xx_resume(struct snd_card *card) {
struct snd_es18xx *chip = card->private_data;
snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg ^= ES18XX_PM_FM);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif /* CONFIG_PM */ | [
0,
0
] |
Linux Kernel | sound/isa/es18xx.c | static int snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev) {
if (pnp_activate_dev(pdev) < 0) {
snd_printk(KERN_ERR PFX "PnP configure failure (out of resources?)\n");
return -EBUSY;
}
/* ok. hack using Vendor-Defined Card-Level registers */
/* skip csn and logdev initialization - already don... | [
0,
1
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_card_new(struct device *pdev, int dev,
struct snd_card **cardp) {
return snd_devm_card_new(pdev, index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_es18xx), cardp);
} | [
1,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static int snd_es18xx_isa_resume(struct device *dev, unsigned int n) {
return snd_es18xx_resume(dev_get_drvdata(dev));
}
#endif
#define DEV_NAME "es18xx" | [
0,
0
] |
Linux Kernel | sound/isa/es18xx.c | static int snd_audiodrive_pnp_detect(struct pnp_dev *pdev,
const struct pnp_device_id *id) {
static int dev;
int err;
struct snd_card *card;
if (pnp_device_is_isapnp(pdev))
return -ENOENT;
for (; dev < SNDRV_CARDS; dev++) {
if (enable[dev] && isapnp[dev])
br... | [
0,
0
] |
Linux Kernel | sound/isa/es18xx.c | static int snd_audiodrive_pnp_suspend(struct pnp_dev *pdev,
pm_message_t state) {
return snd_es18xx_suspend(pnp_get_drvdata(pdev), state);
} | [
0,
0
] |
Linux Kernel | sound/isa/es18xx.c |
static void __exit alsa_card_es18xx_exit(void) {
#ifdef CONFIG_PNP
if (pnpc_registered)
pnp_unregister_card_driver(&es18xx_pnpc_driver);
if (pnp_registered)
pnp_unregister_driver(&es18xx_pnp_driver);
if (isa_registered)
#endif
isa_unregister_driver(&snd_es18xx_isa_driver);
} | [
0,
0
] |
Linux Kernel | sound/isa/galaxy/galaxy.c |
static int dsp_get_byte(void __iomem *port, u8 *val) {
int loops = 1000;
while (!(ioread8(port + DSP_PORT_DATA_AVAIL) & 0x80)) {
if (!loops--)
return -EIO;
cpu_relax();
}
*val = ioread8(port + DSP_PORT_READ);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/isa/galaxy/galaxy.c |
static int galaxy_init(struct snd_galaxy *galaxy, u8 *type) {
u8 major;
u8 minor;
int err;
err = dsp_reset(galaxy->port);
if (err < 0)
return err;
err = dsp_get_version(galaxy->port, &major, &minor);
if (err < 0)
return err;
if (major != GALAXY_DSP_MAJOR || minor != GALAXY_DSP_MINOR)
ret... | [
1,
0
] |
Linux Kernel | sound/isa/galaxy/galaxy.c |
static void galaxy_config(struct snd_galaxy *galaxy, u32 config) {
int i;
for (i = GALAXY_CONFIG_SIZE; i; i--) {
u8 tmp = ioread8(galaxy->config_port + i - 1);
galaxy->config = (galaxy->config << 8) | tmp;
}
config |= galaxy->config & GALAXY_CONFIG_MASK;
galaxy_set_config(galaxy, config);
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gusclassic.c |
static int snd_gusclassic_match(struct device *dev, unsigned int n) {
return enable[n];
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gusextreme.c | static int snd_gusextreme_detect(struct snd_gus_card *gus,
struct snd_es1688 *es1688) {
unsigned long flags;
unsigned char d;
spin_lock_irqsave(&es1688->mixer_lock, flags);
snd_es1688_mixer_write(es1688, 0x40, 0x0b); /* don't change!!! */
spin_unlock_irqrestore(&es1688->mixer... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gusextreme.c | static int snd_gusextreme_mixer(struct snd_card *card) {
struct snd_ctl_elem_id id1, id2;
int error;
memset(&id1, 0, sizeof(id1));
memset(&id2, 0, sizeof(id2));
id1.iface = id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
strcpy(id1.name, "Aux Playback Volume");
strcpy(id2.name, "Synth Playback Volume");
error... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gusmax.c |
static int snd_gusmax_match(struct device *pdev, unsigned int dev) {
return enable[dev];
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_dma.c |
static void snd_gf1_dma_interrupt(struct snd_gus_card *gus) {
struct snd_gf1_dma_block *block;
snd_gf1_dma_ack(gus);
if (gus->gf1.dma_ack)
gus->gf1.dma_ack(gus, gus->gf1.dma_private_data);
spin_lock(&gus->dma_lock);
if (gus->gf1.dma_data_pcm == NULL && gus->gf1.dma_data_synth == NULL) {
gus->gf1.dm... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_dram.c |
int snd_gus_dram_read(struct snd_gus_card *gus, char __user *buffer,
unsigned int address, unsigned int size, int rom) {
return snd_gus_dram_peek(gus, buffer, address, size, rom);
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_io.c | static inline void __snd_gf1_ctrl_stop(struct snd_gus_card *gus,
unsigned char reg) {
unsigned char value;
outb(reg | 0x80, gus->gf1.reg_regsel);
mb();
value = inb(gus->gf1.reg_data8);
mb();
outb(reg, gus->gf1.reg_regsel);
mb();
outb((value | 0x03) & ~(0x80 | 0x20... | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_io.c |
static inline void __snd_gf1_write8(struct snd_gus_card *gus, unsigned char reg,
unsigned char data) {
outb(reg, gus->gf1.reg_regsel);
mb();
outb(data, gus->gf1.reg_data8);
mb();
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_io.c |
static inline void __snd_gf1_adlib_write(struct snd_gus_card *gus,
unsigned char reg,
unsigned char data) {
outb(reg, gus->gf1.reg_timerctrl);
inb(gus->gf1.reg_timerctrl);
inb(gus->gf1.reg_timerctrl);
outb(data, gus->gf1.reg_time... | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_io.c | void snd_gf1_ctrl_stop(struct snd_gus_card *gus, unsigned char reg) {
__snd_gf1_ctrl_stop(gus, reg);
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_io.c |
unsigned short snd_gf1_look16(struct snd_gus_card *gus, unsigned char reg) {
return __snd_gf1_look16(gus, reg);
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_io.c | void snd_gf1_dram_addr(struct snd_gus_card *gus, unsigned int addr) {
outb(0x43, gus->gf1.reg_regsel);
mb();
outw((unsigned short)addr, gus->gf1.reg_data16);
mb();
outb(0x44, gus->gf1.reg_regsel);
mb();
outb((unsigned char)(addr >> 16), gus->gf1.reg_data8);
mb();
} | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_main.c |
void snd_gus_use_dec(struct snd_gus_card *gus) {
module_put(gus->card->module);
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_main.c |
static void snd_gus_init_control(struct snd_gus_card *gus) {
if (!gus->ace_flag)
snd_ctl_add(gus->card, snd_ctl_new1(&snd_gus_joystick_control, gus));
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_main.c | static int snd_gus_free(struct snd_gus_card *gus) {
if (gus->gf1.res_port2 == NULL)
goto __hw_end;
snd_gf1_stop(gus);
snd_gus_init_dma_irq(gus, 0);
__hw_end:
release_and_free_resource(gus->gf1.res_port1);
release_and_free_resource(gus->gf1.res_port2);
if (gus->gf1.irq >= 0)
free_irq(gus->gf1.irq, (v... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_main.c | static int snd_gus_detect_memory(struct snd_gus_card *gus) {
int l, idx, local;
unsigned char d;
snd_gf1_poke(gus, 0L, 0xaa);
snd_gf1_poke(gus, 1L, 0x55);
if (snd_gf1_peek(gus, 0L) != 0xaa || snd_gf1_peek(gus, 1L) != 0x55) {
snd_printk(KERN_ERR "plain GF1 card at 0x%lx without onboard DRAM?\n",
... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_main.c |
int snd_gus_initialize(struct snd_gus_card *gus) {
int err;
if (!gus->interwave) {
err = snd_gus_check_version(gus);
if (err < 0) {
snd_printk(KERN_ERR "version check failed\n");
return err;
}
err = snd_gus_detect_memory(gus);
if (err < 0)
return err;
}
err = snd_gus_init... | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_mem.c | static int snd_gf1_mem_find(struct snd_gf1_mem *alloc,
struct snd_gf1_mem_block *block, unsigned int size,
int w_16, int align) {
struct snd_gf1_bank_info *info = w_16 ? alloc->banks_16 : alloc->banks_8;
unsigned int idx, boundary;
int size1;
struct snd_gf... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_mixer.c |
int snd_gf1_new_mixer(struct snd_gus_card *gus) {
struct snd_card *card;
unsigned int idx, max;
int err;
if (snd_BUG_ON(!gus))
return -EINVAL;
card = gus->card;
if (snd_BUG_ON(!card))
return -EINVAL;
if (gus->ics_flag)
snd_component_add(card, "ICS2101");
if (card->mixername[0] == '\0') {
... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_pcm.c |
static int get_bpos(struct gus_pcm_private *pcmp, int voice, unsigned int pos,
unsigned int len) {
unsigned int bpos = pos + (voice * (pcmp->dma_size / 2));
if (snd_BUG_ON(bpos > pcmp->dma_size))
return -EIO;
if (snd_BUG_ON(bpos + len > pcmp->dma_size))
return -EIO;
return bpos;
} | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_pcm.c |
static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream,
int voice, unsigned long pos,
void __user *src, unsigned long count) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct gus_pcm_private *pcmp = runtime->pr... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_pcm.c | static int snd_gf1_pcm_capture_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params) {
struct snd_gus_card *gus = snd_pcm_substream_chip(substream);
gus->c_dma_size = params_buffer_bytes(hw_params);
gus->c_period_size = params_period_bytes(hw... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_reset.c |
static void snd_gf1_default_interrupt_handler_timer2(struct snd_gus_card *gus) {
snd_gf1_i_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL,
gus->gf1.timer_enabled &= ~8);
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_reset.c |
void snd_gf1_stop_voice(struct snd_gus_card *gus, unsigned short voice) {
unsigned long flags;
spin_lock_irqsave(&gus->reg_lock, flags);
snd_gf1_select_voice(gus, voice);
#if 0
printk(KERN_DEBUG " -%i- stop voice - volume = 0x%x\n", voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME));
#endif
snd_gf1_ctrl_stop... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_timer.c | static int snd_gf1_timer2_stop(struct snd_timer *timer) {
unsigned long flags;
unsigned char tmp;
struct snd_gus_card *gus;
gus = snd_timer_chip(timer);
spin_lock_irqsave(&gus->reg_lock, flags);
tmp = (gus->gf1.timer_enabled &= ~8);
snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, tmp);
spin_unl... | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_timer.c | static void snd_gf1_interrupt_timer1(struct snd_gus_card *gus) {
struct snd_timer *timer = gus->gf1.timer1;
if (timer == NULL)
return;
snd_timer_interrupt(timer, timer->sticks);
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_timer.c |
static void snd_gf1_timer2_free(struct snd_timer *timer) {
struct snd_gus_card *gus = timer->private_data;
gus->gf1.timer2 = NULL;
} | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_timer.c |
void snd_gf1_timers_done(struct snd_gus_card *gus) {
snd_gf1_set_default_handlers(gus, SNDRV_GF1_HANDLER_TIMER1 |
SNDRV_GF1_HANDLER_TIMER2);
if (gus->gf1.timer1) {
snd_device_free(gus->card, gus->gf1.timer1);
gus->gf1.timer1 = NULL;
}
if (gus->gf1.timer2) {
s... | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_uart.c | static void snd_gf1_interrupt_midi_in(struct snd_gus_card *gus) {
int count;
unsigned char stat, byte;
__always_unused unsigned char data;
unsigned long flags;
count = 10;
while (count) {
spin_lock_irqsave(&gus->uart_cmd_lock, flags);
stat = snd_gf1_uart_stat(gus);
if (!(stat & 0x01)) {
s... | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_uart.c | static void snd_gf1_interrupt_midi_out(struct snd_gus_card *gus) {
char byte;
unsigned long flags;
if (snd_gf1_uart_stat(gus) & 0x01)
snd_gf1_interrupt_midi_in(gus);
spin_lock_irqsave(&gus->uart_cmd_lock, flags);
if (snd_gf1_uart_stat(gus) & 0x02) { /* Tx FIFO free? */
if (snd_rawmidi_transmit(gus->... | [
0,
0
] |
Linux Kernel | sound/isa/gus/gus_uart.c | static int snd_gf1_uart_input_open(struct snd_rawmidi_substream *substream) {
unsigned long flags;
struct snd_gus_card *gus;
int i;
gus = substream->rmidi->private_data;
spin_lock_irqsave(&gus->uart_cmd_lock, flags);
if (gus->gf1.interrupt_handler_midi_out != snd_gf1_interrupt_midi_out) {
snd_gf1_uart_... | [
1,
0
] |
Linux Kernel | sound/isa/gus/gus_uart.c |
static int snd_gf1_uart_input_close(struct snd_rawmidi_substream *substream) {
unsigned long flags;
struct snd_gus_card *gus;
gus = substream->rmidi->private_data;
spin_lock_irqsave(&gus->uart_cmd_lock, flags);
if (gus->gf1.interrupt_handler_midi_out != snd_gf1_interrupt_midi_out)
snd_gf1_uart_reset(gus... | [
0,
0
] |
Linux Kernel | sound/isa/gus/interwave.c | static void snd_interwave_i2c_setlines(struct snd_i2c_bus *bus, int ctrl,
int data) {
unsigned long port = bus->private_value;
#if 0
printk(KERN_DEBUG "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data);
#endif
outb((data << 1) | ctrl, port);
udelay(10);
} | [
1,
0
] |
Linux Kernel | sound/isa/gus/interwave.c |
static int snd_interwave_i2c_getclockline(struct snd_i2c_bus *bus) {
unsigned long port = bus->private_value;
unsigned char res;
res = inb(port) & 1;
#if 0
printk(KERN_DEBUG "i2c_getclockline - 0x%lx -> %i\n", port, res);
#endif
return res;
} | [
1,
0
] |
Linux Kernel | sound/isa/gus/interwave.c |
static int snd_interwave_detect_stb(struct snd_interwave *iwcard,
struct snd_gus_card *gus, int dev,
struct snd_i2c_bus **rbus) {
unsigned long port;
struct snd_i2c_bus *bus;
struct snd_card *card = iwcard->card;
char name[32];
int err;
... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
static int snd_msnd_wait_HC0(struct snd_msnd *dev) {
unsigned int io = dev->io;
int timeout = 1000;
while (timeout-- > 0)
if (!(inb(io + HP_CVR) & HPCVR_HC))
return 0;
return -EIO;
} | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
int snd_msnd_send_dsp_cmd(struct snd_msnd *dev, u8 cmd) {
unsigned long flags;
spin_lock_irqsave(&dev->lock, flags);
if (snd_msnd_wait_HC0(dev) == 0) {
outb(cmd, dev->io + HP_CVR);
spin_unlock_irqrestore(&dev->lock, flags);
return 0;
}
spin_unlock_irqrestore(&dev->lock, flags);
snd_printd(KER... | [
0,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
int snd_msnd_send_word(struct snd_msnd *dev, unsigned char high,
unsigned char mid, unsigned char low) {
unsigned int io = dev->io;
if (snd_msnd_wait_TXDE(dev) == 0) {
outb(high, io + HP_TXH);
outb(mid, io + HP_TXM);
outb(low, io + HP_TXL);
return 0;
}
snd_printd(KERN_E... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
int snd_msnd_enable_irq(struct snd_msnd *dev) {
unsigned long flags;
if (dev->irq_ref++)
return 0;
snd_printdd(LOGNAME ": Enabling IRQ\n");
spin_lock_irqsave(&dev->lock, flags);
if (snd_msnd_wait_TXDE(dev) == 0) {
outb(inb(dev->io + HP_ICR) | HPICR_TREQ, dev->io + HP_ICR);
if (dev->type == msn... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
int snd_msnd_disable_irq(struct snd_msnd *dev) {
unsigned long flags;
if (--dev->irq_ref > 0)
return 0;
if (dev->irq_ref < 0)
snd_printd(KERN_WARNING LOGNAME ": IRQ ref count is %d\n", dev->irq_ref);
snd_printdd(LOGNAME ": Disabling IRQ\n");
spin_lock_irqsave(&dev->lock, flags);
if (snd_msnd_wa... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c | int snd_msnd_DAPQ(struct snd_msnd *chip, int start) {
u16 DAPQ_tail;
int protect = start, nbanks = 0;
void __iomem *DAQD;
static int play_banks_submitted;
DAPQ_tail = readw(chip->DAPQ + JQS_wTail);
while (DAPQ_tail != readw(chip->DAPQ + JQS_wHead) || start) {
int bank_num = DAPQ_tail / PCTODSP_OFFSET(D... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c | static void snd_msnd_capture_reset_queue(struct snd_msnd *chip,
unsigned int pcm_periods,
unsigned int pcm_count) {
int n;
void __iomem *pDAQ;
/* snd_msnd_init_queue(chip->DARQ, DARQ_DATA_BUFF, DARQ_BUFF_SIZE); */
chip->last_rec... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
static int snd_msnd_playback_close(struct snd_pcm_substream *substream) {
struct snd_msnd *chip = snd_pcm_substream_chip(substream);
snd_msnd_disable_irq(chip);
clear_bit(F_AUDIO_WRITE_INUSE, &chip->flags);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c | static int snd_msnd_playback_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) {
int i;
struct snd_msnd *chip = snd_pcm_substream_chip(substream);
void __iomem *pDAQ = chip->mappedbase + DAPQ_DATA_BUFF;
chip->play_sample_size = snd_pcm_forma... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
static int snd_msnd_playback_prepare(struct snd_pcm_substream *substream) {
struct snd_msnd *chip = snd_pcm_substream_chip(substream);
unsigned int pcm_size = snd_pcm_lib_buffer_bytes(substream);
unsigned int pcm_count = snd_pcm_lib_period_bytes(substream);
unsigned int pcm_periods = pcm_size / pcm_count;
s... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
static int snd_msnd_capture_open(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_msnd *chip = snd_pcm_substream_chip(substream);
set_bit(F_AUDIO_READ_INUSE, &chip->flags);
snd_msnd_enable_irq(chip);
runtime->dma_area = (__force void *)chip->mappedbase ... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd.c |
int snd_msnd_pcm(struct snd_card *card, int device) {
struct snd_msnd *chip = card->private_data;
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(card, "MSNDPINNACLE", device, 1, 1, &pcm);
if (err < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_msnd_playback_ops);
snd_pcm_set... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd_midi.c |
static int snd_msndmidi_input_close(struct snd_rawmidi_substream *substream) {
struct snd_msndmidi *mpu;
mpu = substream->rmidi->private_data;
snd_msnd_send_dsp_cmd(mpu->dev, HDEX_MIDI_IN_STOP);
clear_bit(MSNDMIDI_MODE_BIT_INPUT, &mpu->mode);
mpu->substream_input = NULL;
snd_msnd_disable_irq(mpu->dev);
... | [
0,
0
] |
Linux Kernel | sound/isa/msnd/msnd_midi.c |
static void snd_msndmidi_input_drop(struct snd_msndmidi *mpu) {
u16 tail;
tail = readw(mpu->dev->MIDQ + JQS_wTail);
writew(tail, mpu->dev->MIDQ + JQS_wHead);
} | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd_pinnacle.c |
static int upload_dsp_code(struct snd_card *card) {
struct snd_msnd *chip = card->private_data;
const struct firmware *init_fw = NULL, *perm_fw = NULL;
int err;
outb(HPBLKSEL_0, chip->io + HP_BLKS);
err = request_firmware(&init_fw, INITCODEFILE, card->dev);
if (err < 0) {
printk(KERN_ERR LOGNAME ": ... | [
1,
0
] |
Linux Kernel | sound/isa/msnd/msnd_pinnacle.c |
static int snd_msnd_initialize(struct snd_card *card) {
struct snd_msnd *chip = card->private_data;
int err, timeout;
#ifdef MSND_CLASSIC
outb(HPWAITSTATE_0, chip->io + HP_WAIT);
outb(HPBITMODE_16, chip->io + HP_BITM);
reset_proteus(chip);
#endif
err = snd_msnd_init_sma(chip);
if (err < 0) {
printk... | [
0,
0
] |
Linux Kernel | sound/isa/msnd/msnd_pinnacle.c | static int snd_msnd_dsp_full_reset(struct snd_card *card) {
struct snd_msnd *chip = card->private_data;
int rv;
if (test_bit(F_RESETTING, &chip->flags) || ++chip->nresets > 10)
return 0;
set_bit(F_RESETTING, &chip->flags);
snd_msnd_dsp_halt(chip, NULL);
rv = snd_msnd_initialize(card);
if (rv)
p... | [
0,
0
] |
Linux Kernel | sound/isa/msnd/msnd_pinnacle.c |
static int snd_msnd_write_cfg_logical(int cfg, int num, u16 io0, u16 io1,
u16 irq, int mem) {
if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
return -EIO;
if (snd_msnd_write_cfg_io0(cfg, num, io0))
return -EIO;
if (snd_msnd_write_cfg_io1(cfg, num, io1))
return ... | [
0,
0
] |
Linux Kernel | sound/isa/msnd/msnd_pinnacle.c |
static int __init snd_msnd_init(void) {
int err;
err = isa_register_driver(&snd_msnd_driver, SNDRV_CARDS);
#ifdef CONFIG_PNP
if (!err)
isa_registered = 1;
err = pnp_register_card_driver(&msnd_pnpc_driver);
if (!err)
pnp_registered = 1;
if (isa_registered)
err = 0;
#endif
return err;
} | [
0,
0
] |
Linux Kernel | sound/isa/msnd/msnd_pinnacle_mixer.c |
static int snd_msndmix_set_mux(struct snd_msnd *chip, int val) {
unsigned newrecsrc;
int change;
unsigned char msndbyte;
switch (val) {
case 0:
newrecsrc = MSND_MASK_IMIX;
msndbyte = HDEXAR_SET_ANA_IN;
break;
case 1:
newrecsrc = MSND_MASK_SYNTH;
msndbyte = HDEXAR_SET_SYNTH_IN;
brea... | [
0,
0
] |
Linux Kernel | sound/isa/opl3sa2.c | static unsigned char __snd_opl3sa2_read(struct snd_opl3sa2 *chip,
unsigned char reg) {
unsigned char result;
#if 0
outb(0x1d, port);
printk(KERN_DEBUG "read [0x%lx] = 0x%x\n", port, inb(port));
#endif
outb(reg, chip->port); /* register */
result = inb(chip->port + 1);
#i... | [
0,
0
] |
Linux Kernel | sound/isa/opl3sa2.c |
static int snd_opl3sa2_get_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_opl3sa2 *chip = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff;
i... | [
1,
0
] |
Linux Kernel | sound/isa/opl3sa2.c | static int snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip,
struct pnp_dev *pdev) {
if (pnp_activate_dev(pdev) < 0) {
snd_printk(KERN_ERR "PnP configure failure (out of resources?)\n");
return -EBUSY;
}
sb_port[dev] = pnp_port_start(pdev, 0);
wss_port[dev] = pnp_port_start(p... | [
1,
0
] |
Linux Kernel | sound/isa/opl3sa2.c |
static int snd_opl3sa2_card_new(struct device *pdev, int dev,
struct snd_card **cardp) {
struct snd_card *card;
struct snd_opl3sa2 *chip;
int err;
err = snd_devm_card_new(pdev, index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_opl3sa2), &card);
if ... | [
1,
0
] |
Linux Kernel | sound/isa/opl3sa2.c | static int snd_opl3sa2_pnp_suspend(struct pnp_dev *pdev, pm_message_t state) {
return snd_opl3sa2_suspend(pnp_get_drvdata(pdev), state);
} | [
0,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c | static int aci_busy_wait(struct snd_miro_aci *aci) {
long timeout;
unsigned char byte;
for (timeout = 1; timeout <= ACI_MINTIME + 30; timeout++) {
byte = inb(aci->aci_port + ACI_REG_BUSY);
if ((byte & 1) == 0) {
if (timeout >= ACI_MINTIME)
snd_printd("aci ready in round %ld.\n", timeout - A... | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
static inline int aci_read(struct snd_miro_aci *aci) {
unsigned char byte;
if (aci_busy_wait(aci) >= 0) {
byte = inb(aci->aci_port + ACI_REG_STATUS);
return byte;
} else {
snd_printk(KERN_ERR "aci busy, aci_read() stopped.\n");
return -EBUSY;
}
} | [
0,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
struct snd_miro_aci *snd_aci_get_aci(void) {
if (aci_device.aci_port == 0)
return NULL;
return &aci_device;
} | [
0,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
static int snd_miro_put_capture(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
int change, value, error;
value = !(ucontrol->value.integer.value[0]);
error = aci_setvalue(miro->aci, ACI_SET_SOLOMODE, v... | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
static int snd_miro_get_amp(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = miro->aci->aci_amp;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c | static int snd_miro_get_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uinfo) {
struct snd_miro *miro = snd_kcontrol_chip(kcontrol);
int left_val, right_val;
int right_reg = kcontrol->private_value & 0xff;
int left_reg = right_reg + 1;
right_val = aci_getvalu... | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c | static int snd_set_aci_init_values(struct snd_miro *miro) {
int idx, error;
struct snd_miro_aci *aci = miro->aci;
if ((aci->aci_product == 'A') && wss) {
error = aci_setvalue(aci, ACI_SET_WSS, wss);
if (error < 0) {
snd_printk(KERN_ERR "enabling WSS mode failed\n");
return error;
}
}
... | [
0,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
static void snd_miro_write(struct snd_miro *chip, unsigned char reg,
unsigned char value) {
unsigned long flags;
spin_lock_irqsave(&chip->lock, flags);
outb(chip->password, chip->mc_base + chip->pwd_reg);
switch (chip->hardware) {
case OPTi9XX_HW_82C924:
if (reg > 7) {
... | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
static inline void snd_miro_write_mask(struct snd_miro *chip, unsigned char reg,
unsigned char value,
unsigned char mask) {
unsigned char oldval = snd_miro_read(chip, reg);
snd_miro_write(chip, reg, (oldval & ~mask) | (value & mask));
} | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
static int snd_miro_opti_check(struct snd_card *card, struct snd_miro *chip) {
unsigned char value;
chip->res_mc_base = devm_request_region(card->dev, chip->mc_base,
chip->mc_base_size, "OPTi9xx MC");
if (chip->res_mc_base == NULL)
return -ENOMEM;
value = snd_mir... | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c |
static int snd_miro_isa_match(struct device *devptr, unsigned int n) {
#ifdef CONFIG_PNP
if (snd_miro_pnp_is_probed)
return 0;
if (isapnp)
return 0;
#endif
return 1;
} | [
0,
0
] |
Linux Kernel | sound/isa/opti9xx/miro.c | static int snd_miro_pnp_probe(struct pnp_card_link *pcard,
const struct pnp_card_device_id *pid) {
struct snd_card *card;
int err;
struct snd_miro *miro;
if (snd_miro_pnp_is_probed)
return -EBUSY;
if (!isapnp)
return -ENODEV;
err = snd_devm_card_new(&pcard->card->dev, ... | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/opti92x-ad1848.c | static unsigned char snd_opti9xx_read(struct snd_opti9xx *chip,
unsigned char reg) {
unsigned long flags;
unsigned char retval = 0xff;
spin_lock_irqsave(&chip->lock, flags);
outb(chip->password, chip->mc_base + chip->pwd_reg);
switch (chip->hardware) {
#ifndef OPTi93X
... | [
1,
0
] |
Linux Kernel | sound/isa/opti9xx/opti92x-ad1848.c |
static irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id) {
struct snd_opti9xx *chip = dev_id;
struct snd_wss *codec = chip->codec;
unsigned char status;
if (!codec)
return IRQ_HANDLED;
status = snd_opti9xx_read(chip, OPTi9XX_MC_REG(11));
if ((status & OPTi93X_IRQ_PLAYBACK) && codec->playback_s... | [
0,
0
] |
Linux Kernel | sound/isa/sb/emu8000.c | void snd_emu8000_poke(struct snd_emu8000 *emu, unsigned int port,
unsigned int reg, unsigned int val) {
unsigned long flags;
spin_lock_irqsave(&emu->reg_lock, flags);
if (reg != emu->last_reg) {
outw((unsigned short)reg, EMU8000_PTR(emu));
emu->last_reg = reg;
}
outw((unsigned sh... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.