diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-04-25 22:45:02 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-26 14:24:19 +0200 |
commit | 315fd41fe9d43838ab5afd26c58d908d18313d9a (patch) | |
tree | 4dbd346fcffb9df2dccd9110793ad38d5e27e2b9 /sound/firewire/fireworks/fireworks.h | |
parent | bde8a8f23bbe6db51fa4e81644273af18fef3d7a (diff) | |
download | blackbird-op-linux-315fd41fe9d43838ab5afd26c58d908d18313d9a.tar.gz blackbird-op-linux-315fd41fe9d43838ab5afd26c58d908d18313d9a.zip |
ALSA: fireworks: Add connection and stream management
Fireworks manages connections by CMP and can transmit/receive AMDTP streams
with a few quirks. This commit adds functionality to start/stop the streams.
Major Fireworks products don't support 'SYT-Match' clock source mode, except
for AudioFire12/8(till 2009 July) with firmware version 1.0. Already in
previous commit, this driver don't support such old firmwares. So this commit
adds support for non 'SYT-Match' clock source modes.
I note that this driver has a short gap for MIDI streams when starting PCM
stream. When AMDTP streams are running only for MIDI data and PCM data is
going to be joined at different sampling rate, then AMDTP streams are
stopped once and started again after changing sampling rate.
Unfortunately, Fireworks is not fully compliant to IEC 61883-1/6. Some commits
following to this commit add these quirks.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireworks/fireworks.h')
-rw-r--r-- | sound/firewire/fireworks/fireworks.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sound/firewire/fireworks/fireworks.h b/sound/firewire/fireworks/fireworks.h index e999802ab470..ce511be4611b 100644 --- a/sound/firewire/fireworks/fireworks.h +++ b/sound/firewire/fireworks/fireworks.h @@ -22,9 +22,15 @@ #include <sound/initval.h> #include <sound/pcm.h> +#include "../packets-buffer.h" +#include "../iso-resources.h" +#include "../amdtp.h" #include "../cmp.h" #include "../lib.h" +#define SND_EFW_MAX_MIDI_OUT_PORTS 2 +#define SND_EFW_MAX_MIDI_IN_PORTS 2 + #define SND_EFW_MULTIPLIER_MODES 3 #define HWINFO_NAME_SIZE_BYTES 32 #define HWINFO_MAX_CAPS_GROUPS 8 @@ -54,6 +60,21 @@ struct snd_efw { /* for transaction */ u32 seqnum; bool resp_addr_changable; + + unsigned int midi_in_ports; + unsigned int midi_out_ports; + + unsigned int supported_sampling_rate; + unsigned int pcm_capture_channels[SND_EFW_MULTIPLIER_MODES]; + unsigned int pcm_playback_channels[SND_EFW_MULTIPLIER_MODES]; + + struct amdtp_stream *master; + struct amdtp_stream tx_stream; + struct amdtp_stream rx_stream; + struct cmp_connection out_conn; + struct cmp_connection in_conn; + atomic_t capture_substreams; + atomic_t playback_substreams; }; struct snd_efw_transaction { @@ -156,6 +177,12 @@ int snd_efw_command_get_clock_source(struct snd_efw *efw, int snd_efw_command_get_sampling_rate(struct snd_efw *efw, unsigned int *rate); int snd_efw_command_set_sampling_rate(struct snd_efw *efw, unsigned int rate); +int snd_efw_stream_init_duplex(struct snd_efw *efw); +int snd_efw_stream_start_duplex(struct snd_efw *efw, int sampling_rate); +void snd_efw_stream_stop_duplex(struct snd_efw *efw); +void snd_efw_stream_update_duplex(struct snd_efw *efw); +void snd_efw_stream_destroy_duplex(struct snd_efw *efw); + #define SND_EFW_DEV_ENTRY(vendor, model) \ { \ .match_flags = IEEE1394_MATCH_VENDOR_ID | \ |