Skip to content

Commit 9883b38

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-motu: use table-based calculation of packet formats for proc
This commit uses table-based calculation of packet formats for proc nodes. Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 0090c1c commit 9883b38

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

sound/firewire/motu/motu-pcm.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ static int motu_rate_constraint(struct snd_pcm_hw_params *params,
2626
rate = snd_motu_clock_rates[i];
2727
mode = i / 2;
2828

29-
pcm_channels = formats->fixed_part_pcm_chunks[mode] +
30-
formats->differed_part_pcm_chunks[mode];
29+
pcm_channels = formats->pcm_chunks[mode];
3130
if (!snd_interval_test(c, pcm_channels))
3231
continue;
3332

@@ -59,8 +58,7 @@ static int motu_channels_constraint(struct snd_pcm_hw_params *params,
5958
if (!snd_interval_test(r, rate))
6059
continue;
6160

62-
pcm_channels = formats->fixed_part_pcm_chunks[mode] +
63-
formats->differed_part_pcm_chunks[mode];
61+
pcm_channels = formats->pcm_chunks[mode];
6462
channels.min = min(channels.min, pcm_channels);
6563
channels.max = max(channels.max, pcm_channels);
6664
}
@@ -82,8 +80,7 @@ static void limit_channels_and_rates(struct snd_motu *motu,
8280
rate = snd_motu_clock_rates[i];
8381
mode = i / 2;
8482

85-
pcm_channels = formats->fixed_part_pcm_chunks[mode] +
86-
formats->differed_part_pcm_chunks[mode];
83+
pcm_channels = formats->pcm_chunks[mode];
8784
if (pcm_channels == 0)
8885
continue;
8986

sound/firewire/motu/motu-proc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void proc_read_format(struct snd_info_entry *entry,
5151
if (snd_motu_protocol_cache_packet_formats(motu) < 0)
5252
return;
5353

54-
snd_iprintf(buffer, "tx:\tmsg\tfixed\tdiffered\n");
54+
snd_iprintf(buffer, "tx:\tmsg\tfixed\ttotal\n");
5555
for (i = 0; i < SND_MOTU_CLOCK_RATE_COUNT; ++i) {
5656
mode = i >> 1;
5757

@@ -60,11 +60,11 @@ static void proc_read_format(struct snd_info_entry *entry,
6060
"%u:\t%u\t%u\t%u\n",
6161
snd_motu_clock_rates[i],
6262
formats->msg_chunks,
63-
formats->fixed_part_pcm_chunks[mode],
64-
formats->differed_part_pcm_chunks[mode]);
63+
motu->spec->tx_fixed_pcm_chunks[mode],
64+
formats->pcm_chunks[mode]);
6565
}
6666

67-
snd_iprintf(buffer, "rx:\tmsg\tfixed\tdiffered\n");
67+
snd_iprintf(buffer, "rx:\tmsg\tfixed\ttotal\n");
6868
for (i = 0; i < SND_MOTU_CLOCK_RATE_COUNT; ++i) {
6969
mode = i >> 1;
7070

@@ -73,8 +73,8 @@ static void proc_read_format(struct snd_info_entry *entry,
7373
"%u:\t%u\t%u\t%u\n",
7474
snd_motu_clock_rates[i],
7575
formats->msg_chunks,
76-
formats->fixed_part_pcm_chunks[mode],
77-
formats->differed_part_pcm_chunks[mode]);
76+
motu->spec->rx_fixed_pcm_chunks[mode],
77+
formats->pcm_chunks[mode]);
7878
}
7979
}
8080

0 commit comments

Comments
 (0)