aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-01-21 02:50:51 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:07 -0500
commit71e22a4b77fb36ce3205122454f5500843bed3ea (patch)
treec7be25dfba8379ca0938409bd8a77cebd588883b /sound/pci
parent878ac3ee76a5abb4952396570207f6ebe0597e52 (diff)
[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 <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/oxygen/oxygen.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c
index 78aa96917626..0a7c6135c072 100644
--- a/sound/pci/oxygen/oxygen.c
+++ b/sound/pci/oxygen/oxygen.c
@@ -232,18 +232,6 @@ static void generic_cleanup(struct oxygen *chip)
232{ 232{
233} 233}
234 234
235static void generic_pcm_hardware_filter(unsigned int channel,
236 struct snd_pcm_hardware *hardware)
237{
238 if (channel == PCM_A) {
239 hardware->rates = SNDRV_PCM_RATE_44100 |
240 SNDRV_PCM_RATE_48000 |
241 SNDRV_PCM_RATE_96000 |
242 SNDRV_PCM_RATE_192000;
243 hardware->rate_min = 44100;
244 }
245}
246
247static void set_ak4396_params(struct oxygen *chip, 235static void set_ak4396_params(struct oxygen *chip,
248 struct snd_pcm_hw_params *params) 236 struct snd_pcm_hw_params *params)
249{ 237{
@@ -300,12 +288,12 @@ static void set_wm8785_params(struct oxygen *chip,
300 wm8785_write(chip, WM8785_R7, 0); 288 wm8785_write(chip, WM8785_R7, 0);
301 289
302 value = WM8785_MCR_SLAVE | WM8785_FORMAT_LJUST; 290 value = WM8785_MCR_SLAVE | WM8785_FORMAT_LJUST;
303 if (params_rate(params) == 96000) 291 if (params_rate(params) <= 48000)
292 value |= WM8785_OSR_SINGLE;
293 else if (params_rate(params) <= 96000)
304 value |= WM8785_OSR_DOUBLE; 294 value |= WM8785_OSR_DOUBLE;
305 else if (params_rate(params) == 192000)
306 value |= WM8785_OSR_QUAD;
307 else 295 else
308 value |= WM8785_OSR_SINGLE; 296 value |= WM8785_OSR_QUAD;
309 wm8785_write(chip, WM8785_R0, value); 297 wm8785_write(chip, WM8785_R0, value);
310 298
311 if (snd_pcm_format_width(params_format(params)) <= 16) 299 if (snd_pcm_format_width(params_format(params)) <= 16)
@@ -349,7 +337,6 @@ static const struct oxygen_model model_generic = {
349 .init = generic_init, 337 .init = generic_init,
350 .control_filter = ak4396_control_filter, 338 .control_filter = ak4396_control_filter,
351 .cleanup = generic_cleanup, 339 .cleanup = generic_cleanup,
352 .pcm_hardware_filter = generic_pcm_hardware_filter,
353 .set_dac_params = set_ak4396_params, 340 .set_dac_params = set_ak4396_params,
354 .set_adc_params = set_wm8785_params, 341 .set_adc_params = set_wm8785_params,
355 .update_dac_volume = update_ak4396_volume, 342 .update_dac_volume = update_ak4396_volume,