diff options
Diffstat (limited to 'sound/soc/codecs/wm8580.c')
-rw-r--r-- | sound/soc/codecs/wm8580.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 8725d4e75431..8f6b5ee6645b 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <sound/pcm.h> | 31 | #include <sound/pcm.h> |
32 | #include <sound/pcm_params.h> | 32 | #include <sound/pcm_params.h> |
33 | #include <sound/soc.h> | 33 | #include <sound/soc.h> |
34 | #include <sound/soc-dapm.h> | ||
35 | #include <sound/tlv.h> | 34 | #include <sound/tlv.h> |
36 | #include <sound/initval.h> | 35 | #include <sound/initval.h> |
37 | #include <asm/div64.h> | 36 | #include <asm/div64.h> |
@@ -191,7 +190,6 @@ static const char *wm8580_supply_names[WM8580_NUM_SUPPLIES] = { | |||
191 | struct wm8580_priv { | 190 | struct wm8580_priv { |
192 | enum snd_soc_control_type control_type; | 191 | enum snd_soc_control_type control_type; |
193 | struct regulator_bulk_data supplies[WM8580_NUM_SUPPLIES]; | 192 | struct regulator_bulk_data supplies[WM8580_NUM_SUPPLIES]; |
194 | u16 reg_cache[WM8580_MAX_REGISTER + 1]; | ||
195 | struct pll_state a; | 193 | struct pll_state a; |
196 | struct pll_state b; | 194 | struct pll_state b; |
197 | int sysclk[2]; | 195 | int sysclk[2]; |
@@ -302,10 +300,11 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
302 | 300 | ||
303 | static int wm8580_add_widgets(struct snd_soc_codec *codec) | 301 | static int wm8580_add_widgets(struct snd_soc_codec *codec) |
304 | { | 302 | { |
305 | snd_soc_dapm_new_controls(codec, wm8580_dapm_widgets, | 303 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
306 | ARRAY_SIZE(wm8580_dapm_widgets)); | ||
307 | 304 | ||
308 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 305 | snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets, |
306 | ARRAY_SIZE(wm8580_dapm_widgets)); | ||
307 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
309 | 308 | ||
310 | return 0; | 309 | return 0; |
311 | } | 310 | } |
@@ -507,13 +506,13 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, | |||
507 | } | 506 | } |
508 | 507 | ||
509 | /* Look up the SYSCLK ratio; accept only exact matches */ | 508 | /* Look up the SYSCLK ratio; accept only exact matches */ |
510 | ratio = wm8580->sysclk[dai->id] / params_rate(params); | 509 | ratio = wm8580->sysclk[dai->driver->id] / params_rate(params); |
511 | for (i = 0; i < ARRAY_SIZE(wm8580_sysclk_ratios); i++) | 510 | for (i = 0; i < ARRAY_SIZE(wm8580_sysclk_ratios); i++) |
512 | if (ratio == wm8580_sysclk_ratios[i]) | 511 | if (ratio == wm8580_sysclk_ratios[i]) |
513 | break; | 512 | break; |
514 | if (i == ARRAY_SIZE(wm8580_sysclk_ratios)) { | 513 | if (i == ARRAY_SIZE(wm8580_sysclk_ratios)) { |
515 | dev_err(codec->dev, "Invalid clock ratio %d/%d\n", | 514 | dev_err(codec->dev, "Invalid clock ratio %d/%d\n", |
516 | wm8580->sysclk[dai->id], params_rate(params)); | 515 | wm8580->sysclk[dai->driver->id], params_rate(params)); |
517 | return -EINVAL; | 516 | return -EINVAL; |
518 | } | 517 | } |
519 | paifa |= i; | 518 | paifa |= i; |
@@ -716,7 +715,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
716 | 715 | ||
717 | switch (clk_id) { | 716 | switch (clk_id) { |
718 | case WM8580_CLKSRC_ADCMCLK: | 717 | case WM8580_CLKSRC_ADCMCLK: |
719 | if (dai->id != WM8580_DAI_PAIFTX) | 718 | if (dai->driver->id != WM8580_DAI_PAIFTX) |
720 | return -EINVAL; | 719 | return -EINVAL; |
721 | sel = 0 << sel_shift; | 720 | sel = 0 << sel_shift; |
722 | break; | 721 | break; |
@@ -735,7 +734,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
735 | } | 734 | } |
736 | 735 | ||
737 | /* We really should validate PLL settings but not yet */ | 736 | /* We really should validate PLL settings but not yet */ |
738 | wm8580->sysclk[dai->id] = freq; | 737 | wm8580->sysclk[dai->driver->id] = freq; |
739 | 738 | ||
740 | return snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel); | 739 | return snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel); |
741 | } | 740 | } |
@@ -767,7 +766,7 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, | |||
767 | break; | 766 | break; |
768 | 767 | ||
769 | case SND_SOC_BIAS_STANDBY: | 768 | case SND_SOC_BIAS_STANDBY: |
770 | if (codec->bias_level == SND_SOC_BIAS_OFF) { | 769 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
771 | /* Power up and get individual control of the DACs */ | 770 | /* Power up and get individual control of the DACs */ |
772 | reg = snd_soc_read(codec, WM8580_PWRDN1); | 771 | reg = snd_soc_read(codec, WM8580_PWRDN1); |
773 | reg &= ~(WM8580_PWRDN1_PWDN | WM8580_PWRDN1_ALLDACPD); | 772 | reg &= ~(WM8580_PWRDN1_PWDN | WM8580_PWRDN1_ALLDACPD); |
@@ -785,7 +784,7 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, | |||
785 | snd_soc_write(codec, WM8580_PWRDN1, reg | WM8580_PWRDN1_PWDN); | 784 | snd_soc_write(codec, WM8580_PWRDN1, reg | WM8580_PWRDN1_PWDN); |
786 | break; | 785 | break; |
787 | } | 786 | } |
788 | codec->bias_level = level; | 787 | codec->dapm.bias_level = level; |
789 | return 0; | 788 | return 0; |
790 | } | 789 | } |
791 | 790 | ||
@@ -905,7 +904,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8580 = { | |||
905 | .set_bias_level = wm8580_set_bias_level, | 904 | .set_bias_level = wm8580_set_bias_level, |
906 | .reg_cache_size = ARRAY_SIZE(wm8580_reg), | 905 | .reg_cache_size = ARRAY_SIZE(wm8580_reg), |
907 | .reg_word_size = sizeof(u16), | 906 | .reg_word_size = sizeof(u16), |
908 | .reg_cache_default = &wm8580_reg, | 907 | .reg_cache_default = wm8580_reg, |
909 | }; | 908 | }; |
910 | 909 | ||
911 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 910 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |