diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:13:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:13:38 -0400 |
commit | fc8a327db6c46de783b1a4276d846841b9abc24c (patch) | |
tree | bee512c142cccea93511debd98ef954581693727 /sound/pci/rme32.c | |
parent | 92d15c2ccbb3e31a3fc71ad28fdb55e1319383c0 (diff) | |
parent | 24837e6f249a2c83667552e6871c1543b4a6b934 (diff) |
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: (264 commits)
[ALSA] version 1.0.15
[ALSA] Fix thinko in cs4231 mce down check
[ALSA] sun-cs4231: improved waiting after MCE down
[ALSA] sun-cs4231: use cs4231-regs.h
[ALSA] This simplifies and fixes waiting loops of the mce_down()
[ALSA] This patch adds support for a wavetable chip on
[ALSA] This patch removes open_mutex from the ad1848-lib as
[ALSA] fix bootup crash in snd_gus_interrupt()
[ALSA] hda-codec - Fix SKU ID function for realtek codecs
[ALSA] Support ASUS P701 eeepc [0x1043 0x82a1] support
[ALSA] hda-codec - Add array terminator for dmic in STAC codec
[ALSA] hdsp - Fix zero division
[ALSA] usb-audio - Fix double comment
[ALSA] hda-codec - Fix STAC922x volume knob control
[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz
[ALSA] hda-codec - Fix for Fujitsu Lifebook C1410
[ALSA] mpu-401: remove MPU401_INFO_UART_ONLY flag
[ALSA] mpu-401: do not require an ACK byte for the ENTER_UART command
[ALSA] via82xx - Add DXS quirk for Shuttle AK31v2
[ALSA] hda-codec - Fix input_mux numbers for vaio stac92xx
...
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) |