Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/spi/at73c213.c
static int snd_at73c213_stereo_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_at73c213 *chip = snd_kcontrol_chip(kcontrol); int left_reg = kcontrol->private_value & 0xff; int right_reg = (kcontrol->private_value >> 8) & 0xff; int shift_le...
[ 1, 0 ]
Linux Kernel
sound/spi/at73c213.c
static int snd_at73c213_mono_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_at73c213 *chip = snd_kcontrol_chip(kcontrol); int reg = kcontrol->private_value & 0xff; int shift = (kcontrol->private_value >> 8) & 0xff; int mask = ...
[ 1, 0 ]
Linux Kernel
sound/spi/at73c213.c
static int snd_at73c213_line_capture_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 = 14; uinfo->value.integer.max = 31; return 0; }
[ 0, 0 ]
Linux Kernel
sound/spi/at73c213.c
static int snd_at73c213_ssc_init(struct snd_at73c213 *chip) { ssc_writel(chip->ssc->regs, TCMR, SSC_BF(TCMR_CKO, 1) | SSC_BF(TCMR_START, 4) | SSC_BF(TCMR_STTDLY, 1) | SSC_BF(TCMR_PERIOD, 16 - 1)); /* * Data length is 16 bit (16 - 1). * Transmit MSB first. * Transmit 2 words e...
[ 0, 0 ]
Linux Kernel
sound/spi/at73c213.c
static int snd_at73c213_resume(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct snd_at73c213 *chip = card->private_data; int retval; retval = clk_enable(chip->board->dac_clk); if (retval) return retval; retval = clk_enable(chip->ssc->clk); if (retval) { clk_disable(chip...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux.c
int snd_emux_new(struct snd_emux **remu) { struct snd_emux *emu; *remu = NULL; emu = kzalloc(sizeof(*emu), GFP_KERNEL); if (emu == NULL) return -ENOMEM; spin_lock_init(&emu->voice_lock); mutex_init(&emu->register_mutex); emu->client = -1; #if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) emu->oss_synth = ...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux.c
static int sf_sample_new(void *private_data, struct snd_sf_sample *sp, struct snd_util_memhdr *hdr, const void __user *buf, long count) { struct snd_emux *emu = private_data; return emu->ops.sample_new(emu, sp, hdr, buf, count); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_effect.c
static int effect_get_offset(struct snd_midi_channel *chan, int lo, int hi, int mode) { int addr = 0; struct snd_emux_effect_table *fx = chan->private; if (fx->flag[hi]) addr = (short)fx->val[hi]; addr = addr << 15; if (fx->flag[lo]) addr += (short)fx->val[lo]; if (!(mo...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_effect.c
void snd_emux_create_effect(struct snd_emux_port *p) { int i; p->effect = kcalloc(p->chset.max_channels, sizeof(struct snd_emux_effect_table), GFP_KERNEL); if (p->effect) { for (i = 0; i < p->chset.max_channels; i++) p->chset.channels[i].private = p->effect + i; } else { for ...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/emux_hwdep.c
int snd_emux_init_hwdep(struct snd_emux *emu) { struct snd_hwdep *hw; int err; err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw); if (err < 0) return err; emu->hwdep = hw; strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME); hw->iface = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE; hw->ops.ioctl =...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/emux_hwdep.c
void snd_emux_delete_hwdep(struct snd_emux *emu) { if (emu->hwdep) { snd_device_free(emu->card, emu->hwdep); emu->hwdep = NULL; } }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_nrpn.c
static int fx_attack(int val) { return (unsigned short)snd_sf_calc_parm_attack(val); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_nrpn.c
static int gs_filterQ(int val) { return (val - 64) * gs_sense[FX_RESONANCE] / 50; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_nrpn.c
static int gs_vib_rate(int val) { return (val - 64) * gs_sense[FX_VIBRATE] / 50; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_nrpn.c
void snd_emux_nrpn(void *p, struct snd_midi_channel *chan, struct snd_midi_channel_set *chset) { struct snd_emux_port *port; port = p; if (snd_BUG_ON(!port || !chan)) return; if (chan->control[MIDI_CTL_NONREG_PARM_NUM_MSB] == 127 && chan->control[MIDI_CTL_NONREG_PARM_NUM_LSB] <= 2...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_nrpn.c
static int xg_attack(int val) { return -(val - 64) * xg_sense[FX_ATTACK] / 64; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_oss.c
static int snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg) { struct snd_emux_port *p; if (snd_BUG_ON(!arg)) return -ENXIO; p = arg->private_data; if (snd_BUG_ON(!p)) return -ENXIO; snd_emux_reset_port(p); return 0; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_oss.c
static int snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop) { struct snd_emux *emu; struct snd_emux_port *p; unsigned char cmd, *data; p = private_data; if (snd_BUG_ON(!p)) return -EINVAL; emu = p->emu; if (snd...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_oss.c
static void gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd, unsigned char *event, int atomic, int hop) { int voice; unsigned short p1; int plong; struct snd_midi_channel *chan; if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_S...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/emux_oss.c
static void fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop) { struct snd_seq_event ev; memset(&ev, 0, sizeof(ev)); ev.type = SNDRV_SEQ_EVENT_CONTROLLER; ev.data.control.channel = ch; ev.data.control.param = param; ev.data.c...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/emux_seq.c
void snd_emux_detach_seq(struct snd_emux *emu) { if (emu->voices) snd_emux_terminate_all(emu); if (emu->client >= 0) { snd_seq_delete_kernel_client(emu->client); emu->client = -1; } }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_seq.c
struct snd_emux_port * snd_emux_create_port(struct snd_emux *emu, char *name, int max_channels, int oss_port, struct snd_seq_port_callback *callback) { struct snd_emux_port *p; int i, type, cap; p = kzalloc(sizeof(*p), GFP_KERNEL); if (!p) return NULL; p->chset.channels = kcal...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/emux_seq.c
static void snd_emux_init_port(struct snd_emux_port *p) { p->drum_flags = DEFAULT_DRUM_FLAGS; p->volume_atten = 0; snd_emux_reset_port(p); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_seq.c
int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop) { struct snd_emux_port *port; port = private_data; if (snd_BUG_ON(!port || !ev)) return -EINVAL; snd_midi_process_event(&emux_ops, ev, &port->chset); return 0; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_seq.c
int snd_emux_inc_count(struct snd_emux *emu) { int ret; mutex_lock(&emu->register_mutex); ret = __snd_emux_inc_count(emu); mutex_unlock(&emu->register_mutex); return ret; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_synth.c
void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan) { struct snd_emux *emu; struct snd_emux_port *port; port = p; if (snd_BUG_ON(!port || !chan)) return; emu = port->emu; if (snd_BUG_ON(!emu || !emu->ops.terminate)) return; terminate_note1(emu, note, chan, 1); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_synth.c
void snd_emux_sounds_off_all(struct snd_emux_port *port) { int i; struct snd_emux *emu; struct snd_emux_voice *vp; unsigned long flags; if (snd_BUG_ON(!port)) return; emu = port->emu; if (snd_BUG_ON(!emu || !emu->ops.terminate)) return; spin_lock_irqsave(&emu->voice_lock, flags); for (i = 0;...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/emux_synth.c
static void terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free) { emu->ops.terminate(vp); vp->time = emu->use_time++; vp->chan = NULL; vp->port = NULL; vp->zone = NULL; vp->block = NULL; vp->state = SNDRV_EMUX_ST_OFF; if (free && emu->ops.free_voice) ...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/emux_synth.c
static int calc_pitch(struct snd_emux_voice *vp) { struct snd_midi_channel *chan = vp->chan; int offset; if (vp->reg.fixkey >= 0) { offset = (vp->reg.fixkey - vp->reg.root) * 4096 / 12; } else { offset = (vp->note - vp->reg.root) * 4096 / 12; } offset = (offset * vp->reg.scaleTuning) / 100; offse...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/emux_synth.c
void snd_emux_init_voices(struct snd_emux *emu) { struct snd_emux_voice *vp; int i; unsigned long flags; spin_lock_irqsave(&emu->voice_lock, flags); for (i = 0; i < emu->max_voices; i++) { vp = &emu->voices[i]; vp->ch = -1; vp->state = SNDRV_EMUX_ST_OFF; vp->chan = NULL; vp->port = NULL; ...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static void unlock_preset(struct snd_sf_list *sflist) { unsigned long flags; spin_lock_irqsave(&sflist->lock, flags); sflist->presets_locked = 0; spin_unlock_irqrestore(&sflist->lock, flags); mutex_unlock(&sflist->presets_mutex); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
int snd_soundfont_close_check(struct snd_sf_list *sflist, int client) { unsigned long flags; spin_lock_irqsave(&sflist->lock, flags); if (sflist->open_client == client) { spin_unlock_irqrestore(&sflist->lock, flags); return close_patch(sflist); } spin_unlock_irqrestore(&sflist->lock, flags); return ...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static inline int is_special_type(int type) { type &= 0x0f; return (type == SNDRV_SFNT_PAT_TYPE_GUS || type == SNDRV_SFNT_PAT_TYPE_MAP); }
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static struct snd_soundfont *newsf(struct snd_sf_list *sflist, int type, char *name) { struct snd_soundfont *sf; if (type & SNDRV_SFNT_PAT_SHARED) { for (sf = sflist->fonts; sf; sf = sf->next) { if (is_identical_font(sf, type, name)) { return sf; } } ...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name) { return ( (sf->type & SNDRV_SFNT_PAT_SHARED) && (sf->type & 0x0f) == (type & 0x0f) && (name == NULL || memcmp(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN) == 0)); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static int close_patch(struct snd_sf_list *sflist) { unsigned long flags; spin_lock_irqsave(&sflist->lock, flags); sflist->currsf = NULL; sflist->open_client = -1; spin_unlock_irqrestore(&sflist->lock, flags); rebuild_presets(sflist); return 0; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static int probe_data(struct snd_sf_list *sflist, int sample_id) { if (sflist->currsf) { /* search the specified sample by optarg */ if (find_sample(sflist->currsf, sample_id)) return 0; } return -EINVAL; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static void set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, struct snd_sf_zone *zp) { zp->counter = sflist->zone_counter++; if (sf->type & SNDRV_SFNT_PAT_LOCKED) sflist->zone_locked = sflist->zone_counter; }
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static void set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, struct snd_sf_sample *sp) { sp->counter = sflist->sample_counter++; if (sf->type & SNDRV_SFNT_PAT_LOCKED) sflist->sample_locked = sflist->sample_counter; }
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static void sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf, struct snd_sf_sample *sp) { if (sp == sf->samples) { sf->samples = sp->next; kfree(sp); } }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio) { int v; int s, low, bit; if (amount < 2) return 0; for (bit = 0; !(amount & 0x80000000L); bit++) amount <<= 1; s = (amount >> 24) & 0x7f; low = (amount >> 16) & 0xff; v = (log_tbl[s + 1] * low + log_tbl[s] * (0x100 - low)) >> ...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static int calc_rate_offset(int hz) { return snd_sf_linear_to_log(hz, OFFSET_SAMPLERATE, SAMPLERATE_RATIO); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static int calc_gus_envelope_time(int rate, int start, int end) { int r, p, t; r = (3 - ((rate >> 6) & 3)) * 3; p = rate & 0x3f; if (!p) p = 1; t = end - start; if (t < 0) t = -t; if (13 > r) t = t << (13 - r); else t = t >> (r - 13); return (t * 10) / (p * 441); }
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
int snd_sf_calc_parm_attack(int msec) { return calc_parm_search(msec, attack_time_tbl); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
int snd_sf_calc_parm_decay(int msec) { return calc_parm_search(msec, decay_time_tbl); }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static void add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur) { struct snd_sf_zone *zone; int index; zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low); if (zone && zone->v.sf_id != cur->v.sf_id) { struct snd_sf_zone *p; /* compare the allocated time */ for (p = zone...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static void delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp) { int index; struct snd_sf_zone *p; index = get_index(zp->bank, zp->instr, zp->v.low); if (index < 0) return; for (p = sflist->presets[index]; p; p = p->next_instr) { while (p->next_instr == zp) { p->next_instr = zp->...
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel, int preset, int bank, int def_preset, int def_bank, struct snd_sf_zone **table, int max_layers) { int nvoices; unsigned long flags; spin_lock_ir...
[ 1, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
static int get_index(int bank, int instr, int key) { int index; if (SF_IS_DRUM_BANK(bank)) index = key + SF_MAX_INSTRUMENTS; else index = instr; index = index % SF_MAX_PRESETS; if (index < 0) return -1; return index; }
[ 0, 0 ]
Linux Kernel
sound/synth/emux/soundfont.c
void snd_sf_free(struct snd_sf_list *sflist) { if (sflist == NULL) return; lock_preset(sflist); if (sflist->callback.sample_reset) sflist->callback.sample_reset(sflist->callback.private_data); snd_sf_clear(sflist); unlock_preset(sflist); kfree(sflist); }
[ 0, 0 ]
Linux Kernel
sound/synth/util_mem.c
struct snd_util_memblk *__snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size) { struct snd_util_memblk *blk; unsigned int units, prev_offset; struct list_head *p; if (snd_BUG_ON(!hdr || size <= 0)) return NULL; units = size; if (units & 1) units++...
[ 1, 0 ]
Linux Kernel
sound/synth/util_mem.c
struct snd_util_memblk *__snd_util_memblk_new(struct snd_util_memhdr *hdr, unsigned int units, struct list_head *prev) { struct snd_util_memblk *blk; blk = kmalloc(sizeof(struct snd_util_memblk) + hdr->block_extra_size, ...
[ 1, 0 ]
Linux Kernel
sound/synth/util_mem.c
struct snd_util_memblk *snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size) { struct snd_util_memblk *blk; mutex_lock(&hdr->block_mutex); blk = __snd_util_mem_alloc(hdr, size); mutex_unlock(&hdr->block_mutex); return blk; }
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/comm.c
static void usb6fire_comm_receiver_handler(struct urb *urb) { struct comm_runtime *rt = urb->context; struct midi_runtime *midi_rt = rt->chip->midi; if (!urb->status) { if (rt->receiver_buffer[0] == 0x10) if (midi_rt) midi_rt->in_received(midi_rt, rt->receiver_buffer + 2, ...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/comm.c
static int usb6fire_comm_write8(struct comm_runtime *rt, u8 request, u8 reg, u8 value) { u8 *buffer; int ret; buffer = kmalloc(13, GFP_KERNEL); if (!buffer) return -ENOMEM; usb6fire_comm_init_buffer(buffer, 0x00, request, reg, value, 0x00); ret = usb6fire_comm_send_buff...
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/comm.c
static int usb6fire_comm_write16(struct comm_runtime *rt, u8 request, u8 reg, u8 vl, u8 vh) { u8 *buffer; int ret; buffer = kmalloc(13, GFP_KERNEL); if (!buffer) return -ENOMEM; usb6fire_comm_init_buffer(buffer, 0x00, request, reg, vl, vh); ret = usb6fire_comm_send_buf...
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/control.c
static int usb6fire_control_set_channels(struct control_runtime *rt, int n_analog_out, int n_analog_in, bool spdif_out, bool spdif_in) { int ret; struct comm_runtime *comm_rt = rt->chip->comm; ret = comm_rt->write16(comm_rt, 0x02, ...
[ 1, 1 ]
Linux Kernel
sound/usb/6fire/control.c
static int usb6fire_control_output_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct control_runtime *rt = snd_kcontrol_chip(kcontrol); unsigned int ch = kcontrol->private_value; if (ch > 4) { dev_err(&rt->chip->dev->dev, "Invalid channel in...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/control.c
static int usb6fire_control_output_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct control_runtime *rt = snd_kcontrol_chip(kcontrol); unsigned int ch = kcontrol->private_value; u8 old = rt->output_mute; u8 value = 0; if (ch > 4) { de...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/control.c
static int usb6fire_control_output_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct control_runtime *rt = snd_kcontrol_chip(kcontrol); unsigned int ch = kcontrol->private_value; u8 value = rt->output_mute >> ch; if (ch > 4) { dev_err(&r...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/control.c
static int usb6fire_control_input_vol_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 = 30; return 0; }
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/control.c
static int usb6fire_control_input_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct control_runtime *rt = snd_kcontrol_chip(kcontrol); int changed = 0; if (rt->input_vol[0] != ucontrol->value.integer.value[0]) { rt->input_vol[0] = ...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/control.c
static int usb6fire_control_line_phono_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct control_runtime *rt = snd_kcontrol_chip(kcontrol); int changed = 0; if (rt->line_phono_switch != ucontrol->value.integer.value[0]) { rt->line_phono_switch = ...
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/firmware.c
static int usb6fire_fw_ihex_init(const struct firmware *fw, struct ihex_record *record) { record->txt_data = fw->data; record->txt_length = fw->size; record->txt_offset = 0; record->max_len = 0; while (usb6fire_fw_ihex_next_record(record)) record->max_len = max(record->le...
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/firmware.c
static int usb6fire_fw_ezusb_write(struct usb_device *device, int type, int value, char *data, int len) { return usb_control_msg_send(device, 0, type, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value, 0, data, len, ...
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/midi.c
static int usb6fire_midi_out_close(struct snd_rawmidi_substream *alsa_sub) { return 0; }
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/midi.c
static void usb6fire_midi_out_trigger(struct snd_rawmidi_substream *alsa_sub, int up) { struct midi_runtime *rt = alsa_sub->rmidi->private_data; struct urb *urb = &rt->out_urb; __s8 ret; unsigned long flags; spin_lock_irqsave(&rt->out_lock, flags); if (up) { if (rt...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/midi.c
void usb6fire_midi_abort(struct sfire_chip *chip) { struct midi_runtime *rt = chip->midi; if (rt) usb_poison_urb(&rt->out_urb); }
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/pcm.c
static int usb6fire_pcm_set_rate(struct pcm_runtime *rt) { int ret; struct control_runtime *ctrl_rt = rt->chip->control; ctrl_rt->usb_streaming = false; ret = ctrl_rt->update_streaming(ctrl_rt); if (ret < 0) { dev_err(&rt->chip->dev->dev, "error stopping streaming while setting samplerate %d...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/pcm.c
static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub) { struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub); struct pcm_substream *sub = NULL; struct snd_pcm_runtime *alsa_rt = alsa_sub->runtime; if (rt->panic) return -EPIPE; mutex_lock(&rt->stream_mutex); alsa_rt->hw = pcm_hw; if...
[ 0, 0 ]
Linux Kernel
sound/usb/6fire/pcm.c
int usb6fire_pcm_init(struct sfire_chip *chip) { int i; int ret; struct snd_pcm *pcm; struct pcm_runtime *rt = kzalloc(sizeof(struct pcm_runtime), GFP_KERNEL); if (!rt) return -ENOMEM; ret = usb6fire_pcm_buffers_init(rt); if (ret) { usb6fire_pcm_buffers_destroy(rt); kfree(rt); return re...
[ 1, 0 ]
Linux Kernel
sound/usb/6fire/pcm.c
void usb6fire_pcm_destroy(struct sfire_chip *chip) { struct pcm_runtime *rt = chip->pcm; usb6fire_pcm_buffers_destroy(rt); kfree(rt); chip->pcm = NULL; }
[ 0, 0 ]
Linux Kernel
sound/usb/bcd2000/bcd2000.c
static void bcd2000_dump_buffer(const char *prefix, const char *buf, int len) {} #endif
[ 0, 0 ]
Linux Kernel
sound/usb/bcd2000/bcd2000.c
static void bcd2000_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) { struct bcd2000 *bcd2k = substream->rmidi->private_data; bcd2k->midi_receive_substream = up ? substream : NULL; }
[ 1, 0 ]
Linux Kernel
sound/usb/bcd2000/bcd2000.c
static int bcd2000_midi_output_close(struct snd_rawmidi_substream *substream) { struct bcd2000 *bcd2k = substream->rmidi->private_data; if (bcd2k->midi_out_active) { usb_kill_urb(bcd2k->midi_out_urb); bcd2k->midi_out_active = 0; } return 0; }
[ 1, 0 ]
Linux Kernel
sound/usb/bcd2000/bcd2000.c
static void bcd2000_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) { struct bcd2000 *bcd2k = substream->rmidi->private_data; if (up) { bcd2k->midi_out_substream = substream; if (!bcd2k->midi_out_active) bcd2000_midi_send(bcd2k); } else ...
[ 1, 0 ]
Linux Kernel
sound/usb/bcd2000/bcd2000.c
static void bcd2000_output_complete(struct urb *urb) { struct bcd2000 *bcd2k = urb->context; bcd2k->midi_out_active = 0; if (urb->status) dev_warn(&urb->dev->dev, PREFIX "output urb->status: %d\n", urb->status); if (urb->status == -ESHUTDOWN) return; bcd2000_midi_send(bcd2k); }
[ 0, 0 ]
Linux Kernel
sound/usb/bcd2000/bcd2000.c
static void bcd2000_init_device(struct bcd2000 *bcd2k) { int ret; init_usb_anchor(&bcd2k->anchor); usb_anchor_urb(bcd2k->midi_out_urb, &bcd2k->anchor); usb_anchor_urb(bcd2k->midi_in_urb, &bcd2k->anchor); memcpy(bcd2k->midi_out_buf, bcd2000_init_sequence, 52); bcd2k->midi_out_urb->transfer_buffer_length = ...
[ 1, 0 ]
Linux Kernel
sound/usb/bcd2000/bcd2000.c
static void bcd2000_disconnect(struct usb_interface *interface) { struct bcd2000 *bcd2k = usb_get_intfdata(interface); if (!bcd2k) return; mutex_lock(&devices_mutex); snd_card_disconnect(bcd2k->card); bcd2000_free_usb_related_resources(bcd2k, interface); clear_bit(bcd2k->card_index, devices_used); ...
[ 0, 0 ]
Linux Kernel
sound/usb/caiaq/audio.c
static void activate_substream(struct snd_usb_caiaqdev *cdev, struct snd_pcm_substream *sub) { spin_lock(&cdev->spinlock); if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) cdev->sub_playback[sub->number] = sub; else cdev->sub_capture[sub->number] = sub; spin_unlock(&cdev->...
[ 0, 0 ]
Linux Kernel
sound/usb/caiaq/audio.c
static int all_substreams_zero(struct snd_pcm_substream **subs) { int i; for (i = 0; i < MAX_STREAMS; i++) if (subs[i] != NULL) return 0; return 1; }
[ 0, 0 ]
Linux Kernel
sound/usb/caiaq/audio.c
static void read_in_urb_mode2(struct snd_usb_caiaqdev *cdev, const struct urb *urb, const struct usb_iso_packet_descriptor *iso) { unsigned char *usb_buf = urb->transfer_buffer + iso->offset; unsigned char check_byte; struct snd_pcm_substream *sub; in...
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/audio.c
static void fill_out_urb_mode_3(struct snd_usb_caiaqdev *cdev, struct urb *urb, const struct usb_iso_packet_descriptor *iso) { unsigned char *usb_buf = urb->transfer_buffer + iso->offset; int stream, i; for (i = 0; i < iso->length;) { for (stream = 0; stream < cdev->n_streams;...
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/audio.c
static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) { int i, frame; struct urb **urbs; struct usb_device *usb_dev = cdev->chip.dev; unsigned int pipe; pipe = (dir == SNDRV_PCM_STREAM_PLAYBACK) ? usb_sndisocpipe(usb_dev, ENDPOINT_PLAYBA...
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/audio.c
void snd_usb_caiaq_audio_free(struct snd_usb_caiaqdev *cdev) { struct device *dev = caiaqdev_to_dev(cdev); dev_dbg(dev, "%s(%p)\n", __func__, cdev); stream_stop(cdev); free_urbs(cdev->data_urbs_in); free_urbs(cdev->data_urbs_out); kfree(cdev->data_cb_info); }
[ 0, 0 ]
Linux Kernel
sound/usb/caiaq/control.c
static int control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol); struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); int pos = kcontrol->private_value; if (pos & CNT_INTVAL) ucontrol->value.integ...
[ 0, 0 ]
Linux Kernel
sound/usb/caiaq/device.c
int snd_usb_caiaq_set_auto_msg(struct snd_usb_caiaqdev *cdev, int digital, int analog, int erp) { char tmp[3] = {digital, analog, erp}; return snd_usb_caiaq_send_command(cdev, EP1_CMD_AUTO_MSG, tmp, sizeof(tmp)); }
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/device.c
static int create_card(struct usb_device *usb_dev, struct usb_interface *intf, struct snd_card **cardp) { int devnum; int err; struct snd_card *card; struct snd_usb_caiaqdev *cdev; for (devnum = 0; devnum < SNDRV_CARDS; devnum++) if (enable[devnum]) break; if (devnum >= S...
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/input.c
static void snd_usb_caiaq_ep4_reply_dispatch(struct urb *urb) { struct snd_usb_caiaqdev *cdev = urb->context; unsigned char *buf = urb->transfer_buffer; struct device *dev = &urb->dev->dev; int ret; if (urb->status || !cdev || urb != cdev->ep4_in_urb) return; switch (cdev->chip.usb_id) { case USB_I...
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/input.c
static void snd_usb_caiaq_input_close(struct input_dev *idev) { struct snd_usb_caiaqdev *cdev = input_get_drvdata(idev); if (!cdev) return; switch (cdev->chip.usb_id) { case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1): case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4): ...
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/midi.c
static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *cdev, struct snd_rawmidi_substream *substream) { int len, ret; struct device *dev = caiaqdev_to_dev(cdev); cdev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; cdev->midi_out_buf[1] = 0; len = snd_rawmidi_transmit(s...
[ 0, 0 ]
Linux Kernel
sound/usb/caiaq/midi.c
static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) { struct snd_usb_caiaqdev *cdev = substream->rmidi->private_data; if (up) { cdev->midi_out_substream = substream; if (!cdev->midi_out_active) snd_usb_caiaq_midi_send(cdev,...
[ 1, 0 ]
Linux Kernel
sound/usb/caiaq/midi.c
void snd_usb_caiaq_midi_handle_input(struct snd_usb_caiaqdev *cdev, int port, const char *buf, int len) { if (!cdev->midi_receive_substream) return; snd_rawmidi_receive(cdev->midi_receive_substream, buf, len); }
[ 0, 0 ]
Linux Kernel
sound/usb/card.c
static bool get_alias_id(struct usb_device *dev, unsigned int *id) { int i; unsigned int src, dst; for (i = 0; i < ARRAY_SIZE(quirk_alias); i++) { if (!quirk_alias[i] || sscanf(quirk_alias[i], "%x:%x", &src, &dst) != 2 || src != *id) continue; dev_info(&dev->dev, "device (%04x:%04x): applyi...
[ 1, 0 ]
Linux Kernel
sound/usb/card.c
static void find_last_interface(struct snd_usb_audio *chip) { struct usb_host_config *config = chip->dev->actconfig; struct usb_interface *intf; int i; if (!config) return; for (i = 0; i < config->desc.bNumInterfaces; i++) { intf = config->interface[i]; if (usb_match_id(intf, usb_audio_ids)) ...
[ 1, 0 ]
Linux Kernel
sound/usb/card.c
static const struct snd_usb_audio_quirk *get_alias_quirk(struct usb_device *dev, unsigned int id) { const struct usb_device_id *p; for (p = usb_audio_ids; p->match_flags; p++) { /* FIXME: this checks only vendor:product pair in the list */ if ((p->ma...
[ 0, 1 ]
Linux Kernel
sound/usb/card.c
int snd_usb_autoresume(struct snd_usb_audio *chip) { int i, err; if (atomic_read(&chip->shutdown)) return -EIO; if (atomic_inc_return(&chip->active) != 1) return 0; for (i = 0; i < chip->num_interfaces; i++) { err = usb_autopm_get_interface(chip->intf[i]); if (err < 0) { while (--i >= 0...
[ 0, 0 ]
Linux Kernel
sound/usb/clock.c
int snd_usb_set_sample_rate_v2v3(struct snd_usb_audio *chip, const struct audioformat *fmt, int clock, int rate) { bool writeable; u32 bmControls; __le32 data; int err; union uac23_clock_source_desc *cs_desc; cs_desc = snd_usb_find_clock_sou...
[ 1, 0 ]
Linux Kernel
sound/usb/clock.c
int snd_usb_init_sample_rate(struct snd_usb_audio *chip, const struct audioformat *fmt, int rate) { usb_audio_dbg(chip, "%d:%d Set sample rate %d, clock %d\n", fmt->iface, fmt->altsetting, rate, fmt->clock); switch (fmt->protocol) { case UAC_VERSION_1: default: ...
[ 0, 0 ]
Linux Kernel
sound/usb/endpoint.c
static void release_urb_ctx(struct snd_urb_ctx *u) { if (u->urb && u->buffer_size) usb_free_coherent(u->ep->chip->dev, u->buffer_size, u->urb->transfer_buffer, u->urb->transfer_dma); usb_free_urb(u->urb); u->urb = NULL; u->buffer_size = 0; }
[ 1, 0 ]