diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-13 14:36:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-15 09:52:29 -0400 |
commit | ba2772edbe1f03a695029ca82844615fe41d28fc (patch) | |
tree | c0be9cd091c1c659b6245db9a420aedb8e4befc7 /sound/soc/codecs/wm8580.c | |
parent | c5607d8e7a4c30d2ff62b8eefe3f977d5c71d2fe (diff) |
ASoC: Implement BCLK rate selection for WM8580
Drive a minimal supported number of clocks required for the current
bit format in master mode. In slave mode this setting has no effect.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/wm8580.c')
-rw-r--r-- | sound/soc/codecs/wm8580.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 7942f917d31e..b6b2d6f8cba9 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -486,14 +486,18 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, | |||
486 | /* bit size */ | 486 | /* bit size */ |
487 | switch (params_format(params)) { | 487 | switch (params_format(params)) { |
488 | case SNDRV_PCM_FORMAT_S16_LE: | 488 | case SNDRV_PCM_FORMAT_S16_LE: |
489 | paifa |= 0x8; | ||
489 | break; | 490 | break; |
490 | case SNDRV_PCM_FORMAT_S20_3LE: | 491 | case SNDRV_PCM_FORMAT_S20_3LE: |
492 | paifa |= 0x10; | ||
491 | paifb |= WM8580_AIF_LENGTH_20; | 493 | paifb |= WM8580_AIF_LENGTH_20; |
492 | break; | 494 | break; |
493 | case SNDRV_PCM_FORMAT_S24_LE: | 495 | case SNDRV_PCM_FORMAT_S24_LE: |
496 | paifa |= 0x10; | ||
494 | paifb |= WM8580_AIF_LENGTH_24; | 497 | paifb |= WM8580_AIF_LENGTH_24; |
495 | break; | 498 | break; |
496 | case SNDRV_PCM_FORMAT_S32_LE: | 499 | case SNDRV_PCM_FORMAT_S32_LE: |
500 | paifa |= 0x10; | ||
497 | paifb |= WM8580_AIF_LENGTH_24; | 501 | paifb |= WM8580_AIF_LENGTH_24; |
498 | break; | 502 | break; |
499 | default: | 503 | default: |
@@ -515,7 +519,8 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, | |||
515 | wm8580_sysclk_ratios[i], wm8580->sysclk[dai->driver->id]); | 519 | wm8580_sysclk_ratios[i], wm8580->sysclk[dai->driver->id]); |
516 | 520 | ||
517 | snd_soc_update_bits(codec, WM8580_PAIF1 + dai->driver->id, | 521 | snd_soc_update_bits(codec, WM8580_PAIF1 + dai->driver->id, |
518 | WM8580_AIF_RATE_MASK, paifa); | 522 | WM8580_AIF_RATE_MASK | WM8580_AIF_BCLKSEL_MASK, |
523 | paifa); | ||
519 | snd_soc_update_bits(codec, WM8580_PAIF3 + dai->driver->id, | 524 | snd_soc_update_bits(codec, WM8580_PAIF3 + dai->driver->id, |
520 | WM8580_AIF_LENGTH_MASK, paifb); | 525 | WM8580_AIF_LENGTH_MASK, paifb); |
521 | return 0; | 526 | return 0; |