Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c |
static int ff800_begin_session(struct snd_ff *ff, unsigned int rate) {
unsigned int generation = ff->rx_resources.generation;
__le32 reg;
if (generation != fw_parent_device(ff->unit)->card->generation) {
int err = fw_iso_resources_update(&ff->rx_resources);
if (err < 0)
return err;
}
reg = cp... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c |
static void ff800_finish_session(struct snd_ff *ff) {
__le32 reg;
reg = cpu_to_le32(0x80000000);
snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST,
FF800_ISOC_COMM_STOP, ®, sizeof(reg), 0);
} | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c | static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
__le32 *buf, size_t length) {
int i;
for (i = 0; i < length / 4; i++) {
u8 byte = le32_to_cpu(buf[i]) & 0xff;
struct snd_rawmidi_substream *substream;
substream = READ_ONCE(ff->tx_midi_substream... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c |
static void ff400_finish_session(struct snd_ff *ff) {
__le32 reg;
reg = cpu_to_le32(0x80000000);
snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST,
FF400_ISOC_COMM_STOP, ®, sizeof(reg), 0);
} | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-former.c | bit flags: offset of destination address
- 0x04000000: 0x'....'....'0000'0000
- 0x08000000: 0x'....'....'0000'0080
- 0x10000000: 0x'....'....'0000'0100
- 0x20000000: 0x'....'....'0000'0180
Drivers can suppress the device to transfer asynchronous transactions by
using below 2 bits.
- 0x01000000: suppress t... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-latter.c |
static int latter_get_clock(struct snd_ff *ff, unsigned int *rate,
enum snd_ff_clock_src *src) {
__le32 reg;
u32 data;
int err;
err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST,
LATTER_SYNC_STATUS, ®, sizeof(reg), 0);
if (err < 0)
re... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-latter.c |
static int latter_switch_fetching_mode(struct snd_ff *ff, bool enable) {
u32 data;
__le32 reg;
if (enable)
data = 0x00000000;
else
data = 0xffffffff;
reg = cpu_to_le32(data);
return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST,
LATTER_FETCH_MODE, ®, size... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-latter.c |
static void latter_finish_session(struct snd_ff *ff) {
__le32 reg;
reg = cpu_to_le32(0x00000000);
snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, LATTER_ISOC_START,
®, sizeof(reg), 0);
} | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-protocol-latter.c | static inline int calculate_message_bytes(u8 status) {
switch (status) {
case 0xf6:
case 0xf8: /* Timing clock. */
case 0xfa: /* Start. */
case 0xfb: /* Continue. */
case 0xfc: /* Stop. */
case 0xfe: /* Active sensing. */
case 0xff: /* System reset. */
return 1;
case 0xf1: /* MIDI time code quarte... | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-stream.c | void snd_ff_stream_destroy_duplex(struct snd_ff *ff) {
amdtp_domain_destroy(&ff->domain);
destroy_stream(ff, &ff->rx_stream);
destroy_stream(ff, &ff->tx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-stream.c | int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate) {
int err;
if (ff->substreams_counter == 0)
return 0;
if (amdtp_streaming_error(&ff->tx_stream) ||
amdtp_streaming_error(&ff->rx_stream)) {
amdtp_domain_stop(&ff->domain);
finish_session(ff);
}
if (!amdtp_stream_running(... | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-stream.c | int snd_ff_stream_lock_try(struct snd_ff *ff) {
int err;
spin_lock_irq(&ff->lock);
if (ff->dev_lock_count < 0) {
err = -EBUSY;
goto end;
}
/* this is the first time */
if (ff->dev_lock_count++ == 0)
snd_ff_stream_lock_changed(ff);
err = 0;
end:
spin_unlock_irq(&ff->lock);
return err;
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-stream.c |
void snd_ff_stream_lock_release(struct snd_ff *ff) {
spin_lock_irq(&ff->lock);
if (WARN_ON(ff->dev_lock_count <= 0))
goto end;
if (--ff->dev_lock_count == 0)
snd_ff_stream_lock_changed(ff);
end:
spin_unlock_irq(&ff->lock);
} | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff-transaction.c | static void finish_transmit_midi_msg(struct snd_ff *ff, unsigned int port,
int rcode) {
struct snd_rawmidi_substream *substream =
READ_ONCE(ff->rx_midi_substreams[port]);
if (rcode_is_permanent_error(rcode)) {
ff->rx_midi_error[port] = true;
return;
}
if (rco... | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-transaction.c | static int allocate_own_address(struct snd_ff *ff, int i) {
struct fw_address_region midi_msg_region;
int err;
ff->async_handler.length = ff->spec->midi_addr_range;
ff->async_handler.address_callback = handle_midi_msg;
ff->async_handler.callback_data = ff;
midi_msg_region.start = 0x000100000000ull * i;
... | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff-transaction.c | This driver expects userspace applications to configure registers for the
lower address because in most cases such registers has the other settings.
int snd_ff_transaction_reregister(struct snd_ff *ff)
{
struct fw_card *fw_card = fw_parent_device(ff->unit)->card;
u32 addr;
__le32 reg;
/*
* Controller... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff.c |
static void name_card(struct snd_ff *ff) {
struct fw_device *fw_dev = fw_parent_device(ff->unit);
const char *const names[] = {
[SND_FF_UNIT_VERSION_FF800] = "Fireface800",
[SND_FF_UNIT_VERSION_FF400] = "Fireface400",
[SND_FF_UNIT_VERSION_UFX] = "FirefaceUFX",
[SND_FF_UNIT_VERSION_UCX] = "F... | [
1,
0
] |
Linux Kernel | sound/firewire/fireface/ff.c |
static void ff_card_free(struct snd_card *card) {
struct snd_ff *ff = card->private_data;
snd_ff_stream_destroy_duplex(ff);
snd_ff_transaction_unregister(ff);
mutex_destroy(&ff->mutex);
fw_unit_put(ff->unit);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireface/ff.c |
static int snd_ff_probe(struct fw_unit *unit,
const struct ieee1394_device_id *entry) {
struct snd_card *card;
struct snd_ff *ff;
int err;
err = snd_card_new(&unit->device, -1, NULL, THIS_MODULE, sizeof(*ff), &card);
if (err < 0)
return err;
card->private_free = ff_card_free;
... | [
1,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_command.c |
static int command_get_clock(struct snd_efw *efw, struct efc_clock *clock) {
int err;
err = efw_transaction(efw, EFC_CAT_HWCTL, EFC_CMD_HWCTL_GET_CLOCK, NULL, 0,
(__be32 *)clock, sizeof(struct efc_clock));
if (err >= 0) {
be32_to_cpus(&clock->source);
be32_to_cpus(&clock->samplin... | [
1,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_command.c | static int command_set_clock(struct snd_efw *efw, unsigned int source,
unsigned int rate) {
struct efc_clock clock = {0};
int err;
if ((source == UINT_MAX) && (rate == UINT_MAX)) {
err = -EINVAL;
goto end;
}
/* get current status */
err = command_get_clock(efw, &clock)... | [
1,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_command.c |
int snd_efw_command_get_clock_source(struct snd_efw *efw,
enum snd_efw_clock_source *source) {
int err;
struct efc_clock clock = {0};
err = command_get_clock(efw, &clock);
if (err >= 0)
*source = clock.source;
return err;
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_midi.c |
static int midi_close(struct snd_rawmidi_substream *substream) {
struct snd_efw *efw = substream->rmidi->private_data;
mutex_lock(&efw->mutex);
--efw->substreams_counter;
snd_efw_stream_stop_duplex(efw);
mutex_unlock(&efw->mutex);
snd_efw_stream_lock_release(efw);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_midi.c |
static void midi_capture_trigger(struct snd_rawmidi_substream *substrm,
int up) {
struct snd_efw *efw = substrm->rmidi->private_data;
unsigned long flags;
spin_lock_irqsave(&efw->lock, flags);
if (up)
amdtp_am824_midi_trigger(&efw->tx_stream, substrm->number, substrm);
... | [
1,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_pcm.c | static int pcm_init_hw_params(struct snd_efw *efw,
struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct amdtp_stream *s;
unsigned int *pcm_channels;
int err;
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
runtime->hw.forma... | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_pcm.c |
static int pcm_close(struct snd_pcm_substream *substream) {
struct snd_efw *efw = substream->private_data;
snd_efw_stream_lock_release(efw);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_pcm.c |
static int pcm_capture_prepare(struct snd_pcm_substream *substream) {
struct snd_efw *efw = substream->private_data;
int err;
err = snd_efw_stream_start_duplex(efw);
if (err >= 0)
amdtp_stream_pcm_prepare(&efw->tx_stream);
return err;
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_proc.c | static void proc_read_phys_meters(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_efw *efw = entry->private_data;
struct snd_efw_phys_meters *meters;
unsigned int g, c, m, max, size;
const char *name;
u32 *linear;
int err;
size = sizeof(struct ... | [
1,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_proc.c | void snd_efw_proc_init(struct snd_efw *efw) {
struct snd_info_entry *root;
root =
snd_info_create_card_entry(efw->card, "firewire", efw->card->proc_root);
if (root == NULL)
return;
root->mode = S_IFDIR | 0555;
add_node(efw, root, "clock", proc_read_clock);
add_node(efw, root, "firmware", proc_re... | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c | static int start_stream(struct snd_efw *efw, struct amdtp_stream *stream,
unsigned int rate) {
struct cmp_connection *conn;
int err;
if (stream == &efw->tx_stream)
conn = &efw->out_conn;
else
conn = &efw->in_conn;
err = cmp_connection_establish(conn);
if (err < 0)
retur... | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c | static void destroy_stream(struct snd_efw *efw, struct amdtp_stream *stream) {
amdtp_stream_destroy(stream);
if (stream == &efw->tx_stream)
cmp_connection_destroy(&efw->out_conn);
else
cmp_connection_destroy(&efw->in_conn);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c |
static int check_connection_used_by_others(struct snd_efw *efw,
struct amdtp_stream *s) {
struct cmp_connection *conn;
bool used;
int err;
if (s == &efw->tx_stream)
conn = &efw->out_conn;
else
conn = &efw->in_conn;
err = cmp_connection_check_used(conn, &... | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c | int snd_efw_stream_init_duplex(struct snd_efw *efw) {
int err;
err = init_stream(efw, &efw->tx_stream);
if (err < 0)
return err;
err = init_stream(efw, &efw->rx_stream);
if (err < 0) {
destroy_stream(efw, &efw->tx_stream);
return err;
}
err = amdtp_domain_init(&efw->domain);
if (err < 0) ... | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c |
void snd_efw_stream_stop_duplex(struct snd_efw *efw) {
if (efw->substreams_counter == 0) {
amdtp_domain_stop(&efw->domain);
cmp_connection_break(&efw->out_conn);
cmp_connection_break(&efw->in_conn);
cmp_connection_release(&efw->out_conn);
cmp_connection_release(&efw->in_conn);
}
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c |
void snd_efw_stream_update_duplex(struct snd_efw *efw) {
amdtp_domain_stop(&efw->domain);
cmp_connection_break(&efw->out_conn);
cmp_connection_break(&efw->in_conn);
amdtp_stream_pcm_abort(&efw->rx_stream);
amdtp_stream_pcm_abort(&efw->tx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c |
void snd_efw_stream_destroy_duplex(struct snd_efw *efw) {
amdtp_domain_destroy(&efw->domain);
destroy_stream(efw, &efw->rx_stream);
destroy_stream(efw, &efw->tx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_stream.c | int snd_efw_stream_lock_try(struct snd_efw *efw) {
int err;
spin_lock_irq(&efw->lock);
if (efw->dev_lock_count < 0) {
err = -EBUSY;
goto end;
}
/* this is the first time */
if (efw->dev_lock_count++ == 0)
snd_efw_stream_lock_changed(efw);
err = 0;
end:
spin_unlock_irq(&efw->lock);
retur... | [
0,
0
] |
Linux Kernel | sound/firewire/fireworks/fireworks_transaction.c |
void snd_efw_transaction_unregister(void) {
WARN_ON(!list_empty(&transaction_queues));
fw_core_remove_address_handler(&resp_register_handler);
} | [
0,
0
] |
Linux Kernel | sound/firewire/isight.c |
static void isight_samples(struct isight *isight, const __be16 *samples,
unsigned int count) {
struct snd_pcm_runtime *runtime;
unsigned int count1;
if (!READ_ONCE(isight->pcm_running))
return;
runtime = isight->pcm->runtime;
if (isight->buffer_pointer + count <= runtime->buf... | [
1,
0
] |
Linux Kernel | sound/firewire/isight.c |
static void isight_pcm_abort(struct isight *isight) {
if (READ_ONCE(isight->pcm_active))
snd_pcm_stop_xrun(isight->pcm);
} | [
0,
0
] |
Linux Kernel | sound/firewire/isight.c | static void isight_packet(struct fw_iso_context *context, u32 cycle,
size_t header_length, void *header, void *data) {
struct isight *isight = data;
const struct audio_payload *payload;
unsigned int index, length, count, total;
int err;
if (isight->packet_index < 0)
return;
in... | [
0,
0
] |
Linux Kernel | sound/firewire/isight.c |
static int isight_connect(struct isight *isight) {
int ch, err;
__be32 value;
retry_after_bus_reset:
ch = fw_iso_resources_allocate(&isight->resources,
sizeof(struct audio_payload),
isight->device->max_speed);
if (ch < 0) {
err = ch;
go... | [
1,
0
] |
Linux Kernel | sound/firewire/isight.c |
static int isight_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params) {
struct isight *isight = substream->private_data;
WRITE_ONCE(isight->pcm_active, true);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/isight.c |
static int isight_hw_free(struct snd_pcm_substream *substream) {
struct isight *isight = substream->private_data;
WRITE_ONCE(isight->pcm_active, false);
mutex_lock(&isight->mutex);
isight_stop_streaming(isight);
mutex_unlock(&isight->mutex);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/isight.c |
static int isight_prepare(struct snd_pcm_substream *substream) {
struct isight *isight = substream->private_data;
int err;
isight->buffer_pointer = 0;
isight->period_counter = 0;
mutex_lock(&isight->mutex);
err = isight_start_streaming(isight);
mutex_unlock(&isight->mutex);
return err;
} | [
0,
0
] |
Linux Kernel | sound/firewire/isight.c |
static int isight_create_pcm(struct isight *isight) {
static const struct snd_pcm_ops ops = {
.open = isight_open,
.close = isight_close,
.hw_params = isight_hw_params,
.hw_free = isight_hw_free,
.prepare = isight_prepare,
.trigger = isight_trigger,
.pointer = isight_pointer... | [
1,
0
] |
Linux Kernel | sound/firewire/isight.c |
static int isight_mute_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct isight *isight = ctl->private_data;
return reg_write(isight, REG_MUTE,
(__force __be32)!value->value.integer.value[0]);
} | [
0,
0
] |
Linux Kernel | sound/firewire/isight.c |
static void isight_card_free(struct snd_card *card) {
struct isight *isight = card->private_data;
fw_iso_resources_destroy(&isight->resources);
} | [
0,
0
] |
Linux Kernel | sound/firewire/iso-resources.c | static unsigned int packet_bandwidth(unsigned int max_payload_bytes,
int speed) {
unsigned int bytes, s400_bytes;
bytes = 3 * 4 + ALIGN(max_payload_bytes, 4);
/* convert to bandwidth units (quadlets at S1600 = bytes at S400) */
if (speed <= SCODE_400)
s400_bytes = byte... | [
0,
0
] |
Linux Kernel | sound/firewire/iso-resources.c |
static int wait_isoch_resource_delay_after_bus_reset(struct fw_card *card) {
for (;;) {
s64 delay = (card->reset_jiffies + HZ) - get_jiffies_64();
if (delay <= 0)
return 0;
if (schedule_timeout_interruptible(delay) > 0)
return -ERESTARTSYS;
}
} | [
0,
0
] |
Linux Kernel | sound/firewire/motu/amdtp-motu.c |
static void read_pcm_s32(struct amdtp_stream *s, struct snd_pcm_substream *pcm,
__be32 *buffer, unsigned int data_blocks,
unsigned int pcm_frames) {
struct amdtp_motu *p = s->protocol;
unsigned int channels = p->pcm_chunks;
struct snd_pcm_runtime *runtime = pcm->... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/amdtp-motu.c |
static void write_midi_messages(struct amdtp_stream *s, __be32 *buffer,
unsigned int data_blocks) {
struct amdtp_motu *p = s->protocol;
struct snd_rawmidi_substream *midi = READ_ONCE(p->midi);
u8 *b;
int i;
for (i = 0; i < data_blocks; i++) {
b = (u8 *)buffer;
if (mi... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/amdtp-motu.c |
static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer,
unsigned int data_blocks) {
struct amdtp_motu *p = s->protocol;
struct snd_rawmidi_substream *midi;
u8 *b;
int i;
for (i = 0; i < data_blocks; i++) {
b = (u8 *)buffer;
midi = READ_ONCE(p->midi);
... | [
0,
0
] |
Linux Kernel | sound/firewire/motu/amdtp-motu.c |
static void cache_event_offsets(struct amdtp_motu_cache *cache,
const __be32 *buf, unsigned int data_blocks,
unsigned int data_block_quadlets) {
unsigned int *event_offsets = cache->event_offsets;
const unsigned int cache_size = cache->size;
unsigne... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/amdtp-motu.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) {
struct snd_motu *motu = container... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/amdtp-motu.c | static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
const struct pkt_desc *descs,
unsigned int packets,
struct snd_pcm_substream *pcm) {
struct amdtp_motu *p = s->protoco... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-hwdep.c |
static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
poll_table *wait) {
struct snd_motu *motu = hwdep->private_data;
__poll_t events;
poll_wait(file, &motu->hwdep_wait, wait);
spin_lock_irq(&motu->lock);
if (motu->dev_lock_changed || motu->msg || has_dsp_event(... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-hwdep.c |
int snd_motu_create_hwdep_device(struct snd_motu *motu) {
static const struct snd_hwdep_ops ops = {
.read = hwdep_read,
.release = hwdep_release,
.poll = hwdep_poll,
.ioctl = hwdep_ioctl,
.ioctl_compat = hwdep_compat_ioctl,
};
struct snd_hwdep *hwdep;
int err;
err = snd_hwdep_n... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-midi.c |
static int midi_open(struct snd_rawmidi_substream *substream) {
struct snd_motu *motu = substream->rmidi->private_data;
int err;
err = snd_motu_stream_lock_try(motu);
if (err < 0)
return err;
mutex_lock(&motu->mutex);
err = snd_motu_stream_reserve_duplex(motu, 0, 0, 0);
if (err >= 0) {
++motu-... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-midi.c |
static void midi_capture_trigger(struct snd_rawmidi_substream *substrm,
int up) {
struct snd_motu *motu = substrm->rmidi->private_data;
unsigned long flags;
spin_lock_irqsave(&motu->lock, flags);
if (up)
amdtp_motu_midi_trigger(&motu->tx_stream, substrm->number, substrm);... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-pcm.c | static int playback_trigger(struct snd_pcm_substream *substream, int cmd) {
struct snd_motu *motu = substream->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
amdtp_stream_pcm_trigger(&motu->rx_stream, substream);
break;
case SNDRV_PCM_TRIGGER_STOP:
amdtp_stream_pcm_trigger(&motu->rx_str... | [
0,
0
] |
Linux Kernel | sound/firewire/motu/motu-pcm.c |
static snd_pcm_uframes_t capture_pointer(struct snd_pcm_substream *substream) {
struct snd_motu *motu = substream->private_data;
return amdtp_domain_stream_pcm_pointer(&motu->domain, &motu->tx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/motu/motu-pcm.c |
static int playback_ack(struct snd_pcm_substream *substream) {
struct snd_motu *motu = substream->private_data;
return amdtp_domain_stream_pcm_ack(&motu->domain, &motu->rx_stream);
} | [
0,
0
] |
Linux Kernel | sound/firewire/motu/motu-proc.c |
static void proc_read_clock(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_motu *motu = entry->private_data;
unsigned int rate;
enum snd_motu_clock_source source;
if (snd_motu_protocol_get_clock_rate(motu, &rate) < 0)
return;
if (snd_motu_protocol... | [
0,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v1.c |
static int parse_clock_rate_896(u32 data, unsigned int *rate) {
switch (data & CLK_896_STATUS_MASK_RATE) {
case CLK_896_STATUS_FLAG_RATE_44100:
*rate = 44100;
break;
case CLK_896_STATUS_FLAG_RATE_48000:
*rate = 48000;
break;
case CLK_896_STATUS_FLAG_RATE_88200:
*rate = 88200;
break;
c... | [
0,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v1.c |
static int get_clock_rate_896(struct snd_motu *motu, unsigned int *rate) {
__be32 reg;
int err;
err =
snd_motu_transaction_read(motu, CLK_896_STATUS_OFFSET, ®, sizeof(reg));
if (err < 0)
return err;
return parse_clock_rate_896(be32_to_cpu(reg), rate);
} | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v1.c |
static int set_clock_rate_828(struct snd_motu *motu, unsigned int rate) {
__be32 reg;
u32 data;
int err;
err =
snd_motu_transaction_read(motu, CLK_828_STATUS_OFFSET, ®, sizeof(reg));
if (err < 0)
return err;
data = be32_to_cpu(reg) & CLK_828_STATUS_MASK;
data &= ~CLK_828_STATUS_FLAG_RATE_4... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v1.c |
static int get_clock_source_896(struct snd_motu *motu,
enum snd_motu_clock_source *src) {
__be32 reg;
u32 data;
int err;
err =
snd_motu_transaction_read(motu, CLK_896_STATUS_OFFSET, ®, sizeof(reg));
if (err < 0)
return err;
data = be32_to_cpu(reg);
switch (d... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v1.c |
int snd_motu_protocol_v1_cache_packet_formats(struct snd_motu *motu) {
memcpy(motu->tx_packet_formats.pcm_chunks, motu->spec->tx_fixed_pcm_chunks,
sizeof(motu->tx_packet_formats.pcm_chunks));
memcpy(motu->rx_packet_formats.pcm_chunks, motu->spec->rx_fixed_pcm_chunks,
sizeof(motu->rx_packet_format... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v2.c |
int snd_motu_protocol_v2_get_clock_rate(struct snd_motu *motu,
unsigned int *rate) {
__be32 reg;
int err;
err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®,
sizeof(reg));
if (err < 0)
return err;
return get_clock... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v2.c |
int snd_motu_protocol_v2_set_clock_rate(struct snd_motu *motu,
unsigned int rate) {
__be32 reg;
u32 data;
int i;
int err;
for (i = 0; i < ARRAY_SIZE(snd_motu_clock_rates); ++i) {
if (snd_motu_clock_rates[i] == rate)
break;
}
if (i == ARRAY_SIZE(snd_motu_... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v2.c | int snd_motu_protocol_v2_switch_fetching_mode(struct snd_motu *motu,
bool enable) {
if (motu->spec == &snd_motu_spec_828mk2) {
return 0;
} else if (motu->spec == &snd_motu_spec_896hd) {
// 896HD implements Altera Cyclone EP1C3 but nothing to do.
return 0;
... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v3.c |
int snd_motu_protocol_v3_set_clock_rate(struct snd_motu *motu,
unsigned int rate) {
__be32 reg;
u32 data;
bool need_to_wait;
int i, err;
for (i = 0; i < ARRAY_SIZE(snd_motu_clock_rates); ++i) {
if (snd_motu_clock_rates[i] == rate)
break;
}
if (i == ARRAY... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-protocol-v3.c |
int snd_motu_protocol_v3_cache_packet_formats(struct snd_motu *motu) {
__be32 reg;
u32 data;
int err;
motu->tx_packet_formats.pcm_byte_offset = 10;
motu->rx_packet_formats.pcm_byte_offset = 10;
motu->tx_packet_formats.msg_chunks = 2;
motu->rx_packet_formats.msg_chunks = 2;
err = snd_motu_transaction... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-register-dsp-message-parser.c |
unsigned int
snd_motu_register_dsp_message_parser_count_event(struct snd_motu *motu) {
struct msg_parser *parser = motu->message_parser;
if (parser->pull_pos > parser->push_pos)
return EVENT_QUEUE_SIZE - parser->pull_pos + parser->push_pos;
else
return parser->push_pos - parser->pull_pos;
} | [
0,
0
] |
Linux Kernel | sound/firewire/motu/motu-stream.c |
static int keep_resources(struct snd_motu *motu, unsigned int rate,
struct amdtp_stream *stream) {
struct fw_iso_resources *resources;
struct snd_motu_packet_format *packet_format;
unsigned int midi_ports = 0;
int err;
if (stream == &motu->rx_stream) {
resources = &motu->rx_res... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-stream.c |
void snd_motu_stream_lock_release(struct snd_motu *motu) {
spin_lock_irq(&motu->lock);
if (WARN_ON(motu->dev_lock_count <= 0))
goto out;
if (--motu->dev_lock_count == 0)
motu_lock_changed(motu);
out:
spin_unlock_irq(&motu->lock);
} | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-transaction.c |
int snd_motu_transaction_read(struct snd_motu *motu, u32 offset, __be32 *reg,
size_t size) {
int tcode;
if (size % sizeof(__be32) > 0 || size <= 0)
return -EINVAL;
if (size == sizeof(__be32))
tcode = TCODE_READ_QUADLET_REQUEST;
else
tcode = TCODE_READ_BLOCK_REQUEST;
... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-transaction.c |
int snd_motu_transaction_write(struct snd_motu *motu, u32 offset, __be32 *reg,
size_t size) {
int tcode;
if (size % sizeof(__be32) > 0 || size <= 0)
return -EINVAL;
if (size == sizeof(__be32))
tcode = TCODE_WRITE_QUADLET_REQUEST;
else
tcode = TCODE_WRITE_BLOCK_REQUES... | [
1,
0
] |
Linux Kernel | sound/firewire/motu/motu-transaction.c |
static void handle_message(struct fw_card *card, struct fw_request *request,
int tcode, int destination, int source,
int generation, unsigned long long offset,
void *data, size_t length, void *callback_data) {
struct snd_motu *motu = ca... | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-midi.c |
static int midi_capture_open(struct snd_rawmidi_substream *substream) {
struct snd_oxfw *oxfw = substream->rmidi->private_data;
int err;
err = snd_oxfw_stream_lock_try(oxfw);
if (err < 0)
return err;
mutex_lock(&oxfw->mutex);
err = snd_oxfw_stream_reserve_duplex(oxfw, &oxfw->tx_stream, 0, 0, 0, 0);
... | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-midi.c |
static int midi_playback_open(struct snd_rawmidi_substream *substream) {
struct snd_oxfw *oxfw = substream->rmidi->private_data;
int err;
err = snd_oxfw_stream_lock_try(oxfw);
if (err < 0)
return err;
mutex_lock(&oxfw->mutex);
err = snd_oxfw_stream_reserve_duplex(oxfw, &oxfw->rx_stream, 0, 0, 0, 0);... | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-midi.c |
static int midi_playback_close(struct snd_rawmidi_substream *substream) {
struct snd_oxfw *oxfw = substream->rmidi->private_data;
mutex_lock(&oxfw->mutex);
--oxfw->substreams_count;
snd_oxfw_stream_stop_duplex(oxfw);
mutex_unlock(&oxfw->mutex);
snd_oxfw_stream_lock_release(oxfw);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-midi.c |
static void set_midi_substream_names(struct snd_oxfw *oxfw,
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",
oxfw->card->shortname, sub... | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-pcm.c |
static int init_hw_params(struct snd_oxfw *oxfw,
struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
u8 **formats;
struct amdtp_stream *stream;
int err;
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
runtime->hw.formats = AM824_IN_... | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-pcm.c |
static int pcm_capture_hw_free(struct snd_pcm_substream *substream) {
struct snd_oxfw *oxfw = substream->private_data;
mutex_lock(&oxfw->mutex);
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
--oxfw->substreams_count;
snd_oxfw_stream_stop_duplex(oxfw);
mutex_unlock(&oxfw->mutex);
return 0;... | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-pcm.c |
static int pcm_capture_prepare(struct snd_pcm_substream *substream) {
struct snd_oxfw *oxfw = substream->private_data;
int err;
mutex_lock(&oxfw->mutex);
err = snd_oxfw_stream_start_duplex(oxfw);
mutex_unlock(&oxfw->mutex);
if (err < 0)
goto end;
amdtp_stream_pcm_prepare(&oxfw->tx_stream);
end:
r... | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-pcm.c | static int pcm_playback_prepare(struct snd_pcm_substream *substream) {
struct snd_oxfw *oxfw = substream->private_data;
int err;
mutex_lock(&oxfw->mutex);
err = snd_oxfw_stream_start_duplex(oxfw);
mutex_unlock(&oxfw->mutex);
if (err < 0)
goto end;
amdtp_stream_pcm_prepare(&oxfw->rx_stream);
end:
r... | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-scs1x.c |
static void midi_input_escaped_byte(struct snd_rawmidi_substream *stream,
u8 byte) {
u8 nibbles[2];
nibbles[0] = byte >> 4;
nibbles[1] = byte & 0x0f;
snd_rawmidi_receive(stream, nibbles, 2);
} | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-scs1x.c |
static void midi_input_packet(struct fw_scs1x *scs,
struct snd_rawmidi_substream *stream,
const u8 *data, unsigned int bytes) {
unsigned int i;
const u8 eox = 0xf7;
if (data[0] == HSS1394_TAG_USER_DATA) {
for (i = 1; i < bytes; ++i)
midi_inpu... | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-scs1x.c |
static bool is_one_byte_cmd(u8 status) {
return status == 0xf6 || status >= 0xf8;
} | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-scs1x.c |
static bool is_three_bytes_cmd(u8 status) {
return (status >= 0x80 && status <= 0xbf) ||
(status >= 0xe0 && status <= 0xef) || status == 0xf2;
} | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-scs1x.c |
static bool is_invalid_cmd(u8 status) {
return status == 0xf4 || status == 0xf5 || status == 0xf9 || status == 0xfd;
} | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-spkr.c |
static int spkr_mute_get(struct snd_kcontrol *control,
struct snd_ctl_elem_value *value) {
struct snd_oxfw *oxfw = control->private_data;
struct fw_spkr *spkr = oxfw->spec;
value->value.integer.value[0] = !spkr->mute;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-spkr.c |
static int spkr_volume_put(struct snd_kcontrol *control,
struct snd_ctl_elem_value *value) {
struct snd_oxfw *oxfw = control->private_data;
struct fw_spkr *spkr = oxfw->spec;
unsigned int i, changed_channels;
bool equal_values = true;
s16 volume;
int err;
for (i = 0; i < spkr-... | [
1,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-stream.c |
static int check_connection_used_by_others(struct snd_oxfw *oxfw,
struct amdtp_stream *stream) {
struct cmp_connection *conn;
bool used;
int err;
if (stream == &oxfw->tx_stream)
conn = &oxfw->out_conn;
else
conn = &oxfw->in_conn;
err = cmp_connection_che... | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-stream.c | static int keep_resources(struct snd_oxfw *oxfw, struct amdtp_stream *stream) {
enum avc_general_plug_dir dir;
u8 **formats;
struct snd_oxfw_stream_formation formation;
struct cmp_connection *conn;
int i;
int err;
if (stream == &oxfw->rx_stream) {
dir = AVC_GENERAL_PLUG_DIR_IN;
formats = oxfw->rx... | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-stream.c |
void snd_oxfw_stream_stop_duplex(struct snd_oxfw *oxfw) {
if (oxfw->substreams_count == 0) {
amdtp_domain_stop(&oxfw->domain);
cmp_connection_break(&oxfw->in_conn);
cmp_connection_release(&oxfw->in_conn);
if (oxfw->has_output) {
cmp_connection_break(&oxfw->out_conn);
cmp_connection_rele... | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-stream.c |
void snd_oxfw_stream_update_duplex(struct snd_oxfw *oxfw) {
amdtp_domain_stop(&oxfw->domain);
cmp_connection_break(&oxfw->in_conn);
amdtp_stream_pcm_abort(&oxfw->rx_stream);
if (oxfw->has_output) {
cmp_connection_break(&oxfw->out_conn);
amdtp_stream_pcm_abort(&oxfw->tx_stream);
}
} | [
0,
0
] |
Linux Kernel | sound/firewire/oxfw/oxfw-stream.c | static int assume_stream_formats(struct snd_oxfw *oxfw,
enum avc_general_plug_dir dir,
unsigned int pid, u8 *buf, unsigned int *len,
u8 **formats) {
struct snd_oxfw_stream_formation formation;
unsigned int i, eid;
i... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.