diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-04-25 09:44:42 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-26 08:11:10 -0400 |
commit | be4a28940a997311162b487c9b398eec435d9661 (patch) | |
tree | 9d41bf87d5306dcceb68dffcc7fab15b2eae54d9 /sound/firewire/amdtp.c | |
parent | 4b660a7f5c8099d88d1a43d8ae138965112592c7 (diff) |
ALSA: firewire-lib: Rename functions, structure, member for AMDTP
This patch renames some functions, a structure and its member to reuse them
in both AMDTP in/out stream.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp.c')
-rw-r--r-- | sound/firewire/amdtp.c | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index 9048777228e2..16fe858925bd 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c | |||
@@ -34,13 +34,13 @@ | |||
34 | static void pcm_period_tasklet(unsigned long data); | 34 | static void pcm_period_tasklet(unsigned long data); |
35 | 35 | ||
36 | /** | 36 | /** |
37 | * amdtp_out_stream_init - initialize an AMDTP output stream structure | 37 | * amdtp_stream_init - initialize an AMDTP stream structure |
38 | * @s: the AMDTP output stream to initialize | 38 | * @s: the AMDTP stream to initialize |
39 | * @unit: the target of the stream | 39 | * @unit: the target of the stream |
40 | * @flags: the packet transmission method to use | 40 | * @flags: the packet transmission method to use |
41 | */ | 41 | */ |
42 | int amdtp_out_stream_init(struct amdtp_out_stream *s, struct fw_unit *unit, | 42 | int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit, |
43 | enum cip_out_flags flags) | 43 | enum cip_flags flags) |
44 | { | 44 | { |
45 | s->unit = fw_unit_get(unit); | 45 | s->unit = fw_unit_get(unit); |
46 | s->flags = flags; | 46 | s->flags = flags; |
@@ -51,19 +51,19 @@ int amdtp_out_stream_init(struct amdtp_out_stream *s, struct fw_unit *unit, | |||
51 | 51 | ||
52 | return 0; | 52 | return 0; |
53 | } | 53 | } |
54 | EXPORT_SYMBOL(amdtp_out_stream_init); | 54 | EXPORT_SYMBOL(amdtp_stream_init); |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * amdtp_out_stream_destroy - free stream resources | 57 | * amdtp_stream_destroy - free stream resources |
58 | * @s: the AMDTP output stream to destroy | 58 | * @s: the AMDTP stream to destroy |
59 | */ | 59 | */ |
60 | void amdtp_out_stream_destroy(struct amdtp_out_stream *s) | 60 | void amdtp_stream_destroy(struct amdtp_stream *s) |
61 | { | 61 | { |
62 | WARN_ON(amdtp_out_stream_running(s)); | 62 | WARN_ON(amdtp_stream_running(s)); |
63 | mutex_destroy(&s->mutex); | 63 | mutex_destroy(&s->mutex); |
64 | fw_unit_put(s->unit); | 64 | fw_unit_put(s->unit); |
65 | } | 65 | } |
66 | EXPORT_SYMBOL(amdtp_out_stream_destroy); | 66 | EXPORT_SYMBOL(amdtp_stream_destroy); |
67 | 67 | ||
68 | const unsigned int amdtp_syt_intervals[CIP_SFC_COUNT] = { | 68 | const unsigned int amdtp_syt_intervals[CIP_SFC_COUNT] = { |
69 | [CIP_SFC_32000] = 8, | 69 | [CIP_SFC_32000] = 8, |
@@ -77,8 +77,8 @@ const unsigned int amdtp_syt_intervals[CIP_SFC_COUNT] = { | |||
77 | EXPORT_SYMBOL(amdtp_syt_intervals); | 77 | EXPORT_SYMBOL(amdtp_syt_intervals); |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * amdtp_out_stream_set_parameters - set stream parameters | 80 | * amdtp_stream_set_parameters - set stream parameters |
81 | * @s: the AMDTP output stream to configure | 81 | * @s: the AMDTP stream to configure |
82 | * @rate: the sample rate | 82 | * @rate: the sample rate |
83 | * @pcm_channels: the number of PCM samples in each data block, to be encoded | 83 | * @pcm_channels: the number of PCM samples in each data block, to be encoded |
84 | * as AM824 multi-bit linear audio | 84 | * as AM824 multi-bit linear audio |
@@ -87,10 +87,10 @@ EXPORT_SYMBOL(amdtp_syt_intervals); | |||
87 | * The parameters must be set before the stream is started, and must not be | 87 | * The parameters must be set before the stream is started, and must not be |
88 | * changed while the stream is running. | 88 | * changed while the stream is running. |
89 | */ | 89 | */ |
90 | void amdtp_out_stream_set_parameters(struct amdtp_out_stream *s, | 90 | void amdtp_stream_set_parameters(struct amdtp_stream *s, |
91 | unsigned int rate, | 91 | unsigned int rate, |
92 | unsigned int pcm_channels, | 92 | unsigned int pcm_channels, |
93 | unsigned int midi_ports) | 93 | unsigned int midi_ports) |
94 | { | 94 | { |
95 | static const unsigned int rates[] = { | 95 | static const unsigned int rates[] = { |
96 | [CIP_SFC_32000] = 32000, | 96 | [CIP_SFC_32000] = 32000, |
@@ -103,7 +103,7 @@ void amdtp_out_stream_set_parameters(struct amdtp_out_stream *s, | |||
103 | }; | 103 | }; |
104 | unsigned int sfc; | 104 | unsigned int sfc; |
105 | 105 | ||
106 | if (WARN_ON(amdtp_out_stream_running(s))) | 106 | if (WARN_ON(amdtp_stream_running(s))) |
107 | return; | 107 | return; |
108 | 108 | ||
109 | for (sfc = 0; sfc < CIP_SFC_COUNT; ++sfc) | 109 | for (sfc = 0; sfc < CIP_SFC_COUNT; ++sfc) |
@@ -132,47 +132,47 @@ sfc_found: | |||
132 | /* additional buffering needed to adjust for no-data packets */ | 132 | /* additional buffering needed to adjust for no-data packets */ |
133 | s->transfer_delay += TICKS_PER_SECOND * s->syt_interval / rate; | 133 | s->transfer_delay += TICKS_PER_SECOND * s->syt_interval / rate; |
134 | } | 134 | } |
135 | EXPORT_SYMBOL(amdtp_out_stream_set_parameters); | 135 | EXPORT_SYMBOL(amdtp_stream_set_parameters); |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * amdtp_out_stream_get_max_payload - get the stream's packet size | 138 | * amdtp_stream_get_max_payload - get the stream's packet size |
139 | * @s: the AMDTP output stream | 139 | * @s: the AMDTP stream |
140 | * | 140 | * |
141 | * This function must not be called before the stream has been configured | 141 | * This function must not be called before the stream has been configured |
142 | * with amdtp_out_stream_set_parameters(). | 142 | * with amdtp_stream_set_parameters(). |
143 | */ | 143 | */ |
144 | unsigned int amdtp_out_stream_get_max_payload(struct amdtp_out_stream *s) | 144 | unsigned int amdtp_stream_get_max_payload(struct amdtp_stream *s) |
145 | { | 145 | { |
146 | return 8 + s->syt_interval * s->data_block_quadlets * 4; | 146 | return 8 + s->syt_interval * s->data_block_quadlets * 4; |
147 | } | 147 | } |
148 | EXPORT_SYMBOL(amdtp_out_stream_get_max_payload); | 148 | EXPORT_SYMBOL(amdtp_stream_get_max_payload); |
149 | 149 | ||
150 | static void amdtp_write_s16(struct amdtp_out_stream *s, | 150 | static void amdtp_write_s16(struct amdtp_stream *s, |
151 | struct snd_pcm_substream *pcm, | 151 | struct snd_pcm_substream *pcm, |
152 | __be32 *buffer, unsigned int frames); | 152 | __be32 *buffer, unsigned int frames); |
153 | static void amdtp_write_s32(struct amdtp_out_stream *s, | 153 | static void amdtp_write_s32(struct amdtp_stream *s, |
154 | struct snd_pcm_substream *pcm, | 154 | struct snd_pcm_substream *pcm, |
155 | __be32 *buffer, unsigned int frames); | 155 | __be32 *buffer, unsigned int frames); |
156 | static void amdtp_write_s16_dualwire(struct amdtp_out_stream *s, | 156 | static void amdtp_write_s16_dualwire(struct amdtp_stream *s, |
157 | struct snd_pcm_substream *pcm, | 157 | struct snd_pcm_substream *pcm, |
158 | __be32 *buffer, unsigned int frames); | 158 | __be32 *buffer, unsigned int frames); |
159 | static void amdtp_write_s32_dualwire(struct amdtp_out_stream *s, | 159 | static void amdtp_write_s32_dualwire(struct amdtp_stream *s, |
160 | struct snd_pcm_substream *pcm, | 160 | struct snd_pcm_substream *pcm, |
161 | __be32 *buffer, unsigned int frames); | 161 | __be32 *buffer, unsigned int frames); |
162 | 162 | ||
163 | /** | 163 | /** |
164 | * amdtp_out_stream_set_pcm_format - set the PCM format | 164 | * amdtp_stream_set_pcm_format - set the PCM format |
165 | * @s: the AMDTP output stream to configure | 165 | * @s: the AMDTP stream to configure |
166 | * @format: the format of the ALSA PCM device | 166 | * @format: the format of the ALSA PCM device |
167 | * | 167 | * |
168 | * The sample format must be set after the other paramters (rate/PCM channels/ | 168 | * The sample format must be set after the other paramters (rate/PCM channels/ |
169 | * MIDI) and before the stream is started, and must not be changed while the | 169 | * MIDI) and before the stream is started, and must not be changed while the |
170 | * stream is running. | 170 | * stream is running. |
171 | */ | 171 | */ |
172 | void amdtp_out_stream_set_pcm_format(struct amdtp_out_stream *s, | 172 | void amdtp_stream_set_pcm_format(struct amdtp_stream *s, |
173 | snd_pcm_format_t format) | 173 | snd_pcm_format_t format) |
174 | { | 174 | { |
175 | if (WARN_ON(amdtp_out_stream_running(s))) | 175 | if (WARN_ON(amdtp_stream_running(s))) |
176 | return; | 176 | return; |
177 | 177 | ||
178 | switch (format) { | 178 | switch (format) { |
@@ -193,24 +193,24 @@ void amdtp_out_stream_set_pcm_format(struct amdtp_out_stream *s, | |||
193 | break; | 193 | break; |
194 | } | 194 | } |
195 | } | 195 | } |
196 | EXPORT_SYMBOL(amdtp_out_stream_set_pcm_format); | 196 | EXPORT_SYMBOL(amdtp_stream_set_pcm_format); |
197 | 197 | ||
198 | /** | 198 | /** |
199 | * amdtp_out_stream_pcm_prepare - prepare PCM device for running | 199 | * amdtp_stream_pcm_prepare - prepare PCM device for running |
200 | * @s: the AMDTP output stream | 200 | * @s: the AMDTP stream |
201 | * | 201 | * |
202 | * This function should be called from the PCM device's .prepare callback. | 202 | * This function should be called from the PCM device's .prepare callback. |
203 | */ | 203 | */ |
204 | void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s) | 204 | void amdtp_stream_pcm_prepare(struct amdtp_stream *s) |
205 | { | 205 | { |
206 | tasklet_kill(&s->period_tasklet); | 206 | tasklet_kill(&s->period_tasklet); |
207 | s->pcm_buffer_pointer = 0; | 207 | s->pcm_buffer_pointer = 0; |
208 | s->pcm_period_pointer = 0; | 208 | s->pcm_period_pointer = 0; |
209 | s->pointer_flush = true; | 209 | s->pointer_flush = true; |
210 | } | 210 | } |
211 | EXPORT_SYMBOL(amdtp_out_stream_pcm_prepare); | 211 | EXPORT_SYMBOL(amdtp_stream_pcm_prepare); |
212 | 212 | ||
213 | static unsigned int calculate_data_blocks(struct amdtp_out_stream *s) | 213 | static unsigned int calculate_data_blocks(struct amdtp_stream *s) |
214 | { | 214 | { |
215 | unsigned int phase, data_blocks; | 215 | unsigned int phase, data_blocks; |
216 | 216 | ||
@@ -243,7 +243,7 @@ static unsigned int calculate_data_blocks(struct amdtp_out_stream *s) | |||
243 | return data_blocks; | 243 | return data_blocks; |
244 | } | 244 | } |
245 | 245 | ||
246 | static unsigned int calculate_syt(struct amdtp_out_stream *s, | 246 | static unsigned int calculate_syt(struct amdtp_stream *s, |
247 | unsigned int cycle) | 247 | unsigned int cycle) |
248 | { | 248 | { |
249 | unsigned int syt_offset, phase, index, syt; | 249 | unsigned int syt_offset, phase, index, syt; |
@@ -286,7 +286,7 @@ static unsigned int calculate_syt(struct amdtp_out_stream *s, | |||
286 | } | 286 | } |
287 | } | 287 | } |
288 | 288 | ||
289 | static void amdtp_write_s32(struct amdtp_out_stream *s, | 289 | static void amdtp_write_s32(struct amdtp_stream *s, |
290 | struct snd_pcm_substream *pcm, | 290 | struct snd_pcm_substream *pcm, |
291 | __be32 *buffer, unsigned int frames) | 291 | __be32 *buffer, unsigned int frames) |
292 | { | 292 | { |
@@ -312,7 +312,7 @@ static void amdtp_write_s32(struct amdtp_out_stream *s, | |||
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
315 | static void amdtp_write_s16(struct amdtp_out_stream *s, | 315 | static void amdtp_write_s16(struct amdtp_stream *s, |
316 | struct snd_pcm_substream *pcm, | 316 | struct snd_pcm_substream *pcm, |
317 | __be32 *buffer, unsigned int frames) | 317 | __be32 *buffer, unsigned int frames) |
318 | { | 318 | { |
@@ -338,7 +338,7 @@ static void amdtp_write_s16(struct amdtp_out_stream *s, | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | static void amdtp_write_s32_dualwire(struct amdtp_out_stream *s, | 341 | static void amdtp_write_s32_dualwire(struct amdtp_stream *s, |
342 | struct snd_pcm_substream *pcm, | 342 | struct snd_pcm_substream *pcm, |
343 | __be32 *buffer, unsigned int frames) | 343 | __be32 *buffer, unsigned int frames) |
344 | { | 344 | { |
@@ -369,7 +369,7 @@ static void amdtp_write_s32_dualwire(struct amdtp_out_stream *s, | |||
369 | } | 369 | } |
370 | } | 370 | } |
371 | 371 | ||
372 | static void amdtp_write_s16_dualwire(struct amdtp_out_stream *s, | 372 | static void amdtp_write_s16_dualwire(struct amdtp_stream *s, |
373 | struct snd_pcm_substream *pcm, | 373 | struct snd_pcm_substream *pcm, |
374 | __be32 *buffer, unsigned int frames) | 374 | __be32 *buffer, unsigned int frames) |
375 | { | 375 | { |
@@ -400,7 +400,7 @@ static void amdtp_write_s16_dualwire(struct amdtp_out_stream *s, | |||
400 | } | 400 | } |
401 | } | 401 | } |
402 | 402 | ||
403 | static void amdtp_fill_pcm_silence(struct amdtp_out_stream *s, | 403 | static void amdtp_fill_pcm_silence(struct amdtp_stream *s, |
404 | __be32 *buffer, unsigned int frames) | 404 | __be32 *buffer, unsigned int frames) |
405 | { | 405 | { |
406 | unsigned int i, c; | 406 | unsigned int i, c; |
@@ -412,7 +412,7 @@ static void amdtp_fill_pcm_silence(struct amdtp_out_stream *s, | |||
412 | } | 412 | } |
413 | } | 413 | } |
414 | 414 | ||
415 | static void amdtp_fill_midi(struct amdtp_out_stream *s, | 415 | static void amdtp_fill_midi(struct amdtp_stream *s, |
416 | __be32 *buffer, unsigned int frames) | 416 | __be32 *buffer, unsigned int frames) |
417 | { | 417 | { |
418 | unsigned int i; | 418 | unsigned int i; |
@@ -422,7 +422,7 @@ static void amdtp_fill_midi(struct amdtp_out_stream *s, | |||
422 | cpu_to_be32(0x80000000); | 422 | cpu_to_be32(0x80000000); |
423 | } | 423 | } |
424 | 424 | ||
425 | static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle) | 425 | static void queue_out_packet(struct amdtp_stream *s, unsigned int cycle) |
426 | { | 426 | { |
427 | __be32 *buffer; | 427 | __be32 *buffer; |
428 | unsigned int index, data_blocks, syt, ptr; | 428 | unsigned int index, data_blocks, syt, ptr; |
@@ -473,7 +473,7 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle) | |||
473 | if (err < 0) { | 473 | if (err < 0) { |
474 | dev_err(&s->unit->device, "queueing error: %d\n", err); | 474 | dev_err(&s->unit->device, "queueing error: %d\n", err); |
475 | s->packet_index = -1; | 475 | s->packet_index = -1; |
476 | amdtp_out_stream_pcm_abort(s); | 476 | amdtp_stream_pcm_abort(s); |
477 | return; | 477 | return; |
478 | } | 478 | } |
479 | 479 | ||
@@ -501,7 +501,7 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle) | |||
501 | 501 | ||
502 | static void pcm_period_tasklet(unsigned long data) | 502 | static void pcm_period_tasklet(unsigned long data) |
503 | { | 503 | { |
504 | struct amdtp_out_stream *s = (void *)data; | 504 | struct amdtp_stream *s = (void *)data; |
505 | struct snd_pcm_substream *pcm = ACCESS_ONCE(s->pcm); | 505 | struct snd_pcm_substream *pcm = ACCESS_ONCE(s->pcm); |
506 | 506 | ||
507 | if (pcm) | 507 | if (pcm) |
@@ -509,9 +509,9 @@ static void pcm_period_tasklet(unsigned long data) | |||
509 | } | 509 | } |
510 | 510 | ||
511 | static void out_packet_callback(struct fw_iso_context *context, u32 cycle, | 511 | static void out_packet_callback(struct fw_iso_context *context, u32 cycle, |
512 | size_t header_length, void *header, void *data) | 512 | size_t header_length, void *header, void *private_data) |
513 | { | 513 | { |
514 | struct amdtp_out_stream *s = data; | 514 | struct amdtp_stream *s = private_data; |
515 | unsigned int i, packets = header_length / 4; | 515 | unsigned int i, packets = header_length / 4; |
516 | 516 | ||
517 | /* | 517 | /* |
@@ -526,7 +526,7 @@ static void out_packet_callback(struct fw_iso_context *context, u32 cycle, | |||
526 | fw_iso_context_queue_flush(s->context); | 526 | fw_iso_context_queue_flush(s->context); |
527 | } | 527 | } |
528 | 528 | ||
529 | static int queue_initial_skip_packets(struct amdtp_out_stream *s) | 529 | static int queue_initial_skip_packets(struct amdtp_stream *s) |
530 | { | 530 | { |
531 | struct fw_iso_packet skip_packet = { | 531 | struct fw_iso_packet skip_packet = { |
532 | .skip = 1, | 532 | .skip = 1, |
@@ -548,16 +548,16 @@ static int queue_initial_skip_packets(struct amdtp_out_stream *s) | |||
548 | } | 548 | } |
549 | 549 | ||
550 | /** | 550 | /** |
551 | * amdtp_out_stream_start - start sending packets | 551 | * amdtp_stream_start - start transferring packets |
552 | * @s: the AMDTP output stream to start | 552 | * @s: the AMDTP stream to start |
553 | * @channel: the isochronous channel on the bus | 553 | * @channel: the isochronous channel on the bus |
554 | * @speed: firewire speed code | 554 | * @speed: firewire speed code |
555 | * | 555 | * |
556 | * The stream cannot be started until it has been configured with | 556 | * The stream cannot be started until it has been configured with |
557 | * amdtp_out_stream_set_parameters() and amdtp_out_stream_set_pcm_format(), | 557 | * amdtp_stream_set_parameters() and it must be started before any PCM or MIDI |
558 | * and it must be started before any PCM or MIDI device can be started. | 558 | * device can be started. |
559 | */ | 559 | */ |
560 | int amdtp_out_stream_start(struct amdtp_out_stream *s, int channel, int speed) | 560 | int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed) |
561 | { | 561 | { |
562 | static const struct { | 562 | static const struct { |
563 | unsigned int data_block; | 563 | unsigned int data_block; |
@@ -575,7 +575,7 @@ int amdtp_out_stream_start(struct amdtp_out_stream *s, int channel, int speed) | |||
575 | 575 | ||
576 | mutex_lock(&s->mutex); | 576 | mutex_lock(&s->mutex); |
577 | 577 | ||
578 | if (WARN_ON(amdtp_out_stream_running(s) || | 578 | if (WARN_ON(amdtp_stream_running(s) || |
579 | (!s->pcm_channels && !s->midi_ports))) { | 579 | (!s->pcm_channels && !s->midi_ports))) { |
580 | err = -EBADFD; | 580 | err = -EBADFD; |
581 | goto err_unlock; | 581 | goto err_unlock; |
@@ -586,7 +586,7 @@ int amdtp_out_stream_start(struct amdtp_out_stream *s, int channel, int speed) | |||
586 | s->last_syt_offset = TICKS_PER_CYCLE; | 586 | s->last_syt_offset = TICKS_PER_CYCLE; |
587 | 587 | ||
588 | err = iso_packets_buffer_init(&s->buffer, s->unit, QUEUE_LENGTH, | 588 | err = iso_packets_buffer_init(&s->buffer, s->unit, QUEUE_LENGTH, |
589 | amdtp_out_stream_get_max_payload(s), | 589 | amdtp_stream_get_max_payload(s), |
590 | DMA_TO_DEVICE); | 590 | DMA_TO_DEVICE); |
591 | if (err < 0) | 591 | if (err < 0) |
592 | goto err_unlock; | 592 | goto err_unlock; |
@@ -599,11 +599,11 @@ int amdtp_out_stream_start(struct amdtp_out_stream *s, int channel, int speed) | |||
599 | err = PTR_ERR(s->context); | 599 | err = PTR_ERR(s->context); |
600 | if (err == -EBUSY) | 600 | if (err == -EBUSY) |
601 | dev_err(&s->unit->device, | 601 | dev_err(&s->unit->device, |
602 | "no free output stream on this controller\n"); | 602 | "no free stream on this controller\n"); |
603 | goto err_buffer; | 603 | goto err_buffer; |
604 | } | 604 | } |
605 | 605 | ||
606 | amdtp_out_stream_update(s); | 606 | amdtp_stream_update(s); |
607 | 607 | ||
608 | s->packet_index = 0; | 608 | s->packet_index = 0; |
609 | s->data_block_counter = 0; | 609 | s->data_block_counter = 0; |
@@ -629,15 +629,15 @@ err_unlock: | |||
629 | 629 | ||
630 | return err; | 630 | return err; |
631 | } | 631 | } |
632 | EXPORT_SYMBOL(amdtp_out_stream_start); | 632 | EXPORT_SYMBOL(amdtp_stream_start); |
633 | 633 | ||
634 | /** | 634 | /** |
635 | * amdtp_out_stream_pcm_pointer - get the PCM buffer position | 635 | * amdtp_stream_pcm_pointer - get the PCM buffer position |
636 | * @s: the AMDTP output stream that transports the PCM data | 636 | * @s: the AMDTP stream that transports the PCM data |
637 | * | 637 | * |
638 | * Returns the current buffer position, in frames. | 638 | * Returns the current buffer position, in frames. |
639 | */ | 639 | */ |
640 | unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s) | 640 | unsigned long amdtp_stream_pcm_pointer(struct amdtp_stream *s) |
641 | { | 641 | { |
642 | /* this optimization is allowed to be racy */ | 642 | /* this optimization is allowed to be racy */ |
643 | if (s->pointer_flush) | 643 | if (s->pointer_flush) |
@@ -647,31 +647,31 @@ unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s) | |||
647 | 647 | ||
648 | return ACCESS_ONCE(s->pcm_buffer_pointer); | 648 | return ACCESS_ONCE(s->pcm_buffer_pointer); |
649 | } | 649 | } |
650 | EXPORT_SYMBOL(amdtp_out_stream_pcm_pointer); | 650 | EXPORT_SYMBOL(amdtp_stream_pcm_pointer); |
651 | 651 | ||
652 | /** | 652 | /** |
653 | * amdtp_out_stream_update - update the stream after a bus reset | 653 | * amdtp_stream_update - update the stream after a bus reset |
654 | * @s: the AMDTP output stream | 654 | * @s: the AMDTP stream |
655 | */ | 655 | */ |
656 | void amdtp_out_stream_update(struct amdtp_out_stream *s) | 656 | void amdtp_stream_update(struct amdtp_stream *s) |
657 | { | 657 | { |
658 | ACCESS_ONCE(s->source_node_id_field) = | 658 | ACCESS_ONCE(s->source_node_id_field) = |
659 | (fw_parent_device(s->unit)->card->node_id & 0x3f) << 24; | 659 | (fw_parent_device(s->unit)->card->node_id & 0x3f) << 24; |
660 | } | 660 | } |
661 | EXPORT_SYMBOL(amdtp_out_stream_update); | 661 | EXPORT_SYMBOL(amdtp_stream_update); |
662 | 662 | ||
663 | /** | 663 | /** |
664 | * amdtp_out_stream_stop - stop sending packets | 664 | * amdtp_stream_stop - stop sending packets |
665 | * @s: the AMDTP output stream to stop | 665 | * @s: the AMDTP stream to stop |
666 | * | 666 | * |
667 | * All PCM and MIDI devices of the stream must be stopped before the stream | 667 | * All PCM and MIDI devices of the stream must be stopped before the stream |
668 | * itself can be stopped. | 668 | * itself can be stopped. |
669 | */ | 669 | */ |
670 | void amdtp_out_stream_stop(struct amdtp_out_stream *s) | 670 | void amdtp_stream_stop(struct amdtp_stream *s) |
671 | { | 671 | { |
672 | mutex_lock(&s->mutex); | 672 | mutex_lock(&s->mutex); |
673 | 673 | ||
674 | if (!amdtp_out_stream_running(s)) { | 674 | if (!amdtp_stream_running(s)) { |
675 | mutex_unlock(&s->mutex); | 675 | mutex_unlock(&s->mutex); |
676 | return; | 676 | return; |
677 | } | 677 | } |
@@ -684,16 +684,16 @@ void amdtp_out_stream_stop(struct amdtp_out_stream *s) | |||
684 | 684 | ||
685 | mutex_unlock(&s->mutex); | 685 | mutex_unlock(&s->mutex); |
686 | } | 686 | } |
687 | EXPORT_SYMBOL(amdtp_out_stream_stop); | 687 | EXPORT_SYMBOL(amdtp_stream_stop); |
688 | 688 | ||
689 | /** | 689 | /** |
690 | * amdtp_out_stream_pcm_abort - abort the running PCM device | 690 | * amdtp_stream_pcm_abort - abort the running PCM device |
691 | * @s: the AMDTP stream about to be stopped | 691 | * @s: the AMDTP stream about to be stopped |
692 | * | 692 | * |
693 | * If the isochronous stream needs to be stopped asynchronously, call this | 693 | * If the isochronous stream needs to be stopped asynchronously, call this |
694 | * function first to stop the PCM device. | 694 | * function first to stop the PCM device. |
695 | */ | 695 | */ |
696 | void amdtp_out_stream_pcm_abort(struct amdtp_out_stream *s) | 696 | void amdtp_stream_pcm_abort(struct amdtp_stream *s) |
697 | { | 697 | { |
698 | struct snd_pcm_substream *pcm; | 698 | struct snd_pcm_substream *pcm; |
699 | 699 | ||
@@ -705,4 +705,4 @@ void amdtp_out_stream_pcm_abort(struct amdtp_out_stream *s) | |||
705 | snd_pcm_stream_unlock_irq(pcm); | 705 | snd_pcm_stream_unlock_irq(pcm); |
706 | } | 706 | } |
707 | } | 707 | } |
708 | EXPORT_SYMBOL(amdtp_out_stream_pcm_abort); | 708 | EXPORT_SYMBOL(amdtp_stream_pcm_abort); |