aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/oxygen/oxygen_pcm.c')
-rw-r--r--sound/pci/oxygen/oxygen_pcm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
index 1e98333366df..9dff6954c397 100644
--- a/sound/pci/oxygen/oxygen_pcm.c
+++ b/sound/pci/oxygen/oxygen_pcm.c
@@ -271,13 +271,16 @@ static unsigned int oxygen_rate(struct snd_pcm_hw_params *hw_params)
271 } 271 }
272} 272}
273 273
274static unsigned int oxygen_i2s_mclk(struct snd_pcm_hw_params *hw_params) 274unsigned int oxygen_default_i2s_mclk(struct oxygen *chip,
275 unsigned int channel,
276 struct snd_pcm_hw_params *hw_params)
275{ 277{
276 if (params_rate(hw_params) <= 96000) 278 if (params_rate(hw_params) <= 96000)
277 return OXYGEN_I2S_MCLK_256; 279 return OXYGEN_I2S_MCLK_256;
278 else 280 else
279 return OXYGEN_I2S_MCLK_128; 281 return OXYGEN_I2S_MCLK_128;
280} 282}
283EXPORT_SYMBOL(oxygen_default_i2s_mclk);
281 284
282static unsigned int oxygen_i2s_bits(struct snd_pcm_hw_params *hw_params) 285static unsigned int oxygen_i2s_bits(struct snd_pcm_hw_params *hw_params)
283{ 286{
@@ -354,7 +357,7 @@ static int oxygen_rec_a_hw_params(struct snd_pcm_substream *substream,
354 OXYGEN_REC_FORMAT_A_MASK); 357 OXYGEN_REC_FORMAT_A_MASK);
355 oxygen_write16_masked(chip, OXYGEN_I2S_A_FORMAT, 358 oxygen_write16_masked(chip, OXYGEN_I2S_A_FORMAT,
356 oxygen_rate(hw_params) | 359 oxygen_rate(hw_params) |
357 oxygen_i2s_mclk(hw_params) | 360 chip->model.get_i2s_mclk(chip, PCM_A, hw_params) |
358 chip->model.adc_i2s_format | 361 chip->model.adc_i2s_format |
359 oxygen_i2s_bits(hw_params), 362 oxygen_i2s_bits(hw_params),
360 OXYGEN_I2S_RATE_MASK | 363 OXYGEN_I2S_RATE_MASK |
@@ -390,7 +393,8 @@ static int oxygen_rec_b_hw_params(struct snd_pcm_substream *substream,
390 if (!is_ac97) 393 if (!is_ac97)
391 oxygen_write16_masked(chip, OXYGEN_I2S_B_FORMAT, 394 oxygen_write16_masked(chip, OXYGEN_I2S_B_FORMAT,
392 oxygen_rate(hw_params) | 395 oxygen_rate(hw_params) |
393 oxygen_i2s_mclk(hw_params) | 396 chip->model.get_i2s_mclk(chip, PCM_B,
397 hw_params) |
394 chip->model.adc_i2s_format | 398 chip->model.adc_i2s_format |
395 oxygen_i2s_bits(hw_params), 399 oxygen_i2s_bits(hw_params),
396 OXYGEN_I2S_RATE_MASK | 400 OXYGEN_I2S_RATE_MASK |
@@ -472,7 +476,8 @@ static int oxygen_multich_hw_params(struct snd_pcm_substream *substream,
472 oxygen_write16_masked(chip, OXYGEN_I2S_MULTICH_FORMAT, 476 oxygen_write16_masked(chip, OXYGEN_I2S_MULTICH_FORMAT,
473 oxygen_rate(hw_params) | 477 oxygen_rate(hw_params) |
474 chip->model.dac_i2s_format | 478 chip->model.dac_i2s_format |
475 oxygen_i2s_mclk(hw_params) | 479 chip->model.get_i2s_mclk(chip, PCM_MULTICH,
480 hw_params) |
476 oxygen_i2s_bits(hw_params), 481 oxygen_i2s_bits(hw_params),
477 OXYGEN_I2S_RATE_MASK | 482 OXYGEN_I2S_RATE_MASK |
478 OXYGEN_I2S_FORMAT_MASK | 483 OXYGEN_I2S_FORMAT_MASK |