diff options
Diffstat (limited to 'sound/soc/codecs/wm8940.c')
-rw-r--r-- | sound/soc/codecs/wm8940.c | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index 1ef2454c5205..0c04b476487f 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/i2c.h> | 30 | #include <linux/i2c.h> |
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <linux/spi/spi.h> | 32 | #include <linux/spi/spi.h> |
33 | #include <linux/slab.h> | ||
33 | #include <sound/core.h> | 34 | #include <sound/core.h> |
34 | #include <sound/pcm.h> | 35 | #include <sound/pcm.h> |
35 | #include <sound/pcm_params.h> | 36 | #include <sound/pcm_params.h> |
@@ -298,7 +299,6 @@ static int wm8940_add_widgets(struct snd_soc_codec *codec) | |||
298 | ret = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 299 | ret = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); |
299 | if (ret) | 300 | if (ret) |
300 | goto error_ret; | 301 | goto error_ret; |
301 | ret = snd_soc_dapm_new_widgets(codec); | ||
302 | 302 | ||
303 | error_ret: | 303 | error_ret: |
304 | return ret; | 304 | return ret; |
@@ -379,23 +379,23 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream, | |||
379 | iface |= (1 << 9); | 379 | iface |= (1 << 9); |
380 | 380 | ||
381 | switch (params_rate(params)) { | 381 | switch (params_rate(params)) { |
382 | case SNDRV_PCM_RATE_8000: | 382 | case 8000: |
383 | addcntrl |= (0x5 << 1); | 383 | addcntrl |= (0x5 << 1); |
384 | break; | 384 | break; |
385 | case SNDRV_PCM_RATE_11025: | 385 | case 11025: |
386 | addcntrl |= (0x4 << 1); | 386 | addcntrl |= (0x4 << 1); |
387 | break; | 387 | break; |
388 | case SNDRV_PCM_RATE_16000: | 388 | case 16000: |
389 | addcntrl |= (0x3 << 1); | 389 | addcntrl |= (0x3 << 1); |
390 | break; | 390 | break; |
391 | case SNDRV_PCM_RATE_22050: | 391 | case 22050: |
392 | addcntrl |= (0x2 << 1); | 392 | addcntrl |= (0x2 << 1); |
393 | break; | 393 | break; |
394 | case SNDRV_PCM_RATE_32000: | 394 | case 32000: |
395 | addcntrl |= (0x1 << 1); | 395 | addcntrl |= (0x1 << 1); |
396 | break; | 396 | break; |
397 | case SNDRV_PCM_RATE_44100: | 397 | case 44100: |
398 | case SNDRV_PCM_RATE_48000: | 398 | case 48000: |
399 | break; | 399 | break; |
400 | } | 400 | } |
401 | ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl); | 401 | ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl); |
@@ -536,8 +536,8 @@ static void pll_factors(unsigned int target, unsigned int source) | |||
536 | } | 536 | } |
537 | 537 | ||
538 | /* Untested at the moment */ | 538 | /* Untested at the moment */ |
539 | static int wm8940_set_dai_pll(struct snd_soc_dai *codec_dai, | 539 | static int wm8940_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, |
540 | int pll_id, unsigned int freq_in, unsigned int freq_out) | 540 | int source, unsigned int freq_in, unsigned int freq_out) |
541 | { | 541 | { |
542 | struct snd_soc_codec *codec = codec_dai->codec; | 542 | struct snd_soc_codec *codec = codec_dai->codec; |
543 | u16 reg; | 543 | u16 reg; |
@@ -731,12 +731,6 @@ static int wm8940_probe(struct platform_device *pdev) | |||
731 | if (ret) | 731 | if (ret) |
732 | goto error_free_pcms; | 732 | goto error_free_pcms; |
733 | 733 | ||
734 | ret = snd_soc_init_card(socdev); | ||
735 | if (ret < 0) { | ||
736 | dev_err(codec->dev, "failed to register card: %d\n", ret); | ||
737 | goto error_free_pcms; | ||
738 | } | ||
739 | |||
740 | return ret; | 734 | return ret; |
741 | 735 | ||
742 | error_free_pcms: | 736 | error_free_pcms: |
@@ -877,21 +871,6 @@ static int __devexit wm8940_i2c_remove(struct i2c_client *client) | |||
877 | return 0; | 871 | return 0; |
878 | } | 872 | } |
879 | 873 | ||
880 | #ifdef CONFIG_PM | ||
881 | static int wm8940_i2c_suspend(struct i2c_client *client, pm_message_t msg) | ||
882 | { | ||
883 | return snd_soc_suspend_device(&client->dev); | ||
884 | } | ||
885 | |||
886 | static int wm8940_i2c_resume(struct i2c_client *client) | ||
887 | { | ||
888 | return snd_soc_resume_device(&client->dev); | ||
889 | } | ||
890 | #else | ||
891 | #define wm8940_i2c_suspend NULL | ||
892 | #define wm8940_i2c_resume NULL | ||
893 | #endif | ||
894 | |||
895 | static const struct i2c_device_id wm8940_i2c_id[] = { | 874 | static const struct i2c_device_id wm8940_i2c_id[] = { |
896 | { "wm8940", 0 }, | 875 | { "wm8940", 0 }, |
897 | { } | 876 | { } |
@@ -905,8 +884,6 @@ static struct i2c_driver wm8940_i2c_driver = { | |||
905 | }, | 884 | }, |
906 | .probe = wm8940_i2c_probe, | 885 | .probe = wm8940_i2c_probe, |
907 | .remove = __devexit_p(wm8940_i2c_remove), | 886 | .remove = __devexit_p(wm8940_i2c_remove), |
908 | .suspend = wm8940_i2c_suspend, | ||
909 | .resume = wm8940_i2c_resume, | ||
910 | .id_table = wm8940_i2c_id, | 887 | .id_table = wm8940_i2c_id, |
911 | }; | 888 | }; |
912 | 889 | ||