summaryrefslogtreecommitdiff
path: root/sound/firewire/dice/dice.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-12-09 00:10:36 +0900
committerTakashi Iwai <tiwai@suse.de>2014-12-10 10:44:54 +0100
commit9a02843caefbc370ef6d5895881101f9436f98da (patch)
tree7dd629455220cf9e20f79bd8be51805b905058f4 /sound/firewire/dice/dice.h
parent288a8d0cb04f7715c7c302c8a40bdb227142f3a6 (diff)
ALSA: dice: Add support for duplex streams with synchronization
This commit adds support for AMDTP in-stream. As a result, Dice driver supports full duplex streams with synchronization. AMDTP can transfer timestamps in its packets. By handling the timestamp, devices can synchronize to the other devices or drivers on the same bus. When Dice chipset is 'enabled', it starts streams with correct settings. This 'enable' register is global, thus, when a stream is started to run, an opposite stream can't start unless turning off 'enable'. Therefore a pair of streams must be running. This causes a loss of CPU usage when single stream is needed for neither playbacking or capturing. This commit assumes that playback-only models also have a functionality to transmit stream for delivering timestamps. Currently, sampling clock source is restricted to SYT-Match mode. This is improved in followed commit. I note that at SYT-Match mode, Dice can select from 4 streams for synchronization but this driver uses the 1st stream only for simplicity. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/dice/dice.h')
-rw-r--r--sound/firewire/dice/dice.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h
index 8be530fe1c34..a62ee22da5cc 100644
--- a/sound/firewire/dice/dice.h
+++ b/sound/firewire/dice/dice.h
@@ -52,18 +52,28 @@ struct snd_dice {
unsigned int rsrv_offset;
unsigned int clock_caps;
+ unsigned int tx_channels[3];
unsigned int rx_channels[3];
+ unsigned int tx_midi_ports[3];
unsigned int rx_midi_ports[3];
+
struct fw_address_handler notification_handler;
int owner_generation;
+ u32 notification_bits;
+
+ /* For uapi */
int dev_lock_count; /* > 0 driver, < 0 userspace */
bool dev_lock_changed;
- bool global_enabled;
- struct completion clock_accepted;
wait_queue_head_t hwdep_wait;
- u32 notification_bits;
+
+ /* For streaming */
+ struct fw_iso_resources tx_resources;
struct fw_iso_resources rx_resources;
+ struct amdtp_stream tx_stream;
struct amdtp_stream rx_stream;
+ bool global_enabled;
+ struct completion clock_accepted;
+ unsigned int substreams_counter;
};
enum snd_dice_addr_type {
@@ -160,11 +170,11 @@ extern const unsigned int snd_dice_rates[SND_DICE_RATES_COUNT];
int snd_dice_stream_get_rate_mode(struct snd_dice *dice,
unsigned int rate, unsigned int *mode);
-int snd_dice_stream_start(struct snd_dice *dice, unsigned int rate);
-void snd_dice_stream_stop(struct snd_dice *dice);
-int snd_dice_stream_init(struct snd_dice *dice);
-void snd_dice_stream_destroy(struct snd_dice *dice);
-void snd_dice_stream_update(struct snd_dice *dice);
+int snd_dice_stream_start_duplex(struct snd_dice *dice, unsigned int rate);
+void snd_dice_stream_stop_duplex(struct snd_dice *dice);
+int snd_dice_stream_init_duplex(struct snd_dice *dice);
+void snd_dice_stream_destroy_duplex(struct snd_dice *dice);
+void snd_dice_stream_update_duplex(struct snd_dice *dice);
int snd_dice_stream_lock_try(struct snd_dice *dice);
void snd_dice_stream_lock_release(struct snd_dice *dice);