Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/firewire/bebob/bebob.c |
static const struct snd_bebob_spec *get_saffire_spec(struct fw_unit *unit) {
char name[24] = {0};
if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0)
return NULL;
if (strcmp(name, "SaffireLE") == 0)
return &saffire_le_spec;
else
return &saffire_spec;
} | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob.c | static void bebob_remove(struct fw_unit *unit) {
struct snd_bebob *bebob = dev_get_drvdata(&unit->device);
if (bebob == NULL)
return;
snd_card_free(bebob->card);
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob.c |
static void __exit snd_bebob_exit(void) {
driver_unregister(&bebob_driver.driver);
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_command.c | int avc_audio_set_selector(struct fw_unit *unit, unsigned int subunit_id,
unsigned int fb_id, unsigned int num) {
u8 *buf;
int err;
buf = kzalloc(12, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
buf[0] = 0x00;
buf[1] = 0x08 | (0x07 & subunit_id); /* AUDIO SUBUNIT ID */
bu... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_command.c | static inline void
avc_bridgeco_fill_plug_info_extension_command(u8 *buf, u8 *addr,
unsigned int itype) {
buf[0] = 0x01;
buf[2] = 0x02; /* AV/C GENERAL PLUG INFO */
buf[3] = 0xc0; /* BridgeCo extension */
avc_bridgeco_fill_extension_addr(buf, addr);
buf[9] = itype... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_command.c | int avc_bridgeco_get_plug_ch_count(struct fw_unit *unit,
u8 addr[AVC_BRIDGECO_ADDR_BYTES],
unsigned int *ch_count) {
u8 *buf;
int err;
buf = kzalloc(12, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
avc_bridgeco_fill_plug_info_extensi... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_command.c | int avc_bridgeco_get_plug_section_type(struct fw_unit *unit,
u8 addr[AVC_BRIDGECO_ADDR_BYTES],
unsigned int id, u8 *type) {
u8 *buf;
int err;
buf = kzalloc(12, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
/* Info type is 'sec... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_command.c | int avc_bridgeco_get_plug_strm_fmt(struct fw_unit *unit,
u8 addr[AVC_BRIDGECO_ADDR_BYTES], u8 *buf,
unsigned int *len, unsigned int eid) {
int err;
if ((buf == NULL) || (*len < 12)) {
err = -EINVAL;
goto end;
}
buf[0] = 0x01; /* AV/... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_focusrite.c |
static inline int saffire_read_block(struct snd_bebob *bebob, u64 offset,
u32 *buf, unsigned int size) {
unsigned int i;
int err;
__be32 *tmp = (__be32 *)buf;
err = snd_fw_transaction(bebob->unit, TCODE_READ_BLOCK_REQUEST,
SAFFIRE_ADDRESS_BASE + ... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_focusrite.c |
static inline int saffire_read_quad(struct snd_bebob *bebob, u64 offset,
u32 *value) {
int err;
__be32 tmp;
err = snd_fw_transaction(bebob->unit, TCODE_READ_QUADLET_REQUEST,
SAFFIRE_ADDRESS_BASE + offset, &tmp, sizeof(__be32),
... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_focusrite.c | static int saffirepro_both_clk_src_get(struct snd_bebob *bebob,
unsigned int *id) {
int err;
u32 value;
const signed char *map;
err = saffire_read_quad(bebob, SAFFIREPRO_OFFSET_CLOCK_SOURCE, &value);
if (err < 0)
goto end;
/* depending on hardware, use a differen... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_hwdep.c |
static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
loff_t *offset) {
struct snd_bebob *bebob = hwdep->private_data;
DEFINE_WAIT(wait);
union snd_firewire_event event;
spin_lock_irq(&bebob->lock);
while (!bebob->dev_lock_changed) {
prepare_to_wait(&bebob... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_hwdep.c |
static int hwdep_get_info(struct snd_bebob *bebob, void __user *arg) {
struct fw_device *dev = fw_parent_device(bebob->unit);
struct snd_firewire_get_info info;
memset(&info, 0, sizeof(info));
info.type = SNDRV_FIREWIRE_TYPE_BEBOB;
info.card = dev->card->index;
*(__be32 *)&info.guid[0] = cpu_to_be32(dev->... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_maudio.c | int snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814) {
struct special_params *params;
int err;
params = devm_kzalloc(&bebob->card->card_dev, sizeof(struct special_params),
GFP_KERNEL);
if (!params)
return -ENOMEM;
mutex_lock(&bebob->mutex);
bebob->maudio... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_maudio.c | static int special_clk_get(struct snd_bebob *bebob, unsigned int *id) {
struct special_params *params = bebob->maudio_special_quirk;
*id = params->clk_src;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_maudio.c | static int special_clk_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uval) {
struct snd_bebob *bebob = snd_kcontrol_chip(kctl);
struct special_params *params = bebob->maudio_special_quirk;
uval->value.enumerated.item[0] = params->clk_src;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_maudio.c | static int special_sync_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uval) {
struct snd_bebob *bebob = snd_kcontrol_chip(kctl);
int err;
bool synced = 0;
err = check_clk_sync(bebob, METER_SIZE_SPECIAL, &synced);
if (err >= 0)
uval->value.integer.value[0] =... | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_maudio.c | static int special_dig_in_iface_ctl_set(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uval) {
struct snd_bebob *bebob = snd_kcontrol_chip(kctl);
struct special_params *params = bebob->maudio_special_quirk;
unsigned int id, dig_in_fmt, dig_in_iface;
int err;
id ... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_maudio.c | static int special_meter_get(struct snd_bebob *bebob, u32 *target,
unsigned int size) {
__be16 *buf;
unsigned int i, c, channels;
int err;
channels = ARRAY_SIZE(special_meter_labels) * 2;
if (size < channels * sizeof(u32))
return -EINVAL;
buf = kmalloc(METER_SIZE_SPECIAL -... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_midi.c |
static int midi_open(struct snd_rawmidi_substream *substream) {
struct snd_bebob *bebob = substream->rmidi->private_data;
int err;
err = snd_bebob_stream_lock_try(bebob);
if (err < 0)
return err;
mutex_lock(&bebob->mutex);
err = snd_bebob_stream_reserve_duplex(bebob, 0, 0, 0);
if (err >= 0) {
+... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_midi.c |
static int midi_close(struct snd_rawmidi_substream *substream) {
struct snd_bebob *bebob = substream->rmidi->private_data;
mutex_lock(&bebob->mutex);
bebob->substreams_counter--;
snd_bebob_stream_stop_duplex(bebob);
mutex_unlock(&bebob->mutex);
snd_bebob_stream_lock_release(bebob);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_midi.c |
static void set_midi_substream_names(struct snd_bebob *bebob,
struct snd_rawmidi_str *str) {
struct snd_rawmidi_substream *subs;
list_for_each_entry(subs, &str->substreams, list) {
snprintf(subs->name, sizeof(subs->name), "%s MIDI %d",
bebob->card->shortname, ... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_pcm.c | static int hw_rule_rate(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct snd_bebob_stream_formation *formations = rule->private;
struct snd_interval *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
const struct snd_interval *c =
hw_param_interval_c(par... | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_pcm.c |
static int pcm_init_hw_params(struct snd_bebob *bebob,
struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct amdtp_stream *s;
struct snd_bebob_stream_formation *formations;
int err;
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)... | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_pcm.c |
static int pcm_close(struct snd_pcm_substream *substream) {
struct snd_bebob *bebob = substream->private_data;
snd_bebob_stream_lock_release(bebob);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_pcm.c | static int pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) {
struct snd_bebob *bebob = substream->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
amdtp_stream_pcm_trigger(&bebob->rx_stream, substream);
break;
case SNDRV_PCM_TRIGGER_STOP:
amdtp_stream_pcm_trigger(&bebob... | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_pcm.c |
static snd_pcm_uframes_t pcm_capture_pointer(struct snd_pcm_substream *sbstrm) {
struct snd_bebob *bebob = sbstrm->private_data;
return amdtp_domain_stream_pcm_pointer(&bebob->domain, &bebob->tx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_pcm.c | static snd_pcm_uframes_t
pcm_playback_pointer(struct snd_pcm_substream *sbstrm) {
struct snd_bebob *bebob = sbstrm->private_data;
return amdtp_domain_stream_pcm_pointer(&bebob->domain, &bebob->rx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_proc.c |
static void proc_read_meters(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_bebob *bebob = entry->private_data;
const struct snd_bebob_meter_spec *spec = bebob->spec->meter;
u32 *buf;
unsigned int i, c, channels, size;
if (spec == NULL)
return;
... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_proc.c |
static void
add_node(struct snd_bebob *bebob, struct snd_info_entry *root, const char *name,
void (*op)(struct snd_info_entry *e, struct snd_info_buffer *b)) {
struct snd_info_entry *entry;
entry = snd_info_create_card_entry(bebob->card, name, root);
if (entry)
snd_info_set_text_ops(entry, bebob, o... | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_stream.c | int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate,
unsigned int frames_per_period,
unsigned int frames_per_buffer) {
unsigned int curr_rate;
int err;
// TODO: This can be removed hwdep functionality becomes popul... | [
0,
1
] |
Linux Kernel | sound/firewire/bebob/bebob_stream.c | int snd_bebob_stream_discover(struct snd_bebob *bebob) {
const struct snd_bebob_clock_spec *clk_spec = bebob->spec->clock;
u8 plugs[AVC_PLUG_INFO_BUF_BYTES], addr[AVC_BRIDGECO_ADDR_BYTES];
int err;
err = avc_general_get_plug_info(bebob->unit, 0x1f, 0x07, 0x00, plugs);
if (err < 0) {
dev_err(&bebob->unit-... | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_stream.c |
void snd_bebob_stream_lock_changed(struct snd_bebob *bebob) {
bebob->dev_lock_changed = true;
wake_up(&bebob->hwdep_wait);
} | [
0,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_stream.c |
void snd_bebob_stream_lock_release(struct snd_bebob *bebob) {
spin_lock_irq(&bebob->lock);
if (WARN_ON(bebob->dev_lock_count <= 0))
goto end;
if (--bebob->dev_lock_count == 0)
snd_bebob_stream_lock_changed(bebob);
end:
spin_unlock_irq(&bebob->lock);
} | [
1,
0
] |
Linux Kernel | sound/firewire/bebob/bebob_yamaha_terratec.c | static int clk_src_get(struct snd_bebob *bebob, unsigned int *id) {
int err;
err = avc_audio_get_selector(bebob->unit, 0, 4, id);
if (err < 0)
return err;
if (*id >= ARRAY_SIZE(clk_src_types))
return -EIO;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/cmp.c | int cmp_connection_init(struct cmp_connection *c, struct fw_unit *unit,
enum cmp_direction direction, unsigned int pcr_index) {
__be32 mpr_be;
u32 mpr;
int err;
c->direction = direction;
err = snd_fw_transaction(unit, TCODE_READ_QUADLET_REQUEST, mpr_address(c),
... | [
0,
0
] |
Linux Kernel | sound/firewire/cmp.c |
int cmp_connection_reserve(struct cmp_connection *c,
unsigned int max_payload_bytes) {
int err;
mutex_lock(&c->mutex);
if (WARN_ON(c->resources.allocated)) {
err = -EBUSY;
goto end;
}
c->speed = min(c->max_speed, fw_parent_device(c->resources.unit)->max_speed);
err = ... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-focusrite.c | int snd_dice_detect_focusrite_pro40_tcd3070_formats(struct snd_dice *dice) {
// apart from the others with TCD2220. It doesn't support TCAT protocol
// extension.
dice->tx_pcm_chs[0][0] = 20;
dice->tx_midi_ports[0] = 1;
dice->rx_pcm_chs[0][0] = 20;
dice->rx_midi_ports[0] = 1;
dice->tx_pcm_chs[0][1] = 16... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-hwdep.c |
static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
loff_t *offset) {
struct snd_dice *dice = hwdep->private_data;
DEFINE_WAIT(wait);
union snd_firewire_event event;
spin_lock_irq(&dice->lock);
while (!dice->dev_lock_changed && dice->notification_bits == 0) ... | [
1,
0
] |
Linux Kernel | sound/firewire/dice/dice-hwdep.c | static int hwdep_compat_ioctl(struct snd_hwdep *hwdep, struct file *file,
unsigned int cmd, unsigned long arg) {
return hwdep_ioctl(hwdep, file, cmd, (unsigned long)compat_ptr(arg));
}
#else | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-mytek.c | int snd_dice_detect_mytek_formats(struct snd_dice *dice) {
int i;
const struct dice_mytek_spec *dev;
dev = &stereo_192_dsd_dac;
memcpy(dice->tx_pcm_chs, dev->tx_pcm_chs,
MAX_STREAMS * SND_DICE_RATE_MODE_COUNT * sizeof(unsigned int));
memcpy(dice->rx_pcm_chs, dev->rx_pcm_chs,
MAX_STREAMS * ... | [
1,
0
] |
Linux Kernel | sound/firewire/dice/dice-pcm.c |
static int init_hw_info(struct snd_dice *dice,
struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_pcm_hardware *hw = &runtime->hw;
unsigned int index = substream->pcm->device;
enum amdtp_stream_direction dir;
struct amdtp_stream *st... | [
1,
0
] |
Linux Kernel | sound/firewire/dice/dice-pcm.c |
static int pcm_close(struct snd_pcm_substream *substream) {
struct snd_dice *dice = substream->private_data;
snd_dice_stream_lock_release(dice);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-pcm.c |
static int pcm_hw_free(struct snd_pcm_substream *substream) {
struct snd_dice *dice = substream->private_data;
mutex_lock(&dice->mutex);
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
--dice->substreams_counter;
snd_dice_stream_stop_duplex(dice);
mutex_unlock(&dice->mutex);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/firewire/dice/dice-pcm.c |
static int capture_prepare(struct snd_pcm_substream *substream) {
struct snd_dice *dice = substream->private_data;
struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device];
int err;
mutex_lock(&dice->mutex);
err = snd_dice_stream_start_duplex(dice);
mutex_unlock(&dice->mutex);
if (err >= 0... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-pcm.c |
static snd_pcm_uframes_t capture_pointer(struct snd_pcm_substream *substream) {
struct snd_dice *dice = substream->private_data;
struct amdtp_stream *stream = &dice->tx_stream[substream->pcm->device];
return amdtp_domain_stream_pcm_pointer(&dice->domain, stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-proc.c |
static const char *str_from_array(const char *const strs[], unsigned int count,
unsigned int i) {
if (i < count)
return strs[i];
return "(unknown)";
} | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-proc.c |
static void dice_proc_read_formation(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
static const char *const rate_labels[] = {
[SND_DICE_RATE_MODE_LOW] = "low",
[SND_DICE_RATE_MODE_MIDDLE] = "middle",
[SND_DICE_RATE_MODE_HIGH] = "high",
};
s... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-stream.c |
static int select_clock(struct snd_dice *dice, unsigned int rate) {
__be32 reg, new;
u32 data;
int i;
int err;
err = snd_dice_transaction_read_global(dice, GLOBAL_CLOCK_SELECT, ®,
sizeof(reg));
if (err < 0)
return err;
data = be32_to_cpu(reg);
data &= ... | [
1,
0
] |
Linux Kernel | sound/firewire/dice/dice-stream.c | static int keep_dual_resources(struct snd_dice *dice, unsigned int rate,
enum amdtp_stream_direction dir,
struct reg_params *params) {
enum snd_dice_rate_mode mode;
int i;
int err;
err = snd_dice_stream_get_rate_mode(dice, rate, &mode);
if (err < ... | [
1,
0
] |
Linux Kernel | sound/firewire/dice/dice-stream.c |
static void finish_session(struct snd_dice *dice, struct reg_params *tx_params,
struct reg_params *rx_params) {
stop_streams(dice, AMDTP_IN_STREAM, tx_params);
stop_streams(dice, AMDTP_OUT_STREAM, rx_params);
snd_dice_transaction_clear_enable(dice);
} | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-stream.c |
void snd_dice_stream_destroy_duplex(struct snd_dice *dice) {
unsigned int i;
for (i = 0; i < MAX_STREAMS; i++) {
destroy_stream(dice, AMDTP_IN_STREAM, i);
destroy_stream(dice, AMDTP_OUT_STREAM, i);
}
amdtp_domain_destroy(&dice->domain);
} | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-transaction.c |
static u64 get_subaddr(struct snd_dice *dice, enum snd_dice_addr_type type,
u64 offset) {
switch (type) {
case SND_DICE_ADDR_TYPE_TX:
offset += dice->tx_offset;
break;
case SND_DICE_ADDR_TYPE_RX:
offset += dice->rx_offset;
break;
case SND_DICE_ADDR_TYPE_SYNC:
offset +... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-transaction.c |
int snd_dice_transaction_read(struct snd_dice *dice,
enum snd_dice_addr_type type, unsigned int offset,
void *buf, unsigned int len) {
return snd_fw_transaction(dice->unit,
(len == 4) ? TCODE_READ_QUADLET_REQUEST
... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-transaction.c |
int snd_dice_transaction_set_enable(struct snd_dice *dice) {
__be32 value;
int err = 0;
if (dice->global_enabled)
goto end;
value = cpu_to_be32(1);
err = snd_fw_transaction(
dice->unit, TCODE_WRITE_QUADLET_REQUEST,
get_subaddr(dice, SND_DICE_ADDR_TYPE_GLOBAL, GLOBAL_ENABLE), &value, 4,
... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice-transaction.c | static int register_notification_address(struct snd_dice *dice, bool retry) {
struct fw_device *device = fw_parent_device(dice->unit);
__be64 *buffer;
unsigned int retries;
int err;
retries = (retry) ? 3 : 0;
buffer = kmalloc(2 * 8, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
for (;;) {
buffer[... | [
1,
0
] |
Linux Kernel | sound/firewire/dice/dice-transaction.c |
static void unregister_notification_address(struct snd_dice *dice) {
struct fw_device *device = fw_parent_device(dice->unit);
__be64 *buffer;
buffer = kmalloc(2 * 8, GFP_KERNEL);
if (buffer == NULL)
return;
buffer[0] = cpu_to_be64(((u64)device->card->node_id << OWNER_NODE_SHIFT) |
... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice.c |
static int __init alsa_dice_init(void) {
return driver_register(&dice_driver.driver);
} | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice.h |
static inline int snd_dice_transaction_write_global(struct snd_dice *dice,
unsigned int offset,
void *buf,
unsigned int len) {
return snd_dice_transaction_write(... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice.h | static inline int snd_dice_transaction_read_tx(struct snd_dice *dice,
unsigned int offset, void *buf,
unsigned int len) {
return snd_dice_transaction_read(dice, SND_DICE_ADDR_TYPE_TX, offset, buf,
... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice.h | static inline int snd_dice_transaction_write_rx(struct snd_dice *dice,
unsigned int offset, void *buf,
unsigned int len) {
return snd_dice_transaction_write(dice, SND_DICE_ADDR_TYPE_RX, offset, buf,
... | [
0,
0
] |
Linux Kernel | sound/firewire/dice/dice.h | static inline int snd_dice_transaction_write_sync(struct snd_dice *dice,
unsigned int offset,
void *buf, unsigned int len) {
return snd_dice_transaction_write(dice, SND_DICE_ADDR_TYPE_SYNC, offset, buf,
... | [
0,
0
] |
Linux Kernel | sound/firewire/digi00x/amdtp-dot.c | int amdtp_dot_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int pcm_channels) {
struct amdtp_dot *p = s->protocol;
int err;
if (amdtp_stream_running(s))
return -EBUSY;
err = amdtp_stream_set_parameters(s, rate, pcm_channels + 1);
if (err < 0)
return ... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/amdtp-dot.c |
static void read_pcm_s32(struct amdtp_stream *s, struct snd_pcm_substream *pcm,
__be32 *buffer, unsigned int frames,
unsigned int pcm_frames) {
struct amdtp_dot *p = s->protocol;
unsigned int channels = p->pcm_channels;
struct snd_pcm_runtime *runtime = pcm->runt... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/amdtp-dot.c |
static void write_pcm_silence(struct amdtp_stream *s, __be32 *buffer,
unsigned int data_blocks) {
struct amdtp_dot *p = s->protocol;
unsigned int channels, i, c;
channels = p->pcm_channels;
buffer++;
for (i = 0; i < data_blocks; ++i) {
for (c = 0; c < channels; ++c)
... | [
0,
0
] |
Linux Kernel | sound/firewire/digi00x/amdtp-dot.c | static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
unsigned int data_blocks,
unsigned int data_block_counter) {
struct amdtp_dot *p = s->protocol;
unsigned int f, port;
int len;
u8 *b;
for (f = 0; f < data_blocks; f++) {
... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-hwdep.c |
static int hwdep_get_info(struct snd_dg00x *dg00x, void __user *arg) {
struct fw_device *dev = fw_parent_device(dg00x->unit);
struct snd_firewire_get_info info;
memset(&info, 0, sizeof(info));
info.type = SNDRV_FIREWIRE_TYPE_DIGI00X;
info.card = dev->card->index;
*(__be32 *)&info.guid[0] = cpu_to_be32(dev... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-midi.c |
static int midi_close(struct snd_rawmidi_substream *substream) {
struct snd_dg00x *dg00x = substream->rmidi->private_data;
mutex_lock(&dg00x->mutex);
--dg00x->substreams_counter;
snd_dg00x_stream_stop_duplex(dg00x);
mutex_unlock(&dg00x->mutex);
snd_dg00x_stream_lock_release(dg00x);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-midi.c |
static void midi_playback_trigger(struct snd_rawmidi_substream *substream,
int up) {
struct snd_dg00x *dg00x = substream->rmidi->private_data;
unsigned int port;
unsigned long flags;
if (substream->rmidi->device == 0)
port = substream->number;
else
port = 2;
spin... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-midi.c |
static void set_substream_names(struct snd_dg00x *dg00x,
struct snd_rawmidi *rmidi, bool is_console) {
struct snd_rawmidi_substream *subs;
struct snd_rawmidi_str *str;
int i;
for (i = 0; i < 2; ++i) {
str = &rmidi->streams[i];
list_for_each_entry(subs, &str->substreams... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-pcm.c |
static int hw_rule_rate(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct snd_interval *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
const struct snd_interval *c =
hw_param_interval_c(params, SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval t = {
... | [
0,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-pcm.c |
static int pcm_hw_free(struct snd_pcm_substream *substream) {
struct snd_dg00x *dg00x = substream->private_data;
mutex_lock(&dg00x->mutex);
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
--dg00x->substreams_counter;
snd_dg00x_stream_stop_duplex(dg00x);
mutex_unlock(&dg00x->mutex);
return 0... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-pcm.c |
int snd_dg00x_create_pcm_devices(struct snd_dg00x *dg00x) {
static const struct snd_pcm_ops capture_ops = {
.open = pcm_open,
.close = pcm_close,
.hw_params = pcm_hw_params,
.hw_free = pcm_hw_free,
.prepare = pcm_capture_prepare,
.trigger = pcm_capture_trigger,
.pointer = pc... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-stream.c |
int snd_dg00x_stream_get_local_rate(struct snd_dg00x *dg00x,
unsigned int *rate) {
u32 data;
__be32 reg;
int err;
err = snd_fw_transaction(dg00x->unit, TCODE_READ_QUADLET_REQUEST,
DG00X_ADDR_BASE + DG00X_OFFSET_LOCAL_RATE, ®,
... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-stream.c |
int snd_dg00x_stream_set_local_rate(struct snd_dg00x *dg00x,
unsigned int rate) {
__be32 reg;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(snd_dg00x_stream_rates); i++) {
if (rate == snd_dg00x_stream_rates[i])
break;
}
if (i == ARRAY_SIZE(snd_dg00x_stream_rates))
... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-stream.c |
int snd_dg00x_stream_check_external_clock(struct snd_dg00x *dg00x,
bool *detect) {
__be32 reg;
int err;
err = snd_fw_transaction(dg00x->unit, TCODE_READ_QUADLET_REQUEST,
DG00X_ADDR_BASE + DG00X_OFFSET_DETECT_EXTERNAL, ®,
... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-stream.c | static int begin_session(struct snd_dg00x *dg00x) {
__be32 data;
u32 curr;
int err;
data = cpu_to_be32((dg00x->tx_resources.channel << 16) |
dg00x->rx_resources.channel);
err = snd_fw_transaction(dg00x->unit, TCODE_WRITE_QUADLET_REQUEST,
DG00X_ADDR_BASE + DG00X... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-stream.c |
void snd_dg00x_stream_lock_changed(struct snd_dg00x *dg00x) {
dg00x->dev_lock_changed = true;
wake_up(&dg00x->hwdep_wait);
} | [
0,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-stream.c |
void snd_dg00x_stream_lock_release(struct snd_dg00x *dg00x) {
spin_lock_irq(&dg00x->lock);
if (WARN_ON(dg00x->dev_lock_count <= 0))
goto end;
if (--dg00x->dev_lock_count == 0)
snd_dg00x_stream_lock_changed(dg00x);
end:
spin_unlock_irq(&dg00x->lock);
} | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-transaction.c | int snd_dg00x_transaction_reregister(struct snd_dg00x *dg00x) {
struct fw_device *device = fw_parent_device(dg00x->unit);
__be32 data[2];
data[0] = cpu_to_be32((device->card->node_id << 16) |
(dg00x->async_handler.offset >> 32));
data[1] = cpu_to_be32(dg00x->async_handler.offset);
ret... | [
1,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x-transaction.c |
void snd_dg00x_transaction_unregister(struct snd_dg00x *dg00x) {
if (dg00x->async_handler.callback_data == NULL)
return;
fw_core_remove_address_handler(&dg00x->async_handler);
dg00x->async_handler.callback_data = NULL;
} | [
0,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x.c |
static int __init snd_dg00x_init(void) {
return driver_register(&dg00x_driver.driver);
} | [
0,
0
] |
Linux Kernel | sound/firewire/digi00x/digi00x.c |
static void __exit snd_dg00x_exit(void) {
driver_unregister(&dg00x_driver.driver);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fcp.c | void fcp_bus_reset(struct fw_unit *unit) {
struct fcp_transaction *t;
spin_lock_irq(&transactions_lock);
list_for_each_entry(t, &transactions, list) {
if (t->unit == unit &&
(t->state == STATE_PENDING || t->state == STATE_DEFERRED)) {
t->state = STATE_BUS_RESET;
wake_up(&t->wait);
}
... | [
0,
0
] |
Linux Kernel | sound/firewire/fcp.c |
static int __init fcp_module_init(void) {
static const struct fw_address_region response_register_region = {
.start = CSR_REGISTER_BASE + CSR_FCP_RESPONSE,
.end = CSR_REGISTER_BASE + CSR_FCP_END,
};
fw_core_add_address_handler(&response_register_handler,
&response_regis... | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/amdtp-ff.c |
static void read_pcm_s32(struct amdtp_stream *s, struct snd_pcm_substream *pcm,
__le32 *buffer, unsigned int frames,
unsigned int pcm_frames) {
struct amdtp_ff *p = s->protocol;
unsigned int channels = p->pcm_channels;
struct snd_pcm_runtime *runtime = pcm->runti... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/amdtp-ff.c |
static unsigned int process_ir_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs,
unsigned int packets,
struct snd_pcm_substream *pcm) {
unsigned int pcm_frames = 0;
i... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-hwdep.c |
static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
loff_t *offset) {
struct snd_ff *ff = hwdep->private_data;
DEFINE_WAIT(wait);
union snd_firewire_event event;
spin_lock_irq(&ff->lock);
while (!ff->dev_lock_changed) {
prepare_to_wait(&ff->hwdep_wait, &... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-hwdep.c |
static int hwdep_get_info(struct snd_ff *ff, void __user *arg) {
struct fw_device *dev = fw_parent_device(ff->unit);
struct snd_firewire_get_info info;
memset(&info, 0, sizeof(info));
info.type = SNDRV_FIREWIRE_TYPE_FIREFACE;
info.card = dev->card->index;
*(__be32 *)&info.guid[0] = cpu_to_be32(dev->config... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-midi.c |
static int midi_playback_close(struct snd_rawmidi_substream *substream) {
struct snd_ff *ff = substream->rmidi->private_data;
cancel_work_sync(&ff->rx_midi_work[substream->number]);
WRITE_ONCE(ff->rx_midi_substreams[substream->number], NULL);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-midi.c |
static void set_midi_substream_names(struct snd_rawmidi_str *stream,
const char *const name) {
struct snd_rawmidi_substream *substream;
list_for_each_entry(substream, &stream->substreams, list) {
snprintf(substream->name, sizeof(substream->name), "%s MIDI %d", name,
... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-pcm.c |
static int hw_rule_rate(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
const unsigned int *pcm_channels = rule->private;
struct snd_interval *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
const struct snd_interval *c =
hw_param_interval_c(params, SNDRV_P... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-pcm.c |
static int hw_rule_channels(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
const unsigned int *pcm_channels = rule->private;
struct snd_interval *c =
hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
const struct snd_interval *r =
hw_param_interval... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-pcm.c |
static int pcm_hw_free(struct snd_pcm_substream *substream) {
struct snd_ff *ff = substream->private_data;
mutex_lock(&ff->mutex);
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
--ff->substreams_counter;
snd_ff_stream_stop_duplex(ff);
mutex_unlock(&ff->mutex);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-pcm.c |
static int pcm_capture_trigger(struct snd_pcm_substream *substream, int cmd) {
struct snd_ff *ff = substream->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
amdtp_stream_pcm_trigger(&ff->tx_stream, substream);
break;
case SNDRV_PCM_TRIGGER_STOP:
amdtp_stream_pcm_trigger(&ff->tx_stream,... | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-pcm.c |
static snd_pcm_uframes_t
pcm_playback_pointer(struct snd_pcm_substream *sbstrm) {
struct snd_ff *ff = sbstrm->private_data;
return amdtp_domain_stream_pcm_pointer(&ff->domain, &ff->rx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-proc.c |
const char *snd_ff_proc_get_clk_label(enum snd_ff_clock_src src) {
static const char *const labels[] = {
"Internal", "S/PDIF", "ADAT1", "ADAT2", "Word", "LTC",
};
if (src >= ARRAY_SIZE(labels))
return NULL;
return labels[src];
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c | static int former_switch_fetching_mode(struct snd_ff *ff, bool enable) {
unsigned int count;
__le32 *reg;
int i;
int err;
count = 0;
for (i = 0; i < SND_FF_STREAM_MODE_COUNT; ++i)
count = max(count, ff->spec->pcm_playback_channels[i]);
reg = kcalloc(count, sizeof(__le32), GFP_KERNEL);
if (!reg)
... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c |
static void former_dump_status(struct snd_ff *ff,
struct snd_info_buffer *buffer) {
dump_clock_config(ff, buffer);
dump_sync_status(ff, buffer);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c | static int allocate_tx_resources(struct snd_ff *ff) {
__le32 reg;
unsigned int count;
unsigned int tx_isoc_channel;
int err;
reg = cpu_to_le32(ff->tx_stream.data_block_quadlets);
err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST,
FF800_ALLOC_TX_STREAM, ®, sizeof(r... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.