Commit b3172f22 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown

ASoC: fix params_rate() macro use in several codecs

Sevelar ASoC codec drivers wrongly assume, that the params_rate() macro
returns one of SNDRV_PCM_RATE_* defines instead of the actual numerical
sampling rate. Fix them.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
parent 18f98ab5
...@@ -424,23 +424,23 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -424,23 +424,23 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream,
/* filter coefficient */ /* filter coefficient */
switch (params_rate(params)) { switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000: case 8000:
adn |= 0x5 << 1; adn |= 0x5 << 1;
break; break;
case SNDRV_PCM_RATE_11025: case 11025:
adn |= 0x4 << 1; adn |= 0x4 << 1;
break; break;
case SNDRV_PCM_RATE_16000: case 16000:
adn |= 0x3 << 1; adn |= 0x3 << 1;
break; break;
case SNDRV_PCM_RATE_22050: case 22050:
adn |= 0x2 << 1; adn |= 0x2 << 1;
break; break;
case SNDRV_PCM_RATE_32000: case 32000:
adn |= 0x1 << 1; adn |= 0x1 << 1;
break; break;
case SNDRV_PCM_RATE_44100: case 44100:
case SNDRV_PCM_RATE_48000: case 48000:
break; break;
} }
......
...@@ -378,23 +378,23 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -378,23 +378,23 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream,
iface |= (1 << 9); iface |= (1 << 9);
switch (params_rate(params)) { switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000: case 8000:
addcntrl |= (0x5 << 1); addcntrl |= (0x5 << 1);
break; break;
case SNDRV_PCM_RATE_11025: case 11025:
addcntrl |= (0x4 << 1); addcntrl |= (0x4 << 1);
break; break;
case SNDRV_PCM_RATE_16000: case 16000:
addcntrl |= (0x3 << 1); addcntrl |= (0x3 << 1);
break; break;
case SNDRV_PCM_RATE_22050: case 22050:
addcntrl |= (0x2 << 1); addcntrl |= (0x2 << 1);
break; break;
case SNDRV_PCM_RATE_32000: case 32000:
addcntrl |= (0x1 << 1); addcntrl |= (0x1 << 1);
break; break;
case SNDRV_PCM_RATE_44100: case 44100:
case SNDRV_PCM_RATE_48000: case 48000:
break; break;
} }
ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl); ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl);
......
...@@ -482,23 +482,23 @@ static int wm8974_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -482,23 +482,23 @@ static int wm8974_pcm_hw_params(struct snd_pcm_substream *substream,
/* filter coefficient */ /* filter coefficient */
switch (params_rate(params)) { switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000: case 8000:
adn |= 0x5 << 1; adn |= 0x5 << 1;
break; break;
case SNDRV_PCM_RATE_11025: case 11025:
adn |= 0x4 << 1; adn |= 0x4 << 1;
break; break;
case SNDRV_PCM_RATE_16000: case 16000:
adn |= 0x3 << 1; adn |= 0x3 << 1;
break; break;
case SNDRV_PCM_RATE_22050: case 22050:
adn |= 0x2 << 1; adn |= 0x2 << 1;
break; break;
case SNDRV_PCM_RATE_32000: case 32000:
adn |= 0x1 << 1; adn |= 0x1 << 1;
break; break;
case SNDRV_PCM_RATE_44100: case 44100:
case SNDRV_PCM_RATE_48000: case 48000:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment