Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/core/timer.c | int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks) {
if (timeri == NULL || ticks < 1)
return -EINVAL;
if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE)
return snd_timer_start_slave(timeri, true);
else
return snd_timer_start1(timeri, true, ticks);
} | [
0,
0
] |
Linux Kernel | sound/core/timer.c | int snd_timer_pause(struct snd_timer_instance *timeri) {
if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE)
return snd_timer_stop_slave(timeri, false);
else
return snd_timer_stop1(timeri, false);
} | [
0,
0
] |
Linux Kernel | sound/core/timer.c | static void snd_timer_clear_callbacks(struct snd_timer *timer,
struct list_head *head) {
unsigned long flags;
spin_lock_irqsave(&timer->lock, flags);
while (!list_empty(head))
list_del_init(head->next);
spin_unlock_irqrestore(&timer->lock, flags);
} | [
0,
0
] |
Linux Kernel | sound/core/timer.c | static void snd_timer_work(struct work_struct *work) {
struct snd_timer *timer = container_of(work, struct snd_timer, task_work);
unsigned long flags;
if (timer->card && timer->card->shutdown) {
snd_timer_clear_callbacks(timer, &timer->sack_list_head);
return;
}
spin_lock_irqsave(&timer->lock, flags... | [
1,
0
] |
Linux Kernel | sound/core/timer.c | static int snd_timer_dev_register(struct snd_device *dev) {
struct snd_timer *timer = dev->device_data;
struct snd_timer *timer1;
if (snd_BUG_ON(!timer || !timer->hw.start || !timer->hw.stop))
return -ENXIO;
if (!(timer->hw.flags & SNDRV_TIMER_HW_SLAVE) && !timer->hw.resolution &&
timer->hw.c_resolut... | [
1,
0
] |
Linux Kernel | sound/core/timer.c |
static void snd_timer_s_function(struct timer_list *t) {
struct snd_timer_system_private *priv = from_timer(priv, t, tlist);
struct snd_timer *timer = priv->snd_timer;
unsigned long jiff = jiffies;
if (time_after(jiff, priv->last_expires))
priv->correction += (long)jiff - (long)priv->last_expires;
snd_ti... | [
1,
0
] |
Linux Kernel | sound/core/timer.c |
static int snd_timer_s_start(struct snd_timer *timer) {
struct snd_timer_system_private *priv;
unsigned long njiff;
priv = (struct snd_timer_system_private *)timer->private_data;
njiff = (priv->last_jiffies = jiffies);
if (priv->correction > timer->sticks - 1) {
priv->correction -= timer->sticks - 1;
... | [
0,
0
] |
Linux Kernel | sound/core/timer.c |
static int snd_timer_s_stop(struct snd_timer *timer) {
struct snd_timer_system_private *priv;
unsigned long jiff;
priv = (struct snd_timer_system_private *)timer->private_data;
del_timer(&priv->tlist);
jiff = jiffies;
if (time_before(jiff, priv->last_expires))
timer->sticks = priv->last_expires - jiff... | [
1,
0
] |
Linux Kernel | sound/core/timer.c |
static int snd_timer_s_close(struct snd_timer *timer) {
struct snd_timer_system_private *priv;
priv = (struct snd_timer_system_private *)timer->private_data;
del_timer_sync(&priv->tlist);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/core/timer.c |
static void __init snd_timer_proc_init(void) {
struct snd_info_entry *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL);
if (entry != NULL) {
entry->c.text.read = snd_timer_proc_read;
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
entry = NULL;
}
... | [
0,
0
] |
Linux Kernel | sound/core/timer.c |
static int snd_timer_user_open(struct inode *inode, struct file *file) {
struct snd_timer_user *tu;
int err;
err = stream_open(inode, file);
if (err < 0)
return err;
tu = kzalloc(sizeof(*tu), GFP_KERNEL);
if (tu == NULL)
return -ENOMEM;
spin_lock_init(&tu->qlock);
init_waitqueue_head(&tu->qch... | [
0,
0
] |
Linux Kernel | sound/core/timer.c |
static int timer_set_gparams(struct snd_timer_gparams *gparams) {
struct snd_timer *t;
int err;
mutex_lock(®ister_mutex);
t = snd_timer_find(&gparams->tid);
if (!t) {
err = -ENODEV;
goto _error;
}
if (!list_empty(&t->open_list_head)) {
err = -EBUSY;
goto _error;
}
if (!t->hw.set_p... | [
0,
0
] |
Linux Kernel | sound/core/timer.c |
static int snd_timer_user_gparams(struct file *file,
struct snd_timer_gparams __user *_gparams) {
struct snd_timer_gparams gparams;
if (copy_from_user(&gparams, _gparams, sizeof(gparams)))
return -EFAULT;
return timer_set_gparams(&gparams);
} | [
1,
0
] |
Linux Kernel | sound/core/timer.c |
static int snd_timer_user_tselect(struct file *file,
struct snd_timer_select __user *_tselect) {
struct snd_timer_user *tu;
struct snd_timer_select tselect;
char str[32];
int err = 0;
tu = file->private_data;
if (tu->timeri) {
snd_timer_close(tu->timeri);
snd_time... | [
1,
0
] |
Linux Kernel | sound/core/timer.c |
static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) {
struct snd_timer_user *tu = file->private_data;
long ret;
mutex_lock(&tu->ioctl_lock);
ret = __snd_timer_user_ioctl(file, cmd, arg, false);
mutex_unlock(&tu->ioctl_lock);
return ret;... | [
0,
0
] |
Linux Kernel | sound/core/timer_compat.c |
static int
snd_timer_user_gparams_compat(struct file *file,
struct snd_timer_gparams32 __user *user) {
struct snd_timer_gparams gparams;
if (copy_from_user(&gparams.tid, &user->tid, sizeof(gparams.tid)) ||
get_user(gparams.period_num, &user->period_num) ||
get_user(gparam... | [
1,
0
] |
Linux Kernel | sound/core/vmaster.c | static int follower_init(struct link_follower *follower) {
struct snd_ctl_elem_info *uinfo;
int err;
if (follower->info.count) {
if (follower->flags & SND_CTL_FOLLOWER_NEED_UPDATE)
return follower_update(follower);
return 0;
}
uinfo = kmalloc(sizeof(*uinfo), GFP_KERNEL);
if (!uinfo)
ret... | [
1,
0
] |
Linux Kernel | sound/core/vmaster.c |
static int follower_get_val(struct link_follower *follower,
struct snd_ctl_elem_value *ucontrol) {
int err, ch;
err = follower_init(follower);
if (err < 0)
return err;
for (ch = 0; ch < follower->info.count; ch++)
ucontrol->value.integer.value[ch] = follower->vals[ch];
re... | [
0,
0
] |
Linux Kernel | sound/core/vmaster.c | static int follower_put_val(struct link_follower *follower,
struct snd_ctl_elem_value *ucontrol) {
int err, ch, vol;
err = master_init(follower->master);
if (err < 0)
return err;
switch (follower->info.type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
for (ch = 0; ch < follower->... | [
1,
0
] |
Linux Kernel | sound/core/vmaster.c | static int follower_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct link_follower *follower = snd_kcontrol_chip(kcontrol);
return follower->follower.info(&follower->follower, uinfo);
} | [
0,
0
] |
Linux Kernel | sound/core/vmaster.c |
static void follower_free(struct snd_kcontrol *kcontrol) {
struct link_follower *follower = snd_kcontrol_chip(kcontrol);
if (follower->follower.private_free)
follower->follower.private_free(&follower->follower);
if (follower->master)
list_del(&follower->list);
kfree(follower);
} | [
0,
0
] |
Linux Kernel | sound/core/vmaster.c |
static int master_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct link_master *master = snd_kcontrol_chip(kcontrol);
int err = master_init(master);
if (err < 0)
return err;
ucontrol->value.integer.value[0] = master->val;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/core/vmaster.c |
static int master_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct link_master *master = snd_kcontrol_chip(kcontrol);
int err, new_val, old_val;
bool first_init;
err = master_init(master);
if (err < 0)
return err;
first_init = err;
old_val = mast... | [
0,
0
] |
Linux Kernel | sound/core/vmaster.c | static void master_free(struct snd_kcontrol *kcontrol) {
struct link_master *master = snd_kcontrol_chip(kcontrol);
struct link_follower *follower, *n;
list_for_each_entry_safe(follower, n, &master->followers, list) {
struct snd_kcontrol *sctl = follower->kctl;
struct list_head olist = sctl->list;
mem... | [
1,
0
] |
Linux Kernel | sound/core/vmaster.c | int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kcontrol,
void (*hook)(void *private_data, int),
void *private_data) {
struct link_master *master = snd_kcontrol_chip(kcontrol);
master->hook = hook;
master->hook_private_data = private_data;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c | static inline int loopback_jiffies_timer_stop(struct loopback_pcm *dpcm) {
del_timer(&dpcm->timer);
dpcm->timer.expires = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_check_format(struct loopback_cable *cable, int stream) {
struct snd_pcm_runtime *runtime, *cruntime;
struct loopback_setup *setup;
struct snd_card *card;
int check;
if (cable->valid != CABLE_VALID_BOTH) {
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
goto __notify;
return 0;
}... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static void params_change(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct loopback_pcm *dpcm = runtime->private_data;
struct loopback_cable *cable = dpcm->cable;
cable->hw.formats = pcm_format_to_bits(runtime->format);
cable->hw.rate_min = runtime->rate;
... | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c | static int loopback_prepare(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct loopback_pcm *dpcm = runtime->private_data;
struct loopback_cable *cable = dpcm->cable;
int err, bps, salign;
if (cable->ops->stop_sync) {
err = cable->ops->stop_sync(dpcm);
... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static void clear_capture_buf(struct loopback_pcm *dpcm, unsigned int bytes) {
struct snd_pcm_runtime *runtime = dpcm->substream->runtime;
char *dst = runtime->dma_area;
unsigned int dst_off = dpcm->buf_pos;
if (dpcm->silent_size >= dpcm->pcm_buffer_size)
return;
if (dpcm->silent_size + bytes > dpcm->pc... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c | static void copy_play_buf(struct loopback_pcm *play, struct loopback_pcm *capt,
unsigned int bytes) {
struct snd_pcm_runtime *runtime = play->substream->runtime;
char *src = runtime->dma_area;
char *dst = capt->substream->runtime->dma_area;
unsigned int src_off = play->buf_pos;
unsig... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static void loopback_snd_timer_work(struct work_struct *work) {
struct loopback_cable *cable;
cable = container_of(work, struct loopback_cable, snd_timer.event_work);
loopback_snd_timer_period_elapsed(cable, SNDRV_TIMER_EVENT_MSTOP, 0);
} | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c | static void loopback_snd_timer_event(struct snd_timer_instance *timeri,
int event, struct timespec64 *tstamp,
unsigned long resolution) {
if (event == SNDRV_TIMER_EVENT_MSTOP) {
struct loopback_cable *cable = timeri->callback_data;
/*... | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct loopback_pcm *dpcm = runtime->private_data;
snd_pcm_uframes_t pos;
spin_lock(&dpcm->cable->lock);
if (dpcm->cable->ops->pos_update)
dpcm->cable->ops->pos_update(d... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_pcm_new(struct loopback *loopback, int device,
int substreams) {
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(loopback->card, "Loopback PCM", device, substreams,
substreams, &pcm);
if (err < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_rate_shift_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct loopback *loopback = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change = 0;
val = ucontrol->value.integer.value[0];
if (val < 80000)
val = 80000;
i... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_notify_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct loopback *loopback = snd_kcontrol_chip(kcontrol);
mutex_lock(&loopback->cable_lock);
ucontrol->value.integer.value[0] =
loopback->setup[kcontrol->id.subdevice][kcontro... | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_notify_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct loopback *loopback = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change = 0;
val = ucontrol->value.integer.value[0] ? 1 : 0;
mutex_lock(&loopback->cable_lock);
... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_format_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 = (__force int)SNDRV_PCM_FORMAT_LAST;
uinfo->value.integer.step... | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_rate_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 = 192000;
uinfo->value.integer.step = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_rate_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct loopback *loopback = snd_kcontrol_chip(kcontrol);
mutex_lock(&loopback->cable_lock);
ucontrol->value.integer.value[0] =
loopback->setup[kcontrol->id.subdevice][kcontrol->i... | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_channels_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 = 1;
uinfo->value.integer.max = 1024;
uinfo->value.integer.step = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static void print_dpcm_info(struct snd_info_buffer *buffer,
struct loopback_pcm *dpcm, const char *id) {
snd_iprintf(buffer, " %s\n", id);
if (dpcm == NULL) {
snd_iprintf(buffer, " inactive\n");
return;
}
snd_iprintf(buffer, " buffer_size:\t%u\n", dpcm->pcm_buffer_siz... | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static void loopback_set_timer_source(struct loopback *loopback,
const char *value) {
if (loopback->timer_source) {
devm_kfree(loopback->card->dev, loopback->timer_source);
loopback->timer_source = NULL;
}
if (value && *value)
loopback->timer_source =
dev... | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static void change_timer_source_info(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct loopback *loopback = entry->private_data;
char line[64];
mutex_lock(&loopback->cable_lock);
if (!snd_info_get_line(buffer, line, sizeof(line)))
loopback_set_time... | [
1,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static int loopback_timer_source_proc_new(struct loopback *loopback) {
return snd_card_rw_proc_new(loopback->card, "timer_source", loopback,
print_timer_source_info,
change_timer_source_info);
} | [
0,
0
] |
Linux Kernel | sound/drivers/aloop.c |
static void __exit alsa_card_loopback_exit(void) { loopback_unregister_all(); } | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c | static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime) {
int err;
err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
return err;
err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
256, UINT_M... | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static void dummy_systimer_rearm(struct dummy_systimer_pcm *dpcm) {
mod_timer(&dpcm->timer,
jiffies + DIV_ROUND_UP(dpcm->frac_period_rest, dpcm->rate));
} | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int dummy_systimer_start(struct snd_pcm_substream *substream) {
struct dummy_systimer_pcm *dpcm = substream->runtime->private_data;
spin_lock(&dpcm->lock);
dpcm->base_time = jiffies;
dummy_systimer_rearm(dpcm);
spin_unlock(&dpcm->lock);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int dummy_systimer_prepare(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct dummy_systimer_pcm *dpcm = runtime->private_data;
dpcm->frac_pos = 0;
dpcm->rate = runtime->rate;
dpcm->frac_buffer_size = runtime->buffer_size * HZ;
dpcm->frac_period_size... | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static void dummy_systimer_callback(struct timer_list *t) {
struct dummy_systimer_pcm *dpcm = from_timer(dpcm, t, timer);
unsigned long flags;
int elapsed = 0;
spin_lock_irqsave(&dpcm->lock, flags);
dummy_systimer_update(dpcm);
dummy_systimer_rearm(dpcm);
elapsed = dpcm->elapsed;
dpcm->elapsed = 0;
... | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int dummy_hrtimer_start(struct snd_pcm_substream *substream) {
struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data;
dpcm->base_time = hrtimer_cb_get_time(&dpcm->timer);
hrtimer_start(&dpcm->timer, dpcm->period_time, HRTIMER_MODE_REL_SOFT);
atomic_set(&dpcm->running, 1);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int dummy_hrtimer_stop(struct snd_pcm_substream *substream) {
struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data;
atomic_set(&dpcm->running, 0);
if (!hrtimer_callback_running(&dpcm->timer))
hrtimer_cancel(&dpcm->timer);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int dummy_hrtimer_prepare(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct dummy_hrtimer_pcm *dpcm = runtime->private_data;
unsigned int period, rate;
long sec;
unsigned long nsecs;
dummy_hrtimer_sync(dpcm);
period = runtime->period_size;
rate ... | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int dummy_pcm_prepare(struct snd_pcm_substream *substream) {
return get_dummy_ops(substream)->prepare(substream);
} | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int dummy_pcm_close(struct snd_pcm_substream *substream) {
get_dummy_ops(substream)->free(substream);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c | static int dummy_pcm_copy(struct snd_pcm_substream *substream, int channel,
unsigned long pos, void __user *dst,
unsigned long bytes) {
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c | static int dummy_pcm_copy_kernel(struct snd_pcm_substream *substream,
int channel, unsigned long pos, void *dst,
unsigned long bytes) {
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c | static int dummy_pcm_silence(struct snd_pcm_substream *substream, int channel,
unsigned long pos, unsigned long bytes) {
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int snd_dummy_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = mixer_volume_level_min;
uinfo->value.integer.max = mixer_volume_level_max;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int snd_dummy_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
left = ucontrol->value.integer.value[0];
if (left < mixer_... | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
left = ucontrol->value.integer.value[0] & 1;
right = ucont... | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static int snd_card_dummy_new_mixer(struct snd_dummy *dummy) {
struct snd_card *card = dummy->card;
struct snd_kcontrol *kcontrol;
unsigned int idx;
int err;
spin_lock_init(&dummy->mixer_lock);
strcpy(card->mixername, "Dummy Mixer");
dummy->iobox = 1;
for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls... | [
1,
0
] |
Linux Kernel | sound/drivers/dummy.c |
static void print_rates(struct snd_dummy *dummy,
struct snd_info_buffer *buffer) {
static const int rates[] = {
5512, 8000, 11025, 16000, 22050, 32000, 44100,
48000, 64000, 88200, 96000, 176400, 192000,
};
int i;
if (dummy->pcm_hw.rates & SNDRV_PCM_RATE_CONTINUOUS)
... | [
0,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401.c |
static int snd_mpu401_pnp(int dev, struct pnp_dev *device,
const struct pnp_device_id *id) {
if (!pnp_port_valid(device, 0) ||
pnp_port_flags(device, 0) & IORESOURCE_DISABLED) {
snd_printk(KERN_ERR "no PnP port\n");
return -ENODEV;
}
if (pnp_port_len(device, 0) < IO_EXTENT... | [
0,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401.c |
static void __exit alsa_card_mpu401_exit(void) { snd_mpu401_unregister_all(); } | [
0,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401_uart.c |
static unsigned char mpu401_read_port(struct snd_mpu401 *mpu,
unsigned long addr) {
return inb(addr);
} | [
0,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401_uart.c |
static void uart_interrupt_tx(struct snd_mpu401 *mpu) {
unsigned long flags;
if (test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode) &&
test_bit(MPU401_MODE_BIT_OUTPUT_TRIGGER, &mpu->mode)) {
spin_lock_irqsave(&mpu->output_lock, flags);
snd_mpu401_uart_output_write(mpu);
spin_unlock_irqrestore(&mpu->ou... | [
0,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401_uart.c | static void snd_mpu401_uart_add_timer(struct snd_mpu401 *mpu, int input) {
unsigned long flags;
spin_lock_irqsave(&mpu->timer_lock, flags);
if (mpu->timer_invoked == 0) {
timer_setup(&mpu->timer, snd_mpu401_uart_timer, 0);
mod_timer(&mpu->timer, 1 + jiffies);
}
mpu->timer_invoked |=
input ? MPU... | [
0,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401_uart.c | static int snd_mpu401_uart_cmd(struct snd_mpu401 *mpu, unsigned char cmd,
int ack) {
unsigned long flags;
int timeout, ok;
spin_lock_irqsave(&mpu->input_lock, flags);
if (mpu->hardware != MPU401_HW_TRID4DWAVE) {
mpu->write(mpu, 0x00, MPU401D(mpu));
}
/* ok. standard MPU-4... | [
1,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401_uart.c | static void
snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substream, int up) {
unsigned long flags;
struct snd_mpu401 *mpu;
int max = 64;
mpu = substream->rmidi->private_data;
if (up) {
if (!test_and_set_bit(MPU401_MODE_BIT_INPUT_TRIGGER, &mpu->mode)) {
while (max-- > 0)
mpu-... | [
0,
0
] |
Linux Kernel | sound/drivers/mpu401/mpu401_uart.c | static void snd_mpu401_uart_input_read(struct snd_mpu401 *mpu) {
int max = 128;
unsigned char byte;
while (max-- > 0) {
if (!snd_mpu401_input_avail(mpu))
break;
byte = mpu->read(mpu, MPU401D(mpu));
if (test_bit(MPU401_MODE_BIT_INPUT_TRIGGER, &mpu->mode))
snd_rawmidi_receive(mpu->substream... | [
0,
0
] |
Linux Kernel | sound/drivers/mtpav.c | static void snd_mtpav_output_trigger(struct snd_rawmidi_substream *substream,
int up) {
struct mtpav *mtp_card = substream->rmidi->private_data;
struct mtpav_port *portp = &mtp_card->ports[substream->number];
unsigned long flags;
spin_lock_irqsave(&mtp_card->spinlock, flags... | [
1,
0
] |
Linux Kernel | sound/drivers/mtpav.c | static int snd_mtpav_probe(struct platform_device *dev) {
struct snd_card *card;
int err;
struct mtpav *mtp_card;
err = snd_devm_card_new(&dev->dev, index, id, THIS_MODULE, sizeof(*mtp_card),
&card);
if (err < 0)
return err;
mtp_card = card->private_data;
spin_lock_init(&mt... | [
1,
0
] |
Linux Kernel | sound/drivers/mts64.c |
static int snd_mts64_free(struct mts64 *mts) {
kfree(mts);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static int snd_mts64_create(struct snd_card *card, struct pardevice *pardev,
struct mts64 **rchip) {
struct mts64 *mts;
*rchip = NULL;
mts = kzalloc(sizeof(struct mts64), GFP_KERNEL);
if (mts == NULL)
return -ENOMEM;
spin_lock_init(&mts->lock);
mts->card = card;
mts->par... | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static void mts64_enable_readout(struct parport *p) {
u8 c;
c = parport_read_control(p);
c |= MTS64_CTL_READOUT;
parport_write_control(p, c);
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static u8 mts64_map_midi_input(u8 c) {
static const u8 map[] = {0, 1, 4, 2, 3};
return map[c];
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static u16 mts64_read(struct parport *p) {
u8 data, status;
mts64_device_ready(p);
mts64_enable_readout(p);
status = parport_read_status(p);
data = mts64_read_char(p);
mts64_disable_readout(p);
return (status << 8) | data;
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static void mts64_smpte_start(struct parport *p, u8 hours, u8 minutes,
u8 seconds, u8 frames, u8 idx) {
static const u8 fps[5] = {MTS64_CMD_SMPTE_FPS_24, MTS64_CMD_SMPTE_FPS_25,
MTS64_CMD_SMPTE_FPS_2997, MTS64_CMD_SMPTE_FPS_30D,
MTS... | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static void mts64_write_data(struct parport *p, u8 c) {
mts64_device_ready(p);
parport_write_data(p, c);
parport_write_control(p, MTS64_CTL_WRITE_DATA);
parport_write_control(p, MTS64_CTL_WRITE_DATA | MTS64_CTL_STROBE);
parport_write_control(p, MTS64_CTL_WRITE_DATA);
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c |
static int snd_mts64_ctl_smpte_time_f_info(struct snd_kcontrol *kctl,
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 = 99;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static void snd_mts64_interrupt(void *private) {
struct mts64 *mts = ((struct snd_card *)private)->private_data;
u16 ret;
u8 status, data;
struct snd_rawmidi_substream *substream;
if (!mts)
return;
spin_lock(&mts->lock);
ret = mts64_read(mts->pardev->port);
data = ret & 0x00ff;
status = ret >> 8... | [
1,
0
] |
Linux Kernel | sound/drivers/mts64.c |
static int snd_mts64_dev_probe(struct pardevice *pardev) {
if (strcmp(pardev->name, DRIVER_NAME))
return -ENODEV;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static void snd_mts64_card_private_free(struct snd_card *card) {
struct mts64 *mts = card->private_data;
struct pardevice *pardev = mts->pardev;
if (pardev) {
parport_release(pardev);
parport_unregister_device(pardev);
}
snd_mts64_free(mts);
} | [
0,
0
] |
Linux Kernel | sound/drivers/mts64.c | static void snd_mts64_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_mts64_driver);
parport_unregister_driver(&mts64_parport_drive... | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_drums.c | static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3,
const struct snd_opl3_drum_voice *data) {
unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
unsigned char voice_offset = data->voice;
unsigned short opl3_reg;
opl3_reg = OPL3_LEFT | (OPL3_REG_AM_VIB +... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_drums.c | static void snd_opl3_drum_vol_set(struct snd_opl3 *opl3,
const struct snd_opl3_drum_voice *data,
int vel, struct snd_midi_channel *chan) {
unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
unsigned char voice_offset = data->voice;
... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_lib.c | static int snd_opl3_timer1_start(struct snd_timer *timer) {
unsigned long flags;
unsigned char tmp;
unsigned int ticks;
struct snd_opl3 *opl3;
opl3 = snd_timer_chip(timer);
spin_lock_irqsave(&opl3->timer_lock, flags);
ticks = timer->sticks;
tmp = (opl3->timer_enable | OPL3_TIMER1_START) & ~OPL3_TIMER1_... | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_lib.c |
static int snd_opl3_timer1_init(struct snd_opl3 *opl3, int timer_no) {
struct snd_timer *timer = NULL;
struct snd_timer_id tid;
int err;
tid.dev_class = SNDRV_TIMER_CLASS_CARD;
tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE;
tid.card = opl3->card->number;
tid.device = timer_no;
tid.subdevice = 0;
err = sn... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_lib.c | int snd_opl3_init(struct snd_opl3 *opl3) {
if (!opl3->command) {
printk(KERN_ERR "snd_opl3_init: command not defined!\n");
return -EINVAL;
}
opl3->command(opl3, OPL3_LEFT | OPL3_REG_TEST, OPL3_ENABLE_WAVE_SELECT);
opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, 0x00);
switch (opl3->hardware & ... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_midi.c |
static void snd_opl3_calc_pitch(unsigned char *fnum, unsigned char *blocknum,
int note, struct snd_midi_channel *chan) {
int block = ((note / 12) & 0x07) - 1;
int idx = (note % 12) + 2;
int freq;
if (chan->midi_pitchbend) {
int pitchbend = chan->midi_pitchbend;
int segm... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_midi.c | void snd_opl3_timer_func(struct timer_list *t) {
struct snd_opl3 *opl3 = from_timer(opl3, t, tlist);
unsigned long flags;
int again = 0;
int i;
spin_lock_irqsave(&opl3->voice_lock, flags);
for (i = 0; i < opl3->max_voices; i++) {
struct snd_opl3_voice *vp = &opl3->voices[i];
if (vp->state > 0 && v... | [
1,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_midi.c | void snd_opl3_nrpn(void *p, struct snd_midi_channel *chan,
struct snd_midi_channel_set *chset) {
#ifdef DEBUG_MIDI
snd_printk(KERN_DEBUG "NRPN, ch#: %i, inst#: %i\n", chan->number,
chan->midi_program);
#endif
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_oss.c | void snd_opl3_free_seq_oss(struct snd_opl3 *opl3) {
if (opl3->oss_seq_dev) {
opl3->oss_seq_dev = NULL;
}
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_oss.c | static int snd_opl3_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
unsigned long ioarg) {
if (snd_BUG_ON(!arg))
return -ENXIO;
switch (cmd) {
case SNDCTL_FM_LOAD_INSTR:
snd_printk(KERN_ERR "OPL3: "
"Obsolete ioctl(SNDCTL_FM_LOAD_INSTR... | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_oss.c | static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg) {
if (snd_BUG_ON(!arg))
return -ENXIO;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_seq.c |
int snd_opl3_synth_use_inc(struct snd_opl3 *opl3) {
if (!try_module_get(opl3->card->module))
return -EFAULT;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/drivers/opl3/opl3_seq.c | int snd_opl3_synth_setup(struct snd_opl3 *opl3) {
int idx;
struct snd_hwdep *hwdep = opl3->hwdep;
mutex_lock(&hwdep->open_mutex);
if (hwdep->used) {
mutex_unlock(&hwdep->open_mutex);
return -EBUSY;
}
hwdep->used++;
mutex_unlock(&hwdep->open_mutex);
snd_opl3_reset(opl3);
for (idx = 0; idx < ... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.