diff options
Diffstat (limited to 'sound/pci/rme32.c')
-rw-r--r-- | sound/pci/rme32.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c index 618653e22561..1475912588e9 100644 --- a/sound/pci/rme32.c +++ b/sound/pci/rme32.c | |||
@@ -258,19 +258,6 @@ static inline unsigned int snd_rme32_pcm_byteptr(struct rme32 * rme32) | |||
258 | & RME32_RCR_AUDIO_ADDR_MASK); | 258 | & RME32_RCR_AUDIO_ADDR_MASK); |
259 | } | 259 | } |
260 | 260 | ||
261 | static int snd_rme32_ratecode(int rate) | ||
262 | { | ||
263 | switch (rate) { | ||
264 | case 32000: return SNDRV_PCM_RATE_32000; | ||
265 | case 44100: return SNDRV_PCM_RATE_44100; | ||
266 | case 48000: return SNDRV_PCM_RATE_48000; | ||
267 | case 64000: return SNDRV_PCM_RATE_64000; | ||
268 | case 88200: return SNDRV_PCM_RATE_88200; | ||
269 | case 96000: return SNDRV_PCM_RATE_96000; | ||
270 | } | ||
271 | return 0; | ||
272 | } | ||
273 | |||
274 | /* silence callback for halfduplex mode */ | 261 | /* silence callback for halfduplex mode */ |
275 | static int snd_rme32_playback_silence(struct snd_pcm_substream *substream, int channel, /* not used (interleaved data) */ | 262 | static int snd_rme32_playback_silence(struct snd_pcm_substream *substream, int channel, /* not used (interleaved data) */ |
276 | snd_pcm_uframes_t pos, | 263 | snd_pcm_uframes_t pos, |
@@ -887,7 +874,7 @@ static int snd_rme32_playback_spdif_open(struct snd_pcm_substream *substream) | |||
887 | if ((rme32->rcreg & RME32_RCR_KMODE) && | 874 | if ((rme32->rcreg & RME32_RCR_KMODE) && |
888 | (rate = snd_rme32_capture_getrate(rme32, &dummy)) > 0) { | 875 | (rate = snd_rme32_capture_getrate(rme32, &dummy)) > 0) { |
889 | /* AutoSync */ | 876 | /* AutoSync */ |
890 | runtime->hw.rates = snd_rme32_ratecode(rate); | 877 | runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); |
891 | runtime->hw.rate_min = rate; | 878 | runtime->hw.rate_min = rate; |
892 | runtime->hw.rate_max = rate; | 879 | runtime->hw.rate_max = rate; |
893 | } | 880 | } |
@@ -929,7 +916,7 @@ static int snd_rme32_capture_spdif_open(struct snd_pcm_substream *substream) | |||
929 | if (isadat) { | 916 | if (isadat) { |
930 | return -EIO; | 917 | return -EIO; |
931 | } | 918 | } |
932 | runtime->hw.rates = snd_rme32_ratecode(rate); | 919 | runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); |
933 | runtime->hw.rate_min = rate; | 920 | runtime->hw.rate_min = rate; |
934 | runtime->hw.rate_max = rate; | 921 | runtime->hw.rate_max = rate; |
935 | } | 922 | } |
@@ -965,7 +952,7 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream) | |||
965 | if ((rme32->rcreg & RME32_RCR_KMODE) && | 952 | if ((rme32->rcreg & RME32_RCR_KMODE) && |
966 | (rate = snd_rme32_capture_getrate(rme32, &dummy)) > 0) { | 953 | (rate = snd_rme32_capture_getrate(rme32, &dummy)) > 0) { |
967 | /* AutoSync */ | 954 | /* AutoSync */ |
968 | runtime->hw.rates = snd_rme32_ratecode(rate); | 955 | runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); |
969 | runtime->hw.rate_min = rate; | 956 | runtime->hw.rate_min = rate; |
970 | runtime->hw.rate_max = rate; | 957 | runtime->hw.rate_max = rate; |
971 | } | 958 | } |
@@ -989,7 +976,7 @@ snd_rme32_capture_adat_open(struct snd_pcm_substream *substream) | |||
989 | if (!isadat) { | 976 | if (!isadat) { |
990 | return -EIO; | 977 | return -EIO; |
991 | } | 978 | } |
992 | runtime->hw.rates = snd_rme32_ratecode(rate); | 979 | runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); |
993 | runtime->hw.rate_min = rate; | 980 | runtime->hw.rate_min = rate; |
994 | runtime->hw.rate_max = rate; | 981 | runtime->hw.rate_max = rate; |
995 | } | 982 | } |
@@ -1582,16 +1569,8 @@ static void __devinit snd_rme32_proc_init(struct rme32 * rme32) | |||
1582 | * control interface | 1569 | * control interface |
1583 | */ | 1570 | */ |
1584 | 1571 | ||
1585 | static int | 1572 | #define snd_rme32_info_loopback_control snd_ctl_boolean_mono_info |
1586 | snd_rme32_info_loopback_control(struct snd_kcontrol *kcontrol, | 1573 | |
1587 | struct snd_ctl_elem_info *uinfo) | ||
1588 | { | ||
1589 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1590 | uinfo->count = 1; | ||
1591 | uinfo->value.integer.min = 0; | ||
1592 | uinfo->value.integer.max = 1; | ||
1593 | return 0; | ||
1594 | } | ||
1595 | static int | 1574 | static int |
1596 | snd_rme32_get_loopback_control(struct snd_kcontrol *kcontrol, | 1575 | snd_rme32_get_loopback_control(struct snd_kcontrol *kcontrol, |
1597 | struct snd_ctl_elem_value *ucontrol) | 1576 | struct snd_ctl_elem_value *ucontrol) |