diff options
Diffstat (limited to 'sound/soc/codecs/wm8961.c')
-rw-r--r-- | sound/soc/codecs/wm8961.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 4f326f604104..55252e7d02c9 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
24 | #include <sound/pcm_params.h> | 24 | #include <sound/pcm_params.h> |
25 | #include <sound/soc.h> | 25 | #include <sound/soc.h> |
26 | #include <sound/soc-dapm.h> | ||
27 | #include <sound/initval.h> | 26 | #include <sound/initval.h> |
28 | #include <sound/tlv.h> | 27 | #include <sound/tlv.h> |
29 | 28 | ||
@@ -290,7 +289,6 @@ static u16 wm8961_reg_defaults[] = { | |||
290 | struct wm8961_priv { | 289 | struct wm8961_priv { |
291 | enum snd_soc_control_type control_type; | 290 | enum snd_soc_control_type control_type; |
292 | int sysclk; | 291 | int sysclk; |
293 | u16 reg_cache[WM8961_MAX_REGISTER]; | ||
294 | }; | 292 | }; |
295 | 293 | ||
296 | static int wm8961_volatile_register(unsigned int reg) | 294 | static int wm8961_volatile_register(unsigned int reg) |
@@ -711,7 +709,7 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream, | |||
711 | if (fs <= 24000) | 709 | if (fs <= 24000) |
712 | reg |= WM8961_DACSLOPE; | 710 | reg |= WM8961_DACSLOPE; |
713 | else | 711 | else |
714 | reg &= WM8961_DACSLOPE; | 712 | reg &= ~WM8961_DACSLOPE; |
715 | snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); | 713 | snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); |
716 | 714 | ||
717 | return 0; | 715 | return 0; |
@@ -736,7 +734,7 @@ static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
736 | freq /= 2; | 734 | freq /= 2; |
737 | } else { | 735 | } else { |
738 | dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); | 736 | dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); |
739 | reg &= WM8961_MCLKDIV; | 737 | reg &= ~WM8961_MCLKDIV; |
740 | } | 738 | } |
741 | 739 | ||
742 | snd_soc_write(codec, WM8961_CLOCKING1, reg); | 740 | snd_soc_write(codec, WM8961_CLOCKING1, reg); |
@@ -882,7 +880,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec, | |||
882 | break; | 880 | break; |
883 | 881 | ||
884 | case SND_SOC_BIAS_PREPARE: | 882 | case SND_SOC_BIAS_PREPARE: |
885 | if (codec->bias_level == SND_SOC_BIAS_STANDBY) { | 883 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) { |
886 | /* Enable bias generation */ | 884 | /* Enable bias generation */ |
887 | reg = snd_soc_read(codec, WM8961_ANTI_POP); | 885 | reg = snd_soc_read(codec, WM8961_ANTI_POP); |
888 | reg |= WM8961_BUFIOEN | WM8961_BUFDCOPEN; | 886 | reg |= WM8961_BUFIOEN | WM8961_BUFDCOPEN; |
@@ -897,7 +895,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec, | |||
897 | break; | 895 | break; |
898 | 896 | ||
899 | case SND_SOC_BIAS_STANDBY: | 897 | case SND_SOC_BIAS_STANDBY: |
900 | if (codec->bias_level == SND_SOC_BIAS_PREPARE) { | 898 | if (codec->dapm.bias_level == SND_SOC_BIAS_PREPARE) { |
901 | /* VREF off */ | 899 | /* VREF off */ |
902 | reg = snd_soc_read(codec, WM8961_PWR_MGMT_1); | 900 | reg = snd_soc_read(codec, WM8961_PWR_MGMT_1); |
903 | reg &= ~WM8961_VREF; | 901 | reg &= ~WM8961_VREF; |
@@ -919,7 +917,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec, | |||
919 | break; | 917 | break; |
920 | } | 918 | } |
921 | 919 | ||
922 | codec->bias_level = level; | 920 | codec->dapm.bias_level = level; |
923 | 921 | ||
924 | return 0; | 922 | return 0; |
925 | } | 923 | } |
@@ -959,6 +957,7 @@ static struct snd_soc_dai_driver wm8961_dai = { | |||
959 | 957 | ||
960 | static int wm8961_probe(struct snd_soc_codec *codec) | 958 | static int wm8961_probe(struct snd_soc_codec *codec) |
961 | { | 959 | { |
960 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
962 | int ret = 0; | 961 | int ret = 0; |
963 | u16 reg; | 962 | u16 reg; |
964 | 963 | ||
@@ -1024,9 +1023,9 @@ static int wm8961_probe(struct snd_soc_codec *codec) | |||
1024 | 1023 | ||
1025 | snd_soc_add_controls(codec, wm8961_snd_controls, | 1024 | snd_soc_add_controls(codec, wm8961_snd_controls, |
1026 | ARRAY_SIZE(wm8961_snd_controls)); | 1025 | ARRAY_SIZE(wm8961_snd_controls)); |
1027 | snd_soc_dapm_new_controls(codec, wm8961_dapm_widgets, | 1026 | snd_soc_dapm_new_controls(dapm, wm8961_dapm_widgets, |
1028 | ARRAY_SIZE(wm8961_dapm_widgets)); | 1027 | ARRAY_SIZE(wm8961_dapm_widgets)); |
1029 | snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); | 1028 | snd_soc_dapm_add_routes(dapm, audio_paths, ARRAY_SIZE(audio_paths)); |
1030 | 1029 | ||
1031 | return 0; | 1030 | return 0; |
1032 | } | 1031 | } |