diff options
Diffstat (limited to 'sound/firewire/amdtp.c')
-rw-r--r-- | sound/firewire/amdtp.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index 7c814ace9e58..5b8846123474 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c | |||
@@ -105,6 +105,17 @@ const unsigned int amdtp_syt_intervals[CIP_SFC_COUNT] = { | |||
105 | }; | 105 | }; |
106 | EXPORT_SYMBOL(amdtp_syt_intervals); | 106 | EXPORT_SYMBOL(amdtp_syt_intervals); |
107 | 107 | ||
108 | const unsigned int amdtp_rate_table[] = { | ||
109 | [CIP_SFC_32000] = 32000, | ||
110 | [CIP_SFC_44100] = 44100, | ||
111 | [CIP_SFC_48000] = 48000, | ||
112 | [CIP_SFC_88200] = 88200, | ||
113 | [CIP_SFC_96000] = 96000, | ||
114 | [CIP_SFC_176400] = 176400, | ||
115 | [CIP_SFC_192000] = 192000, | ||
116 | }; | ||
117 | EXPORT_SYMBOL(amdtp_rate_table); | ||
118 | |||
108 | /** | 119 | /** |
109 | * amdtp_stream_add_pcm_hw_constraints - add hw constraints for PCM substream | 120 | * amdtp_stream_add_pcm_hw_constraints - add hw constraints for PCM substream |
110 | * @s: the AMDTP stream, which must be initialized. | 121 | * @s: the AMDTP stream, which must be initialized. |
@@ -176,15 +187,6 @@ void amdtp_stream_set_parameters(struct amdtp_stream *s, | |||
176 | unsigned int pcm_channels, | 187 | unsigned int pcm_channels, |
177 | unsigned int midi_ports) | 188 | unsigned int midi_ports) |
178 | { | 189 | { |
179 | static const unsigned int rates[] = { | ||
180 | [CIP_SFC_32000] = 32000, | ||
181 | [CIP_SFC_44100] = 44100, | ||
182 | [CIP_SFC_48000] = 48000, | ||
183 | [CIP_SFC_88200] = 88200, | ||
184 | [CIP_SFC_96000] = 96000, | ||
185 | [CIP_SFC_176400] = 176400, | ||
186 | [CIP_SFC_192000] = 192000, | ||
187 | }; | ||
188 | unsigned int i, sfc, midi_channels; | 190 | unsigned int i, sfc, midi_channels; |
189 | 191 | ||
190 | midi_channels = DIV_ROUND_UP(midi_ports, 8); | 192 | midi_channels = DIV_ROUND_UP(midi_ports, 8); |
@@ -194,8 +196,8 @@ void amdtp_stream_set_parameters(struct amdtp_stream *s, | |||
194 | WARN_ON(midi_channels > AMDTP_MAX_CHANNELS_FOR_MIDI)) | 196 | WARN_ON(midi_channels > AMDTP_MAX_CHANNELS_FOR_MIDI)) |
195 | return; | 197 | return; |
196 | 198 | ||
197 | for (sfc = 0; sfc < CIP_SFC_COUNT; ++sfc) | 199 | for (sfc = 0; sfc < sizeof(amdtp_rate_table); ++sfc) |
198 | if (rates[sfc] == rate) | 200 | if (amdtp_rate_table[sfc] == rate) |
199 | goto sfc_found; | 201 | goto sfc_found; |
200 | WARN_ON(1); | 202 | WARN_ON(1); |
201 | return; | 203 | return; |