Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/drivers/opl3/opl3_seq.c |
static int snd_opl3_synth_unuse(void *private_data,
struct snd_seq_port_subscribe *info) {
struct snd_opl3 *opl3 = private_data;
snd_opl3_synth_cleanup(opl3);
if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM)
snd_opl3_synth_use_dec(opl3);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_seq.c | static void snd_opl3_synth_free_port(void *private_data) {
struct snd_opl3 *opl3 = private_data;
snd_midi_channel_free_set(opl3->chset);
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_seq.c | static int snd_opl3_seq_probe(struct device *_dev) {
struct snd_seq_device *dev = to_seq_dev(_dev);
struct snd_opl3 *opl3;
int client, err;
char name[32];
int opl_ver;
opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (opl3 == NULL)
return -EINVAL;
spin_lock_init(&opl3->voice_lock);
... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_synth.c | static int snd_opl3_play_note(struct snd_opl3 *opl3,
struct snd_dm_fm_note *note) {
unsigned short reg_side;
unsigned char voice_offset;
unsigned short opl3_reg;
unsigned char reg_val;
/* Voices 0 - 17 in OPL3 mode */
if (note->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_synth.c | static int snd_opl3_set_connection(struct snd_opl3 *opl3, int connection) {
unsigned char reg_val;
if (opl3->fm_mode != SNDRV_DM_FM_MODE_OPL3)
return -EINVAL;
reg_val =
connection & (OPL3_RIGHT_4OP_0 | OPL3_RIGHT_4OP_1 | OPL3_RIGHT_4OP_2 |
OPL3_LEFT_4OP_0 | OPL3_LEFT_4OP_1 | OPL3_L... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_lib.c |
void snd_opl4_write(struct snd_opl4 *opl4, u8 reg, u8 value) {
snd_opl4_wait(opl4);
outb(reg, opl4->pcm_port);
snd_opl4_wait(opl4);
outb(value, opl4->pcm_port + 1);
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_lib.c |
void snd_opl4_write_memory(struct snd_opl4 *opl4, const char *buf, int offset,
int size) {
unsigned long flags;
u8 memcfg;
spin_lock_irqsave(&opl4->reg_lock, flags);
memcfg = snd_opl4_read(opl4, OPL4_REG_MEMORY_CONFIGURATION);
snd_opl4_write(opl4, OPL4_REG_MEMORY_CONFIGURATION, m... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_mixer.c |
static int snd_opl4_ctl_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_opl4 *opl4 = snd_kcontrol_chip(kcontrol);
unsigned long flags;
u8 reg = kcontrol->private_value;
u8 value;
spin_lock_irqsave(&opl4->reg_lock, flags);
value = snd_opl4_re... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_mixer.c |
static int snd_opl4_ctl_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_opl4 *opl4 = snd_kcontrol_chip(kcontrol);
unsigned long flags;
u8 reg = kcontrol->private_value;
u8 value, old_value;
value = (7 - (ucontrol->value.integer.value[0] & 7)) ... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_proc.c |
static int snd_opl4_mem_proc_open(struct snd_info_entry *entry,
unsigned short mode,
void **file_private_data) {
struct snd_opl4 *opl4 = entry->private_data;
mutex_lock(&opl4->access_mutex);
if (opl4->memory_access) {
mutex_unlock(&opl4->ac... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_proc.c |
static ssize_t snd_opl4_mem_proc_read(struct snd_info_entry *entry,
void *file_private_data,
struct file *file, char __user *_buf,
size_t count, loff_t pos) {
struct snd_opl4 *opl4 = entry->private_data;... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_seq.c |
static int snd_opl4_seq_use(void *private_data,
struct snd_seq_port_subscribe *info) {
struct snd_opl4 *opl4 = private_data;
int err;
mutex_lock(&opl4->access_mutex);
if (opl4->used) {
mutex_unlock(&opl4->access_mutex);
return -EBUSY;
}
opl4->used++;
if (info->sende... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_seq.c |
static int snd_opl4_seq_unuse(void *private_data,
struct snd_seq_port_subscribe *info) {
struct snd_opl4 *opl4 = private_data;
snd_opl4_synth_shutdown(opl4);
mutex_lock(&opl4->access_mutex);
opl4->used--;
mutex_unlock(&opl4->access_mutex);
if (info->sender.client != SNDRV_S... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_seq.c | static int snd_opl4_seq_probe(struct device *_dev) {
struct snd_seq_device *dev = to_seq_dev(_dev);
struct snd_opl4 *opl4;
int client;
struct snd_seq_port_callback pcallbacks;
opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (!opl4)
return -EINVAL;
if (snd_yrw801_detect(opl4) < 0)
re... | [
1,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c | void snd_opl4_synth_shutdown(struct snd_opl4 *opl4) {
unsigned long flags;
int i;
spin_lock_irqsave(&opl4->reg_lock, flags);
for (i = 0; i < OPL4_MAX_VOICES; i++)
snd_opl4_write(opl4, OPL4_REG_MISC + i,
opl4->voices[i].reg_misc & ~OPL4_KEY_ON_BIT);
spin_unlock_irqrestore(&opl4->reg_loc... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c | static void snd_opl4_do_for_channel(struct snd_opl4 *opl4,
struct snd_midi_channel *chan,
void (*func)(struct snd_opl4 *opl4,
struct opl4_voice *voice)) {
int i;
unsigned long flags;
struct opl... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c |
static void snd_opl4_update_vibrato_depth(struct snd_opl4 *opl4,
struct opl4_voice *voice) {
int depth;
if (voice->chan->drum_channel)
return;
depth = (7 - voice->sound->vibrato) *
(voice->chan->control[MIDI_CTL_VIBRATO_DEPTH] & 0x7f);
depth = (depth >> ... | [
1,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c | static struct opl4_voice *snd_opl4_get_voice(struct snd_opl4 *opl4) {
if (!list_empty(&opl4->off_voices))
return list_entry(opl4->off_voices.next, struct opl4_voice, list);
/* then get the oldest key-on voice */
snd_BUG_ON(list_empty(&opl4->on_voices));
return list_entry(opl4->on_voices.next, struct opl4_v... | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c |
static void snd_opl4_wait_for_wave_headers(struct snd_opl4 *opl4) {
int timeout = 200;
while ((inb(opl4->fm_port) & OPL4_STATUS_LOAD) && --timeout > 0)
udelay(10);
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c |
static void snd_opl4_voice_off(struct snd_opl4 *opl4,
struct opl4_voice *voice) {
list_move_tail(&voice->list, &opl4->off_voices);
voice->reg_misc &= ~OPL4_KEY_ON_BIT;
snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
} | [
1,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c |
void snd_opl4_note_off(void *private_data, int note, int vel,
struct snd_midi_channel *chan) {
struct snd_opl4 *opl4 = private_data;
snd_opl4_do_for_note(opl4, note, chan, snd_opl4_voice_off);
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl4/opl4_synth.c |
static void snd_opl4_terminate_voice(struct snd_opl4 *opl4,
struct opl4_voice *voice) {
list_move_tail(&voice->list, &opl4->off_voices);
voice->reg_misc = (voice->reg_misc & ~OPL4_KEY_ON_BIT) | OPL4_DAMP_BIT;
snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_mis... | [
1,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp.c |
static void alsa_card_pcsp_free(struct snd_card *card) {
pcsp_stop_beep(card->private_data);
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp.c |
static int snd_card_pcsp_probe(int devnum, struct device *dev) {
struct snd_card *card;
int err;
if (devnum != 0)
return -EINVAL;
hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
pcsp_chip.timer.function = pcsp_do_timer;
err = snd_devm_card_new(dev, index, id, THIS_MODULE, 0, &card... | [
1,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp.c |
static int pcsp_probe(struct platform_device *dev) {
int err;
err = pcspkr_input_init(&pcsp_chip.input_dev, &dev->dev);
if (err < 0)
return err;
err = alsa_card_pcsp_init(&dev->dev);
if (err < 0)
return err;
platform_set_drvdata(dev, &pcsp_chip);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp.c |
static void pcsp_shutdown(struct platform_device *dev) {
struct snd_pcsp *chip = platform_get_drvdata(dev);
pcsp_stop_beep(chip);
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp.c |
static void __exit pcsp_exit(void) {
platform_driver_unregister(&pcsp_platform_driver);
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_input.c |
int pcspkr_input_init(struct input_dev **rdev, struct device *dev) {
int err;
struct input_dev *input_dev = devm_input_allocate_device(dev);
if (!input_dev)
return -ENOMEM;
input_dev->name = "PC Speaker";
input_dev->phys = "isa0061/input0";
input_dev->id.bustype = BUS_ISA;
input_dev->id.vendor = 0x... | [
1,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_lib.c | static void pcsp_call_pcm_elapsed(struct work_struct *work) {
if (atomic_read(&pcsp_chip.timer_active)) {
struct snd_pcm_substream *substream;
substream = pcsp_chip.playback_substream;
if (substream)
snd_pcm_period_elapsed(substream);
}
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_lib.c | static u64 pcsp_timer_update(struct snd_pcsp *chip) {
unsigned char timer_cnt, val;
u64 ns;
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
unsigned long flags;
if (chip->thalf) {
outb(chip->val61, 0x61);
chip->thalf = 0;
return chip->ns_rem;
}
substream = chip->playb... | [
1,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_lib.c | static void pcsp_pointer_update(struct snd_pcsp *chip) {
struct snd_pcm_substream *substream;
size_t period_bytes, buffer_bytes;
int periods_elapsed;
unsigned long flags;
substream = chip->playback_substream;
if (!substream)
return;
period_bytes = snd_pcm_lib_period_bytes(substream);
buffer_bytes ... | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_lib.c |
static int snd_pcsp_playback_hw_free(struct snd_pcm_substream *substream) {
struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
#if PCSP_DEBUG
printk(KERN_INFO "PCSP: hw_free called\n");
#endif
pcsp_sync_stop(chip);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_lib.c |
static snd_pcm_uframes_t
snd_pcsp_playback_pointer(struct snd_pcm_substream *substream) {
struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
unsigned int pos;
spin_lock(&chip->substream_lock);
pos = chip->playback_ptr;
spin_unlock(&chip->substream_lock);
return bytes_to_frames(substream->runtime, p... | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_lib.c |
static int snd_pcsp_playback_open(struct snd_pcm_substream *substream) {
struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
#if PCSP_DEBUG
printk(KERN_INFO "PCSP: open called\n");
#endif
if (atomic_read(&chip->timer_active)) {
printk(KERN_ERR "P... | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_lib.c |
int snd_pcsp_new_pcm(struct snd_pcsp *chip) {
int err;
err = snd_pcm_new(chip->card, "pcspeaker", 0, 1, 0, &chip->pcm);
if (err < 0)
return err;
snd_pcm_set_ops(chip->pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_pcsp_playback_ops);
chip->pcm->private_data = chip;
chip->pcm->info_flags = SNDRV_PCM_INFO_HALF_... | [
1,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_mixer.c |
static int pcsp_enable_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_mixer.c |
static int pcsp_enable_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcsp *chip = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = chip->enable;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_mixer.c |
static int pcsp_treble_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcsp *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int treble = ucontrol->value.enumerated.item[0];
if (treble != chip->treble) {
chip->treble = treble;
#if PCSP_DE... | [
0,
0
] |
Linux Kernel | sound/drivers/pcsp/pcsp_mixer.c |
static int snd_pcsp_ctls_add(struct snd_pcsp *chip,
const struct snd_kcontrol_new *ctls, int num) {
int i, err;
struct snd_card *card = chip->card;
for (i = 0; i < num; i++) {
err = snd_ctl_add(card, snd_ctl_new1(ctls + i, chip));
if (err < 0)
return err;
}
return 0... | [
0,
0
] |
Linux Kernel | sound/drivers/portman2x4.c | static inline void portman_write_command(struct portman *pm, u8 value) {
parport_write_control(pm->pardev->port, value);
} | [
0,
0
] |
Linux Kernel | sound/drivers/portman2x4.c | static void snd_portman_interrupt(void *userdata) {
unsigned char midivalue = 0;
struct portman *pm = ((struct snd_card *)userdata)->private_data;
spin_lock(&pm->reg_lock);
while ((portman_read_status(pm) & INT_REQ) == INT_REQ) {
/* If data available on channel 0,
read it and stuff it into the queu... | [
1,
0
] |
Linux Kernel | sound/drivers/portman2x4.c | static void snd_portman_detach(struct parport *p) {} | [
0,
0
] |
Linux Kernel | sound/drivers/portman2x4.c | static void snd_portman_unregister_all(void) {
int i;
for (i = 0; i < SNDRV_CARDS; ++i) {
if (platform_devices[i]) {
platform_device_unregister(platform_devices[i]);
platform_devices[i] = NULL;
}
}
platform_driver_unregister(&snd_portman_driver);
parport_unregister_driver(&portman_parport... | [
0,
0
] |
Linux Kernel | sound/drivers/serial-generic.c |
static int snd_serial_generic_receive_buf(struct serdev_device *serdev,
const unsigned char *buf,
size_t count) {
int ret;
struct snd_serial_generic *drvdata = serdev_device_get_drvdata(serdev);
if (!test_bit(SERIAL_MODE_INPUT_O... | [
0,
0
] |
Linux Kernel | sound/drivers/serial-generic.c |
static int
snd_serial_generic_input_open(struct snd_rawmidi_substream *substream) {
int err;
struct snd_serial_generic *drvdata = substream->rmidi->card->private_data;
dev_dbg(drvdata->card->dev, "Opening input for card %s\n",
drvdata->card->shortname);
err = snd_serial_generic_ensure_serdev_open(d... | [
1,
0
] |
Linux Kernel | sound/drivers/serial-generic.c |
static void
snd_serial_generic_input_trigger(struct snd_rawmidi_substream *substream,
int up) {
struct snd_serial_generic *drvdata = substream->rmidi->card->private_data;
if (up)
set_bit(SERIAL_MODE_INPUT_TRIGGERED, &drvdata->filemode);
else
clear_bit(SERIAL_MODE_INPUT_T... | [
1,
0
] |
Linux Kernel | sound/drivers/serial-generic.c |
static int
snd_serial_generic_output_open(struct snd_rawmidi_substream *substream) {
struct snd_serial_generic *drvdata = substream->rmidi->card->private_data;
int err;
dev_dbg(drvdata->card->dev, "Opening output for card %s\n",
drvdata->card->shortname);
err = snd_serial_generic_ensure_serdev_open... | [
1,
0
] |
Linux Kernel | sound/drivers/serial-generic.c |
static void
snd_serial_generic_output_trigger(struct snd_rawmidi_substream *substream,
int up) {
struct snd_serial_generic *drvdata = substream->rmidi->card->private_data;
if (up)
set_bit(SERIAL_MODE_OUTPUT_TRIGGERED, &drvdata->filemode);
else
clear_bit(SERIAL_MODE_OUTP... | [
1,
0
] |
Linux Kernel | sound/drivers/serial-generic.c | static void
snd_serial_generic_output_drain(struct snd_rawmidi_substream *substream) {
struct snd_serial_generic *drvdata = substream->rmidi->card->private_data;
serdev_device_write_flush(drvdata->serdev);
cancel_work_sync(&drvdata->tx_work);
} | [
1,
0
] |
Linux Kernel | sound/drivers/serial-generic.c |
static int snd_serial_generic_probe(struct serdev_device *serdev) {
struct snd_card *card;
struct snd_serial_generic *drvdata;
int err;
err =
snd_devm_card_new(&serdev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
THIS_MODULE, sizeof(struct snd_serial_generic), &card);
if (err... | [
1,
0
] |
Linux Kernel | sound/drivers/serial-u16550.c |
static inline void snd_uart16550_del_timer(struct snd_uart16550 *uart) {
if (uart->timer_running) {
del_timer(&uart->buffer_timer);
uart->timer_running = 0;
}
} | [
0,
0
] |
Linux Kernel | sound/drivers/serial-u16550.c | static void snd_uart16550_buffer_timer(struct timer_list *t) {
unsigned long flags;
struct snd_uart16550 *uart;
uart = from_timer(uart, t, buffer_timer);
spin_lock_irqsave(&uart->open_lock, flags);
snd_uart16550_del_timer(uart);
snd_uart16550_io_loop(uart);
spin_unlock_irqrestore(&uart->open_lock, flags)... | [
0,
0
] |
Linux Kernel | sound/drivers/serial-u16550.c |
static int snd_uart16550_output_open(struct snd_rawmidi_substream *substream) {
unsigned long flags;
struct snd_uart16550 *uart = substream->rmidi->private_data;
spin_lock_irqsave(&uart->open_lock, flags);
if (uart->filemode == SERIAL_MODE_NOT_OPENED)
snd_uart16550_do_open(uart);
uart->filemode |= SERIA... | [
1,
0
] |
Linux Kernel | sound/drivers/serial-u16550.c | static inline int snd_uart16550_write_buffer(struct snd_uart16550 *uart,
unsigned char byte) {
unsigned short buff_in = uart->buff_in;
if (uart->buff_in_count < TX_BUFF_SIZE) {
uart->tx_buff[buff_in] = byte;
buff_in++;
buff_in &= TX_BUFF_MASK;
uart->buff_... | [
1,
0
] |
Linux Kernel | sound/drivers/serial-u16550.c | static int snd_uart16550_output_byte(struct snd_uart16550 *uart,
struct snd_rawmidi_substream *substream,
unsigned char midi_byte) {
if (uart->buff_in_count == 0 &&
((uart->adaptor != SNDRV_SERIAL_MS124W_SA &&
uart->adaptor != SND... | [
1,
0
] |
Linux Kernel | sound/drivers/virmidi.c |
static int snd_virmidi_probe(struct platform_device *devptr) {
struct snd_card *card;
struct snd_card_virmidi *vmidi;
int idx, err;
int dev = devptr->id;
err = snd_devm_card_new(&devptr->dev, index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_card_virmidi), &card);
if (err < 0)... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_core.c | static int vx_send_irq_dsp(struct vx_core *chip, int num) {
int nirq;
if (snd_vx_check_reg_bit(chip, VX_CVR, CVR_HC, 0, 200) < 0)
return -EIO;
nirq = num;
if (vx_has_new_dsp(chip))
nirq += VXP_IRQ_OFFSET;
vx_outb(chip, CVR, (nirq >> 1) | CVR_HC);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_core.c | int vx_send_rih_nolock(struct vx_core *chip, int cmd) {
int err;
if (chip->chip_status & VX_STAT_IS_STALE)
return -EBUSY;
#if 0
printk(KERN_DEBUG "send_rih: cmd = 0x%x\n", cmd);
#endif
err = vx_reset_chk(chip);
if (err < 0)
return err;
err = vx_send_irq_dsp(chip, cmd);
if (err < 0)
return er... | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_core.c | int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp) {
unsigned int i;
int err;
unsigned int csum = 0;
const unsigned char *image, *cptr;
if (dsp->size % 3)
return -EINVAL;
vx_toggle_dac_mute(chip, 1);
for (i = 0; i < dsp->size; i += 3) {
image = dsp->data + i;
/* Wait DSP ... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_core.c |
static void snd_vx_release(struct device *dev, void *data) {
snd_vx_free_firmware(data);
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c | static void vx_write_codec_reg(struct vx_core *chip, int codec,
unsigned int data) {
if (snd_BUG_ON(!chip->ops->write_codec))
return;
if (chip->chip_status & VX_STAT_IS_STALE)
return;
mutex_lock(&chip->lock);
chip->ops->write_codec(chip, codec, data);
mutex_unlock(&chi... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c | static void vx_change_audio_source(struct vx_core *chip, int src) {
if (chip->chip_status & VX_STAT_IS_STALE)
return;
mutex_lock(&chip->lock);
chip->ops->change_audio_source(chip, src);
mutex_unlock(&chip->lock);
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c | static int vx_audio_src_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts_mic[3] = {"Digital", "Line", "Mic"};
static const char *const texts_vx2[2] = {"Digital", "Analog"};
struct vx_core *chip = snd_kcontrol_chip(kcontrol);
if (... | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c | static int vx_audio_gain_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 = CVAL_MAX;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c |
static int vx_audio_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct vx_core *chip = snd_kcontrol_chip(kcontrol);
int audio = kcontrol->private_value & 0xff;
int capture = (kcontrol->private_value >> 8) & 1;
mutex_lock(&chip->mixer_mutex);
uc... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c | static int vx_iec958_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c |
static int vx_iec958_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct vx_core *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mixer_mutex);
ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff;
ucontrol->value.iec958.status[1] = (chip-... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c |
static int vx_vu_meter_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct vx_core *chip = snd_kcontrol_chip(kcontrol);
struct vx_vu_meter meter[2];
int audio = kcontrol->private_value & 0xff;
int capture = (kcontrol->private_value >> 8) & 1;
vx_get_au... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c |
static int vx_peak_meter_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct vx_core *chip = snd_kcontrol_chip(kcontrol);
struct vx_vu_meter meter[2];
int audio = kcontrol->private_value & 0xff;
int capture = (kcontrol->private_value >> 8) & 1;
vx_ge... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_mixer.c | static int vx_saturation_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct vx_core *chip = snd_kcontrol_chip(kcontrol);
struct vx_vu_meter meter[2];
int audio = kcontrol->private_value & 0xff;
vx_get_audio_vu_meter(chip, audio, 1, meter);
ucontrol->... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | static void vx_pcm_read_per_bytes(struct vx_core *chip,
struct snd_pcm_runtime *runtime,
struct vx_pipe *pipe) {
int offset = pipe->hw_ptr;
unsigned char *buf = (unsigned char *)(runtime->dma_area + offset);
*buf++ = vx_inb(chip, RXH);
if (++of... | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | static int vx_set_format(struct vx_core *chip, struct vx_pipe *pipe,
struct snd_pcm_runtime *runtime) {
unsigned int header = HEADER_FMT_BASE;
if (runtime->channels == 1)
header |= HEADER_FMT_MONO;
if (snd_pcm_format_little_endian(runtime->format))
header |= HEADER_FMT_INTEL;
i... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | static int vx_conf_pipe(struct vx_core *chip, struct vx_pipe *pipe) {
struct vx_rmh rmh;
vx_init_rmh(&rmh, CMD_CONF_PIPE);
if (pipe->is_capture)
rmh.Cmd[0] |= COMMAND_RECORD_MASK;
rmh.Cmd[1] = 1 << pipe->number;
return vx_send_msg(chip, &rmh);
} | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | static int vx_toggle_pipe(struct vx_core *chip, struct vx_pipe *pipe,
int state) {
int err, i, cur_state;
if (vx_get_pipe_state(chip, pipe, &cur_state) < 0)
return -EBADFD;
if (state == cur_state)
return 0;
/* If a start is requested, ask the DSP to get prepared
* and wait... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | static int vx_stop_pipe(struct vx_core *chip, struct vx_pipe *pipe) {
struct vx_rmh rmh;
vx_init_rmh(&rmh, CMD_STOP_PIPE);
vx_set_pipe_cmd_params(&rmh, pipe->is_capture, pipe->number, 0);
return vx_send_msg(chip, &rmh);
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | static int vx_stop_stream(struct vx_core *chip, struct vx_pipe *pipe) {
struct vx_rmh rmh;
vx_init_rmh(&rmh, CMD_STOP_STREAM);
vx_set_stream_cmd_params(&rmh, pipe->is_capture, pipe->number);
return vx_send_msg(chip, &rmh);
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | void vx_pcm_update_intr(struct vx_core *chip, unsigned int events) {
unsigned int i;
struct vx_pipe *pipe;
#define EVENT_MASK (END_OF_BUFFER_EVENTS_PENDING | ASYNC_EVENTS_PENDING)
if (events & EVENT_MASK) {
vx_init_rmh(&chip->irq_rmh, CMD_ASYNC);
if (events & ASYNC_EVENTS_PENDING)
chip->irq_rmh.Cm... | [
1,
0
] |
Linux Kernel | sound/drivers/vx/vx_pcm.c | static void snd_vx_pcm_free(struct snd_pcm *pcm) {
struct vx_core *chip = pcm->private_data;
chip->pcm[pcm->device] = NULL;
kfree(chip->playback_pipes);
chip->playback_pipes = NULL;
kfree(chip->capture_pipes);
chip->capture_pipes = NULL;
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_uer.c | static void vx_change_clock_source(struct vx_core *chip, int source) {
vx_toggle_dac_mute(chip, 1);
mutex_lock(&chip->lock);
chip->ops->set_clock_source(chip, source);
chip->clock_source = source;
mutex_unlock(&chip->lock);
/* unmute */
vx_toggle_dac_mute(chip, 0);
} | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_uer.c | int vx_set_clock(struct vx_core *chip, unsigned int freq) {
int src_changed = 0;
if (chip->chip_status & VX_STAT_IS_STALE)
return 0;
vx_sync_audio_source(chip);
if (chip->clock_mode == VX_CLOCK_MODE_EXTERNAL ||
(chip->clock_mode == VX_CLOCK_MODE_AUTO &&
chip->audio_source == VX_AUDIO_SRC_DIG... | [
0,
0
] |
Linux Kernel | sound/drivers/vx/vx_uer.c | int vx_change_frequency(struct vx_core *chip) {
int freq;
if (chip->chip_status & VX_STAT_IS_STALE)
return 0;
if (chip->clock_source == INTERNAL_QUARTZ)
return 0;
freq = vx_read_uer_status(chip, &chip->uer_detected);
if (freq < 0)
return freq;
/*
* The frequency computed by the DSP is good... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-am824.c | int amdtp_am824_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int pcm_channels,
unsigned int midi_ports,
bool double_pcm_frames) {
struct amdtp_am824 *p = s->protocol;
unsigned int midi_channels;
unsi... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-am824.c | void amdtp_am824_midi_trigger(struct amdtp_stream *s, unsigned int port,
struct snd_rawmidi_substream *midi) {
struct amdtp_am824 *p = s->protocol;
if (port < p->midi_ports)
WRITE_ONCE(p->midi[port], midi);
} | [
0,
0
] |
Linux Kernel | sound/firewire/amdtp-am824.c |
static void midi_rate_use_one_byte(struct amdtp_stream *s, unsigned int port) {
struct amdtp_am824 *p = s->protocol;
p->midi_fifo_used[port] += amdtp_rate_table[s->sfc];
} | [
0,
0
] |
Linux Kernel | sound/firewire/amdtp-am824.c |
static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
unsigned int frames,
unsigned int data_block_counter) {
struct amdtp_am824 *p = s->protocol;
unsigned int f, port;
u8 *b;
for (f = 0; f < frames; f++) {
b = (u8 *)&buffer... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c |
static int apply_constraint_to_size(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct snd_interval *s = hw_param_interval(params, rule->var);
const struct snd_interval *r =
hw_param_interval_c(params, SNDRV_PCM_HW_PARAM_RATE);
struct snd_interval t... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | static int amdtp_stream_get_max_ctx_payload_size(struct amdtp_stream *s) {
unsigned int multiplier;
if (s->flags & CIP_JUMBO_PAYLOAD)
multiplier = IR_JUMBO_PAYLOAD_MAX_SKIP_CYCLES;
else
multiplier = 1;
return s->syt_interval * s->data_block_quadlets * sizeof(__be32) * multiplier;
} | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | unsigned int amdtp_stream_get_max_payload(struct amdtp_stream *s) {
unsigned int cip_header_size;
if (!(s->flags & CIP_NO_HEADER))
cip_header_size = CIP_HEADER_SIZE;
else
cip_header_size = 0;
return cip_header_size + amdtp_stream_get_max_ctx_payload_size(s);
} | [
0,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | void amdtp_stream_pcm_prepare(struct amdtp_stream *s) {
s->pcm_buffer_pointer = 0;
s->pcm_period_pointer = 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | static void pool_ideal_nonblocking_data_blocks(struct amdtp_stream *s,
struct seq_desc *descs,
const unsigned int seq_size,
unsigned int seq_tail,
... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | static unsigned int compute_syt_offset(unsigned int syt, unsigned int cycle,
unsigned int transfer_delay) {
unsigned int cycle_lo = (cycle % CYCLES_PER_SECOND) & 0x0f;
unsigned int syt_cycle_lo = (syt & 0xf000) >> 12;
unsigned int syt_offset;
if (syt_cycle_lo < cycle_lo)
... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c |
static void cache_seq(struct amdtp_stream *s, const struct pkt_desc *descs,
unsigned int desc_count) {
const unsigned int transfer_delay = s->transfer_delay;
const unsigned int cache_size = s->ctx_data.tx.cache.size;
struct seq_desc *cache = s->ctx_data.tx.cache.descs;
unsigned int cache_... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c |
static void pool_seq_descs(struct amdtp_stream *s, unsigned int count) {
struct amdtp_domain *d = s->domain;
if (!d->replay.enable || !s->ctx_data.rx.replay_target) {
pool_ideal_seq_descs(s, count);
} else {
if (!d->replay.on_the_fly) {
pool_replayed_seq(s, count);
} else {
struct amdtp_... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | static int parse_ir_ctx_header(struct amdtp_stream *s, unsigned int cycle,
const __be32 *ctx_header,
unsigned int *data_blocks,
unsigned int *data_block_counter,
unsigned int *syt, unsigned int pa... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | static inline u32 compute_ohci_cycle_count(__be32 ctx_header_tstamp) {
u32 tstamp = be32_to_cpu(ctx_header_tstamp) & HEADER_TSTAMP_MASK;
return (((tstamp >> 13) & 0x07) * 8000) + (tstamp & 0x1fff);
} | [
0,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | static void process_tx_packets(struct fw_iso_context *context, u32 tstamp,
size_t header_length, void *header,
void *private_data) {
struct amdtp_stream *s = private_data;
__be32 *ctx_header = header;
unsigned int packets;
unsigned int desc_count;
... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c |
static void drop_tx_packets(struct fw_iso_context *context, u32 tstamp,
size_t header_length, void *header,
void *private_data) {
struct amdtp_stream *s = private_data;
const __be32 *ctx_header = header;
unsigned int packets;
unsigned int cycle;
int i;
... | [
1,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.c | void amdtp_domain_destroy(struct amdtp_domain *d) { return; } | [
0,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.h |
static inline bool cip_sfc_is_base_44100(enum cip_sfc sfc) { return sfc & 1; } | [
0,
0
] |
Linux Kernel | sound/firewire/amdtp-stream.h |
static inline int
amdtp_domain_set_events_per_period(struct amdtp_domain *d,
unsigned int events_per_period,
unsigned int events_per_buffer) {
d->events_per_period = events_per_period;
d->events_per_buffer = events_per_buffer;
return 0;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.