summaryrefslogtreecommitdiff
path: root/sound/firewire/motu/amdtp-motu.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2020-05-19 14:16:37 +0300
committerTakashi Iwai <tiwai@suse.de>2020-05-22 17:52:16 +0300
commit88e8f89dcc66eafcd4c11fd41988ebe22b793df1 (patch)
treefe0b4280ee46b8e987a216143a24e00d2a10b2b3 /sound/firewire/motu/amdtp-motu.c
parent9883b3850fba6c2842a15ac3b38e36b214e03ddf (diff)
downloadlinux-88e8f89dcc66eafcd4c11fd41988ebe22b793df1.tar.xz
ALSA: firewire-motu: use table-based calculation of packet formats for stream management
This commit uses table-based calculation of packet formats for stream management. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20200519111641.123211-11-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/amdtp-motu.c')
-rw-r--r--sound/firewire/motu/amdtp-motu.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/firewire/motu/amdtp-motu.c b/sound/firewire/motu/amdtp-motu.c
index 17c9ea8eb4c8..edb31ac26868 100644
--- a/sound/firewire/motu/amdtp-motu.c
+++ b/sound/firewire/motu/amdtp-motu.c
@@ -76,15 +76,11 @@ int amdtp_motu_set_parameters(struct amdtp_stream *s, unsigned int rate,
if (i == ARRAY_SIZE(snd_motu_clock_rates))
return -EINVAL;
- pcm_chunks = formats->fixed_part_pcm_chunks[mode] +
- formats->differed_part_pcm_chunks[mode];
+ // Each data block includes SPH in its head. Data chunks follow with
+ // 3 byte alignment. Padding follows with zero to conform to quadlet
+ // alignment.
+ pcm_chunks = formats->pcm_chunks[mode];
data_chunks = formats->msg_chunks + pcm_chunks;
-
- /*
- * Each data block includes SPH in its head. Data chunks follow with
- * 3 byte alignment. Padding follows with zero to conform to quadlet
- * alignment.
- */
data_block_quadlets = 1 + DIV_ROUND_UP(data_chunks * 3, 4);
err = amdtp_stream_set_parameters(s, rate, data_block_quadlets);