Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/core/oss/mixer_oss.c |
static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer,
unsigned int active_index) {
struct snd_card *card = fmixer->card;
struct snd_mixer_oss *mixer = fmixer->mixer;
struct snd_kcontrol *kctl;
struct snd_mixer_oss_slot *pslot;
struct slot *slot = NULL;
... | [
0,
0
] |
Linux Kernel | sound/core/oss/mixer_oss.c |
static int snd_mixer_oss_build_test(struct snd_mixer_oss *mixer,
struct slot *slot, const char *name,
int index, int item) {
struct snd_ctl_elem_info *info;
struct snd_kcontrol *kcontrol;
struct snd_card *card = mixer->card;
int err;
do... | [
0,
0
] |
Linux Kernel | sound/core/oss/mixer_oss.c |
static void snd_mixer_oss_proc_init(struct snd_mixer_oss *mixer) {
struct snd_info_entry *entry;
entry = snd_info_create_card_entry(mixer->card, "oss_mixer",
mixer->card->proc_root);
if (!entry)
return;
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->mode = S_IFREG ... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_interval_refine_min(struct snd_interval *i, unsigned int min,
int openmin) {
int changed = 0;
if (i->min < min) {
i->min = min;
i->openmin = openmin;
changed = 1;
} else if (i->min == min && !i->openmin && openmin) {
i->openmin = 1;
changed = 1... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_interval_refine_max(struct snd_interval *i, unsigned int max,
int openmax) {
int changed = 0;
if (i->max > max) {
i->max = max;
i->openmax = openmax;
changed = 1;
} else if (i->max == max && !i->openmax && openmax) {
i->openmax = 1;
changed = ... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_hw_param_min(struct snd_pcm_substream *pcm,
struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var, unsigned int val,
int *dir) {
int changed = _snd_pcm_hw_param_min(params, var, val, dir ? *dir : 0);
... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int boundary_sub(int a, int adir, int b, int bdir, int *c, int *cdir) {
adir = adir < 0 ? -1 : (adir > 0 ? 1 : 0);
bdir = bdir < 0 ? -1 : (bdir > 0 ? 1 : 0);
*c = a - b;
*cdir = adir - bdir;
if (*cdir == -2) {
(*c)--;
} else if (*cdir == 2) {
(*c)++;
}
return 0;
} | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int boundary_lt(unsigned int a, int adir, unsigned int b, int bdir) {
if (adir < 0) {
a--;
adir = 1;
} else if (adir > 0)
adir = 1;
if (bdir < 0) {
b--;
bdir = 1;
} else if (bdir > 0)
bdir = 1;
return a < b || (a == b && adir < bdir);
} | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm,
struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var, unsigned int val,
int dir) {
int changed = _snd_pcm_hw_param_set(params, var, val, dir);
if (change... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var) {
int changed;
changed = snd_interval_setinteger(hw_param_interval(params, var));
if (changed > 0) {
params->cmask |= 1 << var;
params->rmask |= 1 << var;
}
return ... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_oss_plugin_clear(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_pcm_plugin *plugin, *next;
plugin = runtime->oss.plugin_first;
while (plugin) {
next = plugin->next;
snd_pcm_plugin_free(plugin);
plugin = next;
}
runtime-... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_pcm_plugin_insert(struct snd_pcm_plugin *plugin) {
struct snd_pcm_runtime *runtime = plugin->plug->runtime;
plugin->next = runtime->oss.plugin_first;
plugin->prev = NULL;
if (runtime->oss.plugin_first) {
runtime->oss.plugin_first->prev = plugin;
runtime->oss.plugin_first = plugin;
} el... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_pcm_oss_make_ready(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime;
int err;
runtime = substream->runtime;
if (runtime->oss.params) {
err = snd_pcm_oss_change_params(substream, false);
if (err < 0)
return err;
}
if (runtime->oss.prepare) {
if (mutex_... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static ssize_t snd_pcm_oss_write2(struct snd_pcm_substream *substream,
const char *buf, size_t bytes,
int in_kernel) {
struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t frames, frames1;
#ifdef CONFIG_SND_PCM_OSS_PLUGINS
if ... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_oss_post(struct snd_pcm_oss_file *pcm_oss_file) {
struct snd_pcm_substream *substream;
int err;
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
if (substream != NULL) {
err = snd_pcm_oss_make_ready(substream);
if (err < 0)
return err;
snd_pcm_kernel_ioctl(subs... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_pcm_oss_set_rate(struct snd_pcm_oss_file *pcm_oss_file,
int rate) {
int idx;
for (idx = 1; idx >= 0; --idx) {
struct snd_pcm_substream *substream = pcm_oss_file->streams[idx];
struct snd_pcm_runtime *runtime;
int err;
if (substream == NULL)
con... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_pcm_oss_get_channels(struct snd_pcm_oss_file *pcm_oss_file) {
struct snd_pcm_substream *substream;
int err;
err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream);
if (err < 0)
return err;
return substream->runtime->oss.channels;
} | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_pcm_oss_set_subdivide1(struct snd_pcm_substream *substream,
int subdivide) {
struct snd_pcm_runtime *runtime;
runtime = substream->runtime;
if (subdivide == 0) {
subdivide = runtime->oss.subdivision;
if (subdivide == 0)
subdivide = 1;
return... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_oss_set_fragment1(struct snd_pcm_substream *substream,
unsigned int val) {
struct snd_pcm_runtime *runtime;
int fragshift;
runtime = substream->runtime;
if (runtime->oss.subdivision || runtime->oss.fragshift)
return -EINVAL;
fragshift = val & 0xffff... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_oss_get_caps(struct snd_pcm_oss_file *pcm_oss_file) {
int result, idx;
result = DSP_CAP_TRIGGER | DSP_CAP_MMAP | DSP_CAP_DUPLEX | DSP_CAP_REALTIME;
for (idx = 0; idx < 2; idx++) {
struct snd_pcm_substream *substream = pcm_oss_file->streams[idx];
result = snd_pcm_oss_get_caps1(substream... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_oss_get_odelay(struct snd_pcm_oss_file *pcm_oss_file) {
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
snd_pcm_sframes_t delay;
int err;
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
if (substream == NULL)
return -EINVAL;
err = snd_pcm_oss_mak... | [
1,
1
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_oss_get_mapbuf(struct snd_pcm_oss_file *pcm_oss_file,
int stream,
struct buffmem_desc __user *_info) {
// pr_debug("TODO: snd_pcm_oss_get_mapbuf\n");
return -EINVAL;
} | [
0,
1
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static int snd_pcm_oss_open_file(struct file *file, struct snd_pcm *pcm,
struct snd_pcm_oss_file **rpcm_oss_file,
int minor, struct snd_pcm_oss_setup *setup) {
int idx, err;
struct snd_pcm_oss_file *pcm_oss_file;
struct snd_pcm_substream *substream... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_pcm_oss_release(struct inode *inode, struct file *file) {
struct snd_pcm *pcm;
struct snd_pcm_substream *substream;
struct snd_pcm_oss_file *pcm_oss_file;
pcm_oss_file = file->private_data;
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
if (substream == NULL)
substream = ... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static int snd_pcm_oss_playback_ready(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
if (atomic_read(&substream->mmap_count))
return runtime->oss.prev_hw_ptr_period != get_hw_ptr_period(runtime);
else
return snd_pcm_playback_avail(runtime) >= runtime->oss.per... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static void snd_pcm_oss_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_pcm_str *pstr = entry->private_data;
struct snd_pcm_oss_setup *setup = pstr->oss.setup_list;
mutex_lock(&pstr->oss.setup_mutex);
while (setup) {
snd_iprintf(buffer, ... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static void snd_pcm_oss_proc_free_setup_list(struct snd_pcm_str *pstr) {
struct snd_pcm_oss_setup *setup, *setupn;
for (setup = pstr->oss.setup_list, pstr->oss.setup_list = NULL; setup;
setup = setupn) {
setupn = setup->next;
kfree(setup->task_name);
kfree(setup);
}
pstr->oss.setup_list = N... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c | static inline void snd_pcm_oss_proc_init(struct snd_pcm *pcm) {} | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_oss.c |
static void register_oss_dsp(struct snd_pcm *pcm, int index) {
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM, pcm->card, index,
&snd_pcm_oss_f_reg, pcm) < 0) {
pcm_err(pcm, "unable to register OSS PCM device %i:%i\n", pcm->card->number,
pcm->device);
}
} | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.c |
int snd_pcm_plug_alloc(struct snd_pcm_substream *plug,
snd_pcm_uframes_t frames) {
int err;
if (snd_BUG_ON(!snd_pcm_plug_first(plug)))
return -ENXIO;
if (snd_pcm_plug_stream(plug) == SNDRV_PCM_STREAM_PLAYBACK) {
struct snd_pcm_plugin *plugin = snd_pcm_plug_first(plug);
while (p... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.c |
snd_pcm_sframes_t
snd_pcm_plugin_client_channels(struct snd_pcm_plugin *plugin,
snd_pcm_uframes_t frames,
struct snd_pcm_plugin_channel **channels) {
*channels = plugin->buf_channels;
return frames;
} | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.c |
static snd_pcm_sframes_t calc_dst_frames(struct snd_pcm_substream *plug,
snd_pcm_sframes_t frames,
bool check_size) {
struct snd_pcm_plugin *plugin, *plugin_next;
plugin = snd_pcm_plug_first(plug);
while (plugin && frames > 0) {
... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.c |
static snd_pcm_sframes_t calc_src_frames(struct snd_pcm_substream *plug,
snd_pcm_sframes_t frames,
bool check_size) {
struct snd_pcm_plugin *plugin, *plugin_prev;
plugin = snd_pcm_plug_last(plug);
while (plugin && frames > 0) {
... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.c |
static int snd_pcm_plug_formats(const struct snd_mask *mask,
snd_pcm_format_t format) {
struct snd_mask formats = *mask;
u64 linfmts = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_... | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.c |
snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format,
const struct snd_mask *format_mask) {
int i;
if (snd_mask_test(format_mask, (__force int)format))
return format;
if (!snd_pcm_plug_formats(format_mask, format))
return (__force snd_pcm_format_t... | [
1,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.c | int snd_pcm_area_silence(const struct snd_pcm_channel_area *dst_area,
size_t dst_offset, size_t samples,
snd_pcm_format_t format) {
/* FIXME: sub byte resolution and odd dst_offset */
unsigned char *dst;
unsigned int dst_step;
int width;
const unsigned char *s... | [
1,
1
] |
Linux Kernel | sound/core/oss/pcm_plugin.h |
static inline snd_pcm_sframes_t
snd_pcm_plug_client_size(struct snd_pcm_substream *handle,
snd_pcm_uframes_t drv_size) {
return drv_size;
} | [
0,
0
] |
Linux Kernel | sound/core/oss/pcm_plugin.h | static inline int
snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) {
return format;
}
#endif
#ifdef PLUGIN_DEBUG
#define pdprintf(fmt, args...) printk(KERN_DEBUG "plugin: " fmt, ##args)
#else
#define pdprintf(fmt, args...) | [
0,
0
] |
Linux Kernel | sound/core/oss/rate.c |
static snd_pcm_sframes_t rate_src_frames(struct snd_pcm_plugin *plugin,
snd_pcm_uframes_t frames) {
struct rate_priv *data;
snd_pcm_sframes_t res;
if (snd_BUG_ON(!plugin))
return -ENXIO;
if (frames == 0)
return 0;
data = (struct rate_priv *)plugin->extra_data... | [
1,
0
] |
Linux Kernel | sound/core/oss/rate.c |
static snd_pcm_sframes_t rate_dst_frames(struct snd_pcm_plugin *plugin,
snd_pcm_uframes_t frames) {
struct rate_priv *data;
snd_pcm_sframes_t res;
if (snd_BUG_ON(!plugin))
return -ENXIO;
if (frames == 0)
return 0;
data = (struct rate_priv *)plugin->extra_data... | [
1,
0
] |
Linux Kernel | sound/core/pcm.c |
static struct snd_pcm *snd_pcm_get(struct snd_card *card, int device) {
struct snd_pcm *pcm;
list_for_each_entry(pcm, &snd_pcm_devices, list) {
if (pcm->card == card && pcm->device == device)
return pcm;
}
return NULL;
} | [
1,
0
] |
Linux Kernel | sound/core/pcm.c |
static const char *snd_pcm_tstamp_mode_name(int mode) {
return snd_pcm_tstamp_mode_names[mode];
} | [
0,
0
] |
Linux Kernel | sound/core/pcm.c |
static const char *snd_pcm_state_name(snd_pcm_state_t state) {
return snd_pcm_state_names[(__force int)state];
} | [
0,
0
] |
Linux Kernel | sound/core/pcm.c |
static void
snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_pcm_substream *substream = entry->private_data;
struct snd_pcm_runtime *runtime;
mutex_lock(&substream->pcm->open_mutex);
runtime = substream->runt... | [
1,
0
] |
Linux Kernel | sound/core/pcm.c |
static void snd_pcm_xrun_debug_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_pcm_str *pstr = entry->private_data;
snd_iprintf(buffer, "%d\n", pstr->xrun_debug);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm.c | int snd_pcm_new_internal(struct snd_card *card, const char *id, int device,
int playback_count, int capture_count,
struct snd_pcm **rpcm) {
return _snd_pcm_new(card, id, device, playback_count, capture_count, true,
rpcm);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm.c |
static void free_chmap(struct snd_pcm_str *pstr) {
if (pstr->chmap_kctl) {
struct snd_card *card = pstr->pcm->card;
down_write(&card->controls_rwsem);
snd_ctl_remove(card, pstr->chmap_kctl);
up_write(&card->controls_rwsem);
pstr->chmap_kctl = NULL;
}
} | [
1,
0
] |
Linux Kernel | sound/core/pcm.c |
static int snd_pcm_free(struct snd_pcm *pcm) {
if (!pcm)
return 0;
if (!pcm->internal)
pcm_call_notify(pcm, n_unregister);
if (pcm->private_free)
pcm->private_free(pcm);
snd_pcm_lib_preallocate_free_for_all(pcm);
snd_pcm_free_stream(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK]);
snd_pcm_free_stream... | [
0,
0
] |
Linux Kernel | sound/core/pcm.c |
static int snd_pcm_dev_free(struct snd_device *device) {
struct snd_pcm *pcm = device->device_data;
return snd_pcm_free(pcm);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm.c | void snd_pcm_detach_substream(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime;
if (PCM_RUNTIME_CHECK(substream))
return;
runtime = substream->runtime;
if (runtime->private_free != NULL)
runtime->private_free(runtime);
free_pages_exact(runtime->status,
PAGE_AL... | [
1,
0
] |
Linux Kernel | sound/core/pcm.c | static int snd_pcm_dev_register(struct snd_device *device) {
int cidx, err;
struct snd_pcm_substream *substream;
struct snd_pcm *pcm;
if (snd_BUG_ON(!device || !device->device_data))
return -ENXIO;
pcm = device->device_data;
mutex_lock(®ister_mutex);
err = snd_pcm_add(pcm);
if (err)
goto un... | [
1,
0
] |
Linux Kernel | sound/core/pcm.c |
static void snd_pcm_proc_done(void) { snd_info_free_entry(snd_pcm_proc_entry); } | [
0,
0
] |
Linux Kernel | sound/core/pcm_compat.c |
static int snd_pcm_ioctl_forward_compat(struct snd_pcm_substream *substream,
u32 __user *src) {
snd_pcm_uframes_t frames;
int err;
if (get_user(frames, src))
return -EFAULT;
err = snd_pcm_forward(substream, frames);
if (put_user(err, src))
return -EFAULT;
re... | [
0,
0
] |
Linux Kernel | sound/core/pcm_compat.c | static int snd_pcm_ioctl_xferi_compat(struct snd_pcm_substream *substream,
int dir,
struct snd_xferi32 __user *data32) {
compat_caddr_t buf;
u32 frames;
int err;
if (!substream->runtime)
return -ENOTTY;
if (substream->stream != d... | [
1,
0
] |
Linux Kernel | sound/core/pcm_dmaengine.c | snd_pcm_uframes_t
snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream) {
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct dma_tx_state state;
enum dma_status status;
unsigned int buf_size;
unsigned int pos = 0;
... | [
1,
0
] |
Linux Kernel | sound/core/pcm_dmaengine.c | int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream) {
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
dmaengine_synchronize(prtd->dma_chan);
kfree(prtd);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_drm_eld.c | static int eld_limit_channels(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct snd_interval *c = hw_param_interval(params, rule->var);
const struct snd_interval *r;
struct snd_interval t = {
.min = 1,
.max = 2,
.integer = 1,
};
unsigned i... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | void snd_pcm_debug_name(struct snd_pcm_substream *substream, char *name,
size_t len) {
snprintf(name, len, "pcmC%dD%d%c:%d", substream->pcm->card->number,
substream->pcm->device, substream->stream ? 'c' : 'p',
substream->number);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c | static void update_audio_tstamp(struct snd_pcm_substream *substream,
struct timespec64 *curr_tstamp,
struct timespec64 *audio_tstamp) {
struct snd_pcm_runtime *runtime = substream->runtime;
u64 audio_frames, audio_nsecs;
struct timespec64 driver_tsta... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
static inline unsigned int div_down(unsigned int a, unsigned int b) {
if (b == 0)
return UINT_MAX;
return a / b;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c | void snd_interval_div(const struct snd_interval *a,
const struct snd_interval *b, struct snd_interval *c) {
unsigned int r;
if (a->empty || b->empty) {
snd_interval_none(c);
return;
}
c->empty = 0;
c->min = div32(a->min, b->max, &r);
c->openmin = (r || a->openmin || b->openmax)... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | void snd_interval_muldivk(const struct snd_interval *a,
const struct snd_interval *b, unsigned int k,
struct snd_interval *c) {
unsigned int r;
if (a->empty || b->empty) {
snd_interval_none(c);
return;
}
c->empty = 0;
c->min = muldiv32(a->min, b->min... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | int snd_interval_ranges(struct snd_interval *i, unsigned int count,
const struct snd_interval *ranges, unsigned int mask) {
unsigned int k;
struct snd_interval range_union;
struct snd_interval range;
if (!count) {
snd_interval_none(i);
return -EINVAL;
}
snd_interval_any(&ran... | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
static int snd_interval_step(struct snd_interval *i, unsigned int step) {
unsigned int n;
int changed = 0;
n = i->min % step;
if (n != 0 || i->openmin) {
i->min += step - n;
i->openmin = 0;
changed = 1;
}
n = i->max % step;
if (n != 0 || i->openmax) {
i->max -= n;
i->openmax = 0;
... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond,
int var, snd_pcm_hw_rule_func_t func, void *private,
int dep, ...) {
struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
struct snd_pcm_hw_rule *c;
unsigned int k;
va_list a... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime,
snd_pcm_hw_param_t var, u_int32_t mask) {
struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
struct snd_mask *maskp = constrs_mask(constrs, var);
*maskp->bits &= mask;
memset(maskp->bits + 1, 0, (SNDRV... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | int snd_pcm_hw_constraint_ratdens(
struct snd_pcm_runtime *runtime, unsigned int cond, snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ratdens *r) {
return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_rule_ratdens,
(void *)r, var, -1);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c | int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
unsigned int cond, snd_pcm_hw_param_t var,
unsigned long step) {
return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_rule_step,
(void *)step, var, -1);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
static int snd_pcm_hw_rule_pow2(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
static const unsigned int pow2_sizes[] = {
1 << 0, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7,
1 << 8, 1 << 9, 1 << 10, 1 << 11, 1 << 12, 1 << 13, 1 << 14... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
static void _snd_pcm_hw_param_any(struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var) {
if (hw_is_mask(var)) {
snd_mask_any(hw_param_mask(params, var));
params->cmask |= 1 << var;
params->rmask |= 1 << var;
return;
}
if (hw_is_interval(var)) {
snd_inter... | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params) {
unsigned int k;
memset(params, 0, sizeof(*params));
for (k = SNDRV_PCM_HW_PARAM_FIRST_MASK; k <= SNDRV_PCM_HW_PARAM_LAST_MASK;
k++)
_snd_pcm_hw_param_any(params, k);
for (k = SNDRV_PCM_HW_PARAM_FIRST_INTERVAL;
k <= SNDRV_PCM_HW_P... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var, int *dir) {
if (hw_is_mask(var)) {
const struct snd_mask *mask = hw_param_mask_c(params, var);
if (!snd_mask_single(mask))
return -EINVAL;
if (dir)
*dir = 0;
return snd_mas... | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var) {
if (hw_is_mask(var)) {
snd_mask_none(hw_param_mask(params, var));
params->cmask |= 1 << var;
params->rmask |= 1 << var;
} else if (hw_is_interval(var)) {
snd_interval_none(hw_... | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
static int snd_pcm_lib_ioctl_channel_info(struct snd_pcm_substream *substream,
void *arg) {
struct snd_pcm_channel_info *info = arg;
struct snd_pcm_runtime *runtime = substream->runtime;
int width;
if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) {
info->offset = -1;
... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | static int fill_silence(struct snd_pcm_substream *substream, int channel,
unsigned long hwoff, void *buf, unsigned long bytes) {
struct snd_pcm_runtime *runtime = substream->runtime;
if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
return 0;
if (substream->ops->fill_silence)
re... | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c | static int interleaved_copy(struct snd_pcm_substream *substream,
snd_pcm_uframes_t hwoff, void *data,
snd_pcm_uframes_t off, snd_pcm_uframes_t frames,
pcm_transfer_f transfer) {
struct snd_pcm_runtime *runtime = substream->runtime;
... | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c | static int fill_silence_frames(struct snd_pcm_substream *substream,
snd_pcm_uframes_t off,
snd_pcm_uframes_t frames) {
if (substream->runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED ||
substream->runtime->access == SNDRV_PCM_ACCESS_MMAP_INTERLEAVE... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | static int pcm_sanity_check(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
runtime = substream->runtime;
if (snd_BUG_ON(!substream->ops->copy_user && !runtime->dma_area))
return -EINVAL;
if (runtime->state == SNDRV_PCM_STATE_OPE... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | int pcm_lib_apply_appl_ptr(struct snd_pcm_substream *substream,
snd_pcm_uframes_t appl_ptr) {
struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_uframes_t old_appl_ptr = runtime->control->appl_ptr;
snd_pcm_sframes_t diff;
int ret;
if (old_appl_ptr == appl_ptr)
return... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c |
static bool valid_chmap_channels(const struct snd_pcm_chmap *info, int ch) {
if (ch > info->max_channels)
return false;
return !info->channel_mask || (info->channel_mask & (1U << ch));
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_lib.c | static int pcm_chmap_ctl_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
struct snd_pcm_substream *substream;
const struct snd_pcm_chm... | [
1,
0
] |
Linux Kernel | sound/core/pcm_lib.c | static int pcm_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
unsigned int size, unsigned int __user *tlv) {
struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
const struct snd_pcm_chmap_elem *map;
unsigned int __user *dst;
int c, count = 0;
if (!info->chmap)
... | [
1,
0
] |
Linux Kernel | sound/core/pcm_local.h |
static inline snd_pcm_uframes_t
snd_pcm_hw_avail(struct snd_pcm_substream *substream) {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
return snd_pcm_playback_hw_avail(substream->runtime);
else
return snd_pcm_capture_hw_avail(substream->runtime);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_local.h | static inline void
snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) {} | [
0,
0
] |
Linux Kernel | sound/core/pcm_memory.c |
static void do_free_pages(struct snd_card *card, struct snd_dma_buffer *dmab) {
if (!dmab->area)
return;
mutex_lock(&card->memory_mutex);
WARN_ON(card->total_pcm_alloc_bytes < dmab->bytes);
card->total_pcm_alloc_bytes -= dmab->bytes;
mutex_unlock(&card->memory_mutex);
snd_dma_free_pages(dmab);
dmab->... | [
0,
0
] |
Linux Kernel | sound/core/pcm_memory.c | void snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) {
do_free_pages(substream->pcm->card, &substream->dma_buffer);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_memory.c | int snd_pcm_set_managed_buffer_all(struct snd_pcm *pcm, int type,
struct device *data, size_t size,
size_t max) {
return preallocate_pages_for_all(pcm, type, data, size, max, true);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_misc.c | int snd_pcm_format_little_endian(snd_pcm_format_t format) {
int val;
if (!valid_format(format))
return -EINVAL;
val = pcm_formats[(INT)format].le;
if (val < 0)
return -EINVAL;
return val;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_misc.c | int snd_pcm_format_physical_width(snd_pcm_format_t format) {
int val;
if (!valid_format(format))
return -EINVAL;
val = pcm_formats[(INT)format].phys;
if (!val)
return -EINVAL;
return val;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_misc.c | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format) {
if (!valid_format(format))
return NULL;
if (!pcm_formats[(INT)format].phys)
return NULL;
return pcm_formats[(INT)format].silence;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_misc.c | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data,
unsigned int samples) {
int width;
unsigned char *dst;
const unsigned char *pat;
if (!valid_format(format))
return -EINVAL;
if (samples == 0)
return 0;
width = pcm_formats[(INT)format].phys;
pat = p... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_ops_ioctl(struct snd_pcm_substream *substream, unsigned cmd,
void *arg) {
if (substream->ops->ioctl)
return substream->ops->ioctl(substream, cmd, arg);
else
return snd_pcm_lib_ioctl(substream, cmd, arg);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
int snd_pcm_info(struct snd_pcm_substream *substream,
struct snd_pcm_info *info) {
struct snd_pcm *pcm = substream->pcm;
struct snd_pcm_str *pstr = substream->pstr;
memset(info, 0, sizeof(*info));
info->card = pcm->card->number;
info->device = pcm->device;
info->stream = substream->stream... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | int snd_pcm_info_user(struct snd_pcm_substream *substream,
struct snd_pcm_info __user *_info) {
struct snd_pcm_info *info;
int err;
info = kmalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
err = snd_pcm_info(substream, info);
if (err >= 0) {
if (copy_to_user(_info... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static void snd_pcm_set_state(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
snd_pcm_stream_lock_irq(substream);
if (substream->runtime->state != SNDRV_PCM_STATE_DISCONNECTED)
__snd_pcm_set_state(substream->runtime, state);
snd_pcm_stream_unlock_irq(substream);
} | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
void snd_pcm_sync_stop(struct snd_pcm_substream *substream, bool sync_irq) {
if (substream->runtime && substream->runtime->stop_operating) {
substream->runtime->stop_operating = false;
if (substream->ops && substream->ops->sync_stop)
substream->ops->sync_stop(substream);
else if (sync_irq && substr... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm,
struct snd_pcm_hw_params *params) {
static const int vars[] = {SNDRV_PCM_HW_PARAM_ACCESS,
SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_SUBFORMAT,
... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int snd_pcm_hw_free(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime;
int result = 0;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
runtime = substream->runtime;
result = snd_pcm_buffer_access_lock(runtime);
if (result < 0)
return result;
snd_pcm_stream_lock_irq(s... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static inline snd_pcm_uframes_t
snd_pcm_calc_delay(struct snd_pcm_substream *substream) {
snd_pcm_uframes_t delay;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
delay = snd_pcm_playback_hw_avail(substream->runtime);
else
delay = snd_pcm_capture_avail(substream->runtime);
return delay + substream... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int
snd_pcm_channel_info_user(struct snd_pcm_substream *substream,
struct snd_pcm_channel_info __user *_info) {
struct snd_pcm_channel_info info;
int res;
if (copy_from_user(&info, _info, sizeof(info)))
return -EFAULT;
res = snd_pcm_channel_info(substream, &info);
if (re... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.