aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/dice.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 09:44:42 -0400
committerTakashi Iwai <tiwai@suse.de>2014-05-26 08:11:10 -0400
commitbe4a28940a997311162b487c9b398eec435d9661 (patch)
tree9d41bf87d5306dcceb68dffcc7fab15b2eae54d9 /sound/firewire/dice.c
parent4b660a7f5c8099d88d1a43d8ae138965112592c7 (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/dice.c')
-rw-r--r--sound/firewire/dice.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/sound/firewire/dice.c b/sound/firewire/dice.c
index 0c3948630cf7..ca12fcbc65ec 100644
--- a/sound/firewire/dice.c
+++ b/sound/firewire/dice.c
@@ -51,7 +51,7 @@ struct dice {
51 wait_queue_head_t hwdep_wait; 51 wait_queue_head_t hwdep_wait;
52 u32 notification_bits; 52 u32 notification_bits;
53 struct fw_iso_resources resources; 53 struct fw_iso_resources resources;
54 struct amdtp_out_stream stream; 54 struct amdtp_stream stream;
55}; 55};
56 56
57MODULE_DESCRIPTION("DICE driver"); 57MODULE_DESCRIPTION("DICE driver");
@@ -460,17 +460,17 @@ static int dice_stream_start_packets(struct dice *dice)
460{ 460{
461 int err; 461 int err;
462 462
463 if (amdtp_out_stream_running(&dice->stream)) 463 if (amdtp_stream_running(&dice->stream))
464 return 0; 464 return 0;
465 465
466 err = amdtp_out_stream_start(&dice->stream, dice->resources.channel, 466 err = amdtp_stream_start(&dice->stream, dice->resources.channel,
467 fw_parent_device(dice->unit)->max_speed); 467 fw_parent_device(dice->unit)->max_speed);
468 if (err < 0) 468 if (err < 0)
469 return err; 469 return err;
470 470
471 err = dice_enable_set(dice); 471 err = dice_enable_set(dice);
472 if (err < 0) { 472 if (err < 0) {
473 amdtp_out_stream_stop(&dice->stream); 473 amdtp_stream_stop(&dice->stream);
474 return err; 474 return err;
475 } 475 }
476 476
@@ -484,7 +484,7 @@ static int dice_stream_start(struct dice *dice)
484 484
485 if (!dice->resources.allocated) { 485 if (!dice->resources.allocated) {
486 err = fw_iso_resources_allocate(&dice->resources, 486 err = fw_iso_resources_allocate(&dice->resources,
487 amdtp_out_stream_get_max_payload(&dice->stream), 487 amdtp_stream_get_max_payload(&dice->stream),
488 fw_parent_device(dice->unit)->max_speed); 488 fw_parent_device(dice->unit)->max_speed);
489 if (err < 0) 489 if (err < 0)
490 goto error; 490 goto error;
@@ -516,9 +516,9 @@ error:
516 516
517static void dice_stream_stop_packets(struct dice *dice) 517static void dice_stream_stop_packets(struct dice *dice)
518{ 518{
519 if (amdtp_out_stream_running(&dice->stream)) { 519 if (amdtp_stream_running(&dice->stream)) {
520 dice_enable_clear(dice); 520 dice_enable_clear(dice);
521 amdtp_out_stream_stop(&dice->stream); 521 amdtp_stream_stop(&dice->stream);
522 } 522 }
523} 523}
524 524
@@ -581,12 +581,12 @@ static int dice_hw_params(struct snd_pcm_substream *substream,
581 return err; 581 return err;
582 582
583 mode = rate_index_to_mode(rate_index); 583 mode = rate_index_to_mode(rate_index);
584 amdtp_out_stream_set_parameters(&dice->stream, 584 amdtp_stream_set_parameters(&dice->stream,
585 params_rate(hw_params), 585 params_rate(hw_params),
586 params_channels(hw_params), 586 params_channels(hw_params),
587 dice->rx_midi_ports[mode]); 587 dice->rx_midi_ports[mode]);
588 amdtp_out_stream_set_pcm_format(&dice->stream, 588 amdtp_stream_set_pcm_format(&dice->stream,
589 params_format(hw_params)); 589 params_format(hw_params));
590 590
591 return 0; 591 return 0;
592} 592}
@@ -609,7 +609,7 @@ static int dice_prepare(struct snd_pcm_substream *substream)
609 609
610 mutex_lock(&dice->mutex); 610 mutex_lock(&dice->mutex);
611 611
612 if (amdtp_out_streaming_error(&dice->stream)) 612 if (amdtp_streaming_error(&dice->stream))
613 dice_stream_stop_packets(dice); 613 dice_stream_stop_packets(dice);
614 614
615 err = dice_stream_start(dice); 615 err = dice_stream_start(dice);
@@ -620,7 +620,7 @@ static int dice_prepare(struct snd_pcm_substream *substream)
620 620
621 mutex_unlock(&dice->mutex); 621 mutex_unlock(&dice->mutex);
622 622
623 amdtp_out_stream_pcm_prepare(&dice->stream); 623 amdtp_stream_pcm_prepare(&dice->stream);
624 624
625 return 0; 625 return 0;
626} 626}
@@ -640,7 +640,7 @@ static int dice_trigger(struct snd_pcm_substream *substream, int cmd)
640 default: 640 default:
641 return -EINVAL; 641 return -EINVAL;
642 } 642 }
643 amdtp_out_stream_pcm_trigger(&dice->stream, pcm); 643 amdtp_stream_pcm_trigger(&dice->stream, pcm);
644 644
645 return 0; 645 return 0;
646} 646}
@@ -649,7 +649,7 @@ static snd_pcm_uframes_t dice_pointer(struct snd_pcm_substream *substream)
649{ 649{
650 struct dice *dice = substream->private_data; 650 struct dice *dice = substream->private_data;
651 651
652 return amdtp_out_stream_pcm_pointer(&dice->stream); 652 return amdtp_stream_pcm_pointer(&dice->stream);
653} 653}
654 654
655static int dice_create_pcm(struct dice *dice) 655static int dice_create_pcm(struct dice *dice)
@@ -1104,7 +1104,7 @@ static void dice_card_free(struct snd_card *card)
1104{ 1104{
1105 struct dice *dice = card->private_data; 1105 struct dice *dice = card->private_data;
1106 1106
1107 amdtp_out_stream_destroy(&dice->stream); 1107 amdtp_stream_destroy(&dice->stream);
1108 fw_core_remove_address_handler(&dice->notification_handler); 1108 fw_core_remove_address_handler(&dice->notification_handler);
1109 mutex_destroy(&dice->mutex); 1109 mutex_destroy(&dice->mutex);
1110} 1110}
@@ -1360,8 +1360,8 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
1360 goto err_owner; 1360 goto err_owner;
1361 dice->resources.channels_mask = 0x00000000ffffffffuLL; 1361 dice->resources.channels_mask = 0x00000000ffffffffuLL;
1362 1362
1363 err = amdtp_out_stream_init(&dice->stream, unit, 1363 err = amdtp_stream_init(&dice->stream, unit,
1364 CIP_BLOCKING | CIP_HI_DUALWIRE); 1364 CIP_BLOCKING | CIP_HI_DUALWIRE);
1365 if (err < 0) 1365 if (err < 0)
1366 goto err_resources; 1366 goto err_resources;
1367 1367
@@ -1417,7 +1417,7 @@ static void dice_remove(struct fw_unit *unit)
1417{ 1417{
1418 struct dice *dice = dev_get_drvdata(&unit->device); 1418 struct dice *dice = dev_get_drvdata(&unit->device);
1419 1419
1420 amdtp_out_stream_pcm_abort(&dice->stream); 1420 amdtp_stream_pcm_abort(&dice->stream);
1421 1421
1422 snd_card_disconnect(dice->card); 1422 snd_card_disconnect(dice->card);
1423 1423
@@ -1443,7 +1443,7 @@ static void dice_bus_reset(struct fw_unit *unit)
1443 * to stop so that the application can restart them in an orderly 1443 * to stop so that the application can restart them in an orderly
1444 * manner. 1444 * manner.
1445 */ 1445 */
1446 amdtp_out_stream_pcm_abort(&dice->stream); 1446 amdtp_stream_pcm_abort(&dice->stream);
1447 1447
1448 mutex_lock(&dice->mutex); 1448 mutex_lock(&dice->mutex);
1449 1449