diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-12-16 17:32:30 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-12-16 10:18:25 +0100 |
commit | 76ea46887729d0765b1fd39291a69c2c6781ada0 (patch) | |
tree | abe9281f7614100aa7c9808c961a7880383bd6ac /sound/firewire/fireface/ff.h | |
parent | d4a0b6cbf26ce7c22bcb070595957590736fec85 (diff) | |
download | linux-76ea46887729d0765b1fd39291a69c2c6781ada0.tar.bz2 |
ALSA: fireface: code refactoring to handle multiplier mode
Fireface 400/800 use three modes against the number of data channels in
data block for both tx/rx packets.
This commit adds refactoring for it. Some enumerators are added to
represent each of mode and a function is added to calculate the mode
from sampling frequency code (sfc).
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface/ff.h')
-rw-r--r-- | sound/firewire/fireface/ff.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h index 17332d9ae3f2..9fdda4fbdbba 100644 --- a/sound/firewire/fireface/ff.h +++ b/sound/firewire/fireface/ff.h @@ -31,8 +31,6 @@ #include "../amdtp-stream.h" #include "../iso-resources.h" -#define SND_FF_STREAM_MODES 3 - #define SND_FF_MAXIMIM_MIDI_QUADS 9 #define SND_FF_IN_MIDI_PORTS 2 #define SND_FF_OUT_MIDI_PORTS 2 @@ -42,6 +40,13 @@ #define SND_FF_REG_FETCH_PCM_FRAMES 0x0000801c0000ull #define SND_FF_REG_CLOCK_CONFIG 0x0000801c0004ull +enum snd_ff_stream_mode { + SND_FF_STREAM_MODE_LOW = 0, + SND_FF_STREAM_MODE_MID, + SND_FF_STREAM_MODE_HIGH, + SND_FF_STREAM_MODE_COUNT, +}; + enum snd_ff_reg_type { SND_FF_REG_TYPE_MIDI_HIGH_ADDR = 0, SND_FF_REG_TYPE_COUNT, @@ -51,8 +56,8 @@ struct snd_ff_protocol; struct snd_ff_spec { const char *const name; - const unsigned int pcm_capture_channels[SND_FF_STREAM_MODES]; - const unsigned int pcm_playback_channels[SND_FF_STREAM_MODES]; + const unsigned int pcm_capture_channels[SND_FF_STREAM_MODE_COUNT]; + const unsigned int pcm_playback_channels[SND_FF_STREAM_MODE_COUNT]; unsigned int midi_in_ports; unsigned int midi_out_ports; @@ -129,6 +134,8 @@ int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s, int amdtp_ff_init(struct amdtp_stream *s, struct fw_unit *unit, enum amdtp_stream_direction dir); +int snd_ff_stream_get_multiplier_mode(enum cip_sfc sfc, + enum snd_ff_stream_mode *mode); int snd_ff_stream_init_duplex(struct snd_ff *ff); void snd_ff_stream_destroy_duplex(struct snd_ff *ff); int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate); |