aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme96.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/rme96.c')
-rw-r--r--sound/pci/rme96.c41
1 files changed, 6 insertions, 35 deletions
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index e3304b7ccbcb..0b3c532c4014 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -301,20 +301,6 @@ snd_rme96_capture_ptr(struct rme96 *rme96)
301} 301}
302 302
303static int 303static int
304snd_rme96_ratecode(int rate)
305{
306 switch (rate) {
307 case 32000: return SNDRV_PCM_RATE_32000;
308 case 44100: return SNDRV_PCM_RATE_44100;
309 case 48000: return SNDRV_PCM_RATE_48000;
310 case 64000: return SNDRV_PCM_RATE_64000;
311 case 88200: return SNDRV_PCM_RATE_88200;
312 case 96000: return SNDRV_PCM_RATE_96000;
313 }
314 return 0;
315}
316
317static int
318snd_rme96_playback_silence(struct snd_pcm_substream *substream, 304snd_rme96_playback_silence(struct snd_pcm_substream *substream,
319 int channel, /* not used (interleaved data) */ 305 int channel, /* not used (interleaved data) */
320 snd_pcm_uframes_t pos, 306 snd_pcm_uframes_t pos,
@@ -1176,8 +1162,6 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
1176 struct rme96 *rme96 = snd_pcm_substream_chip(substream); 1162 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1177 struct snd_pcm_runtime *runtime = substream->runtime; 1163 struct snd_pcm_runtime *runtime = substream->runtime;
1178 1164
1179 snd_pcm_set_sync(substream);
1180
1181 spin_lock_irq(&rme96->lock); 1165 spin_lock_irq(&rme96->lock);
1182 if (rme96->playback_substream != NULL) { 1166 if (rme96->playback_substream != NULL) {
1183 spin_unlock_irq(&rme96->lock); 1167 spin_unlock_irq(&rme96->lock);
@@ -1194,7 +1178,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
1194 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0) 1178 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0)
1195 { 1179 {
1196 /* slave clock */ 1180 /* slave clock */
1197 runtime->hw.rates = snd_rme96_ratecode(rate); 1181 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
1198 runtime->hw.rate_min = rate; 1182 runtime->hw.rate_min = rate;
1199 runtime->hw.rate_max = rate; 1183 runtime->hw.rate_max = rate;
1200 } 1184 }
@@ -1214,8 +1198,6 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
1214 struct rme96 *rme96 = snd_pcm_substream_chip(substream); 1198 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1215 struct snd_pcm_runtime *runtime = substream->runtime; 1199 struct snd_pcm_runtime *runtime = substream->runtime;
1216 1200
1217 snd_pcm_set_sync(substream);
1218
1219 runtime->hw = snd_rme96_capture_spdif_info; 1201 runtime->hw = snd_rme96_capture_spdif_info;
1220 if (snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG && 1202 if (snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
1221 (rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) 1203 (rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0)
@@ -1223,7 +1205,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
1223 if (isadat) { 1205 if (isadat) {
1224 return -EIO; 1206 return -EIO;
1225 } 1207 }
1226 runtime->hw.rates = snd_rme96_ratecode(rate); 1208 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
1227 runtime->hw.rate_min = rate; 1209 runtime->hw.rate_min = rate;
1228 runtime->hw.rate_max = rate; 1210 runtime->hw.rate_max = rate;
1229 } 1211 }
@@ -1247,8 +1229,6 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
1247 struct rme96 *rme96 = snd_pcm_substream_chip(substream); 1229 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1248 struct snd_pcm_runtime *runtime = substream->runtime; 1230 struct snd_pcm_runtime *runtime = substream->runtime;
1249 1231
1250 snd_pcm_set_sync(substream);
1251
1252 spin_lock_irq(&rme96->lock); 1232 spin_lock_irq(&rme96->lock);
1253 if (rme96->playback_substream != NULL) { 1233 if (rme96->playback_substream != NULL) {
1254 spin_unlock_irq(&rme96->lock); 1234 spin_unlock_irq(&rme96->lock);
@@ -1265,7 +1245,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
1265 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0) 1245 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0)
1266 { 1246 {
1267 /* slave clock */ 1247 /* slave clock */
1268 runtime->hw.rates = snd_rme96_ratecode(rate); 1248 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
1269 runtime->hw.rate_min = rate; 1249 runtime->hw.rate_min = rate;
1270 runtime->hw.rate_max = rate; 1250 runtime->hw.rate_max = rate;
1271 } 1251 }
@@ -1280,8 +1260,6 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
1280 struct rme96 *rme96 = snd_pcm_substream_chip(substream); 1260 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1281 struct snd_pcm_runtime *runtime = substream->runtime; 1261 struct snd_pcm_runtime *runtime = substream->runtime;
1282 1262
1283 snd_pcm_set_sync(substream);
1284
1285 runtime->hw = snd_rme96_capture_adat_info; 1263 runtime->hw = snd_rme96_capture_adat_info;
1286 if (snd_rme96_getinputtype(rme96) == RME96_INPUT_ANALOG) { 1264 if (snd_rme96_getinputtype(rme96) == RME96_INPUT_ANALOG) {
1287 /* makes no sense to use analog input. Note that analog 1265 /* makes no sense to use analog input. Note that analog
@@ -1292,7 +1270,7 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
1292 if (!isadat) { 1270 if (!isadat) {
1293 return -EIO; 1271 return -EIO;
1294 } 1272 }
1295 runtime->hw.rates = snd_rme96_ratecode(rate); 1273 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
1296 runtime->hw.rate_min = rate; 1274 runtime->hw.rate_min = rate;
1297 runtime->hw.rate_max = rate; 1275 runtime->hw.rate_max = rate;
1298 } 1276 }
@@ -1826,15 +1804,8 @@ snd_rme96_proc_init(struct rme96 *rme96)
1826 * control interface 1804 * control interface
1827 */ 1805 */
1828 1806
1829static int 1807#define snd_rme96_info_loopback_control snd_ctl_boolean_mono_info
1830snd_rme96_info_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 1808
1831{
1832 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1833 uinfo->count = 1;
1834 uinfo->value.integer.min = 0;
1835 uinfo->value.integer.max = 1;
1836 return 0;
1837}
1838static int 1809static int
1839snd_rme96_get_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1810snd_rme96_get_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1840{ 1811{