Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71e22a4b77fb36ce3205122454f5500843bed3ea
Commit:     71e22a4b77fb36ce3205122454f5500843bed3ea
Parent:     878ac3ee76a5abb4952396570207f6ebe0597e52
Author:     Clemens Ladisch <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 21 08:50:51 2008 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 17:30:07 2008 +0100

    [ALSA] oxygen: allow more sample rates with WM8785
    
    Allow to record with 32 kHz, 64 kHz, 88.2 kHz and 176.4 kHz with cards
    that have a WM8785 ADC.
    
    Signed-off-by: Clemens Ladisch <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/oxygen/oxygen.c |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c
index 78aa969..0a7c613 100644
--- a/sound/pci/oxygen/oxygen.c
+++ b/sound/pci/oxygen/oxygen.c
@@ -232,18 +232,6 @@ static void generic_cleanup(struct oxygen *chip)
 {
 }
 
-static void generic_pcm_hardware_filter(unsigned int channel,
-                                       struct snd_pcm_hardware *hardware)
-{
-       if (channel == PCM_A) {
-               hardware->rates = SNDRV_PCM_RATE_44100 |
-                                 SNDRV_PCM_RATE_48000 |
-                                 SNDRV_PCM_RATE_96000 |
-                                 SNDRV_PCM_RATE_192000;
-               hardware->rate_min = 44100;
-       }
-}
-
 static void set_ak4396_params(struct oxygen *chip,
                              struct snd_pcm_hw_params *params)
 {
@@ -300,12 +288,12 @@ static void set_wm8785_params(struct oxygen *chip,
        wm8785_write(chip, WM8785_R7, 0);
 
        value = WM8785_MCR_SLAVE | WM8785_FORMAT_LJUST;
-       if (params_rate(params) == 96000)
+       if (params_rate(params) <= 48000)
+               value |= WM8785_OSR_SINGLE;
+       else if (params_rate(params) <= 96000)
                value |= WM8785_OSR_DOUBLE;
-       else if (params_rate(params) == 192000)
-               value |= WM8785_OSR_QUAD;
        else
-               value |= WM8785_OSR_SINGLE;
+               value |= WM8785_OSR_QUAD;
        wm8785_write(chip, WM8785_R0, value);
 
        if (snd_pcm_format_width(params_format(params)) <= 16)
@@ -349,7 +337,6 @@ static const struct oxygen_model model_generic = {
        .init = generic_init,
        .control_filter = ak4396_control_filter,
        .cleanup = generic_cleanup,
-       .pcm_hardware_filter = generic_pcm_hardware_filter,
        .set_dac_params = set_ak4396_params,
        .set_adc_params = set_wm8785_params,
        .update_dac_volume = update_ak4396_volume,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to