aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8510.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8510.c')
-rw-r--r--sound/soc/codecs/wm8510.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c
index 060d5d06ba95..9000b1d19afb 100644
--- a/sound/soc/codecs/wm8510.c
+++ b/sound/soc/codecs/wm8510.c
@@ -19,6 +19,7 @@
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
22#include <linux/slab.h>
22#include <sound/core.h> 23#include <sound/core.h>
23#include <sound/pcm.h> 24#include <sound/pcm.h>
24#include <sound/pcm_params.h> 25#include <sound/pcm_params.h>
@@ -219,7 +220,6 @@ static int wm8510_add_widgets(struct snd_soc_codec *codec)
219 220
220 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 221 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
221 222
222 snd_soc_dapm_new_widgets(codec);
223 return 0; 223 return 0;
224} 224}
225 225
@@ -271,8 +271,8 @@ static void pll_factors(unsigned int target, unsigned int source)
271 pll_div.k = K; 271 pll_div.k = K;
272} 272}
273 273
274static int wm8510_set_dai_pll(struct snd_soc_dai *codec_dai, 274static int wm8510_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
275 int pll_id, unsigned int freq_in, unsigned int freq_out) 275 int source, unsigned int freq_in, unsigned int freq_out)
276{ 276{
277 struct snd_soc_codec *codec = codec_dai->codec; 277 struct snd_soc_codec *codec = codec_dai->codec;
278 u16 reg; 278 u16 reg;
@@ -425,23 +425,23 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream,
425 425
426 /* filter coefficient */ 426 /* filter coefficient */
427 switch (params_rate(params)) { 427 switch (params_rate(params)) {
428 case SNDRV_PCM_RATE_8000: 428 case 8000:
429 adn |= 0x5 << 1; 429 adn |= 0x5 << 1;
430 break; 430 break;
431 case SNDRV_PCM_RATE_11025: 431 case 11025:
432 adn |= 0x4 << 1; 432 adn |= 0x4 << 1;
433 break; 433 break;
434 case SNDRV_PCM_RATE_16000: 434 case 16000:
435 adn |= 0x3 << 1; 435 adn |= 0x3 << 1;
436 break; 436 break;
437 case SNDRV_PCM_RATE_22050: 437 case 22050:
438 adn |= 0x2 << 1; 438 adn |= 0x2 << 1;
439 break; 439 break;
440 case SNDRV_PCM_RATE_32000: 440 case 32000:
441 adn |= 0x1 << 1; 441 adn |= 0x1 << 1;
442 break; 442 break;
443 case SNDRV_PCM_RATE_44100: 443 case 44100:
444 case SNDRV_PCM_RATE_48000: 444 case 48000:
445 break; 445 break;
446 } 446 }
447 447
@@ -604,16 +604,9 @@ static int wm8510_init(struct snd_soc_device *socdev,
604 snd_soc_add_controls(codec, wm8510_snd_controls, 604 snd_soc_add_controls(codec, wm8510_snd_controls,
605 ARRAY_SIZE(wm8510_snd_controls)); 605 ARRAY_SIZE(wm8510_snd_controls));
606 wm8510_add_widgets(codec); 606 wm8510_add_widgets(codec);
607 ret = snd_soc_init_card(socdev); 607
608 if (ret < 0) {
609 printk(KERN_ERR "wm8510: failed to register card\n");
610 goto card_err;
611 }
612 return ret; 608 return ret;
613 609
614card_err:
615 snd_soc_free_pcms(socdev);
616 snd_soc_dapm_free(socdev);
617err: 610err:
618 kfree(codec->reg_cache); 611 kfree(codec->reg_cache);
619 return ret; 612 return ret;