aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8962.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8962.c')
-rw-r--r--sound/soc/codecs/wm8962.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 3fc63b43c6a1..80986105f52e 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2682,6 +2682,7 @@ static const struct snd_soc_dapm_route wm8962_spk_stereo_intercon[] = {
2682static int wm8962_add_widgets(struct snd_soc_codec *codec) 2682static int wm8962_add_widgets(struct snd_soc_codec *codec)
2683{ 2683{
2684 struct wm8962_pdata *pdata = dev_get_platdata(codec->dev); 2684 struct wm8962_pdata *pdata = dev_get_platdata(codec->dev);
2685 struct snd_soc_dapm_context *dapm = &codec->dapm;
2685 2686
2686 snd_soc_add_controls(codec, wm8962_snd_controls, 2687 snd_soc_add_controls(codec, wm8962_snd_controls,
2687 ARRAY_SIZE(wm8962_snd_controls)); 2688 ARRAY_SIZE(wm8962_snd_controls));
@@ -2693,26 +2694,26 @@ static int wm8962_add_widgets(struct snd_soc_codec *codec)
2693 ARRAY_SIZE(wm8962_spk_stereo_controls)); 2694 ARRAY_SIZE(wm8962_spk_stereo_controls));
2694 2695
2695 2696
2696 snd_soc_dapm_new_controls(codec, wm8962_dapm_widgets, 2697 snd_soc_dapm_new_controls(dapm, wm8962_dapm_widgets,
2697 ARRAY_SIZE(wm8962_dapm_widgets)); 2698 ARRAY_SIZE(wm8962_dapm_widgets));
2698 if (pdata && pdata->spk_mono) 2699 if (pdata && pdata->spk_mono)
2699 snd_soc_dapm_new_controls(codec, wm8962_dapm_spk_mono_widgets, 2700 snd_soc_dapm_new_controls(dapm, wm8962_dapm_spk_mono_widgets,
2700 ARRAY_SIZE(wm8962_dapm_spk_mono_widgets)); 2701 ARRAY_SIZE(wm8962_dapm_spk_mono_widgets));
2701 else 2702 else
2702 snd_soc_dapm_new_controls(codec, wm8962_dapm_spk_stereo_widgets, 2703 snd_soc_dapm_new_controls(dapm, wm8962_dapm_spk_stereo_widgets,
2703 ARRAY_SIZE(wm8962_dapm_spk_stereo_widgets)); 2704 ARRAY_SIZE(wm8962_dapm_spk_stereo_widgets));
2704 2705
2705 snd_soc_dapm_add_routes(codec, wm8962_intercon, 2706 snd_soc_dapm_add_routes(dapm, wm8962_intercon,
2706 ARRAY_SIZE(wm8962_intercon)); 2707 ARRAY_SIZE(wm8962_intercon));
2707 if (pdata && pdata->spk_mono) 2708 if (pdata && pdata->spk_mono)
2708 snd_soc_dapm_add_routes(codec, wm8962_spk_mono_intercon, 2709 snd_soc_dapm_add_routes(dapm, wm8962_spk_mono_intercon,
2709 ARRAY_SIZE(wm8962_spk_mono_intercon)); 2710 ARRAY_SIZE(wm8962_spk_mono_intercon));
2710 else 2711 else
2711 snd_soc_dapm_add_routes(codec, wm8962_spk_stereo_intercon, 2712 snd_soc_dapm_add_routes(dapm, wm8962_spk_stereo_intercon,
2712 ARRAY_SIZE(wm8962_spk_stereo_intercon)); 2713 ARRAY_SIZE(wm8962_spk_stereo_intercon));
2713 2714
2714 2715
2715 snd_soc_dapm_disable_pin(codec, "Beep"); 2716 snd_soc_dapm_disable_pin(dapm, "Beep");
2716 2717
2717 return 0; 2718 return 0;
2718} 2719}
@@ -2819,7 +2820,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
2819 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 2820 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
2820 int ret; 2821 int ret;
2821 2822
2822 if (level == codec->bias_level) 2823 if (level == codec->dapm.bias_level)
2823 return 0; 2824 return 0;
2824 2825
2825 switch (level) { 2826 switch (level) {
@@ -2833,7 +2834,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
2833 break; 2834 break;
2834 2835
2835 case SND_SOC_BIAS_STANDBY: 2836 case SND_SOC_BIAS_STANDBY:
2836 if (codec->bias_level == SND_SOC_BIAS_OFF) { 2837 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
2837 ret = regulator_bulk_enable(ARRAY_SIZE(wm8962->supplies), 2838 ret = regulator_bulk_enable(ARRAY_SIZE(wm8962->supplies),
2838 wm8962->supplies); 2839 wm8962->supplies);
2839 if (ret != 0) { 2840 if (ret != 0) {
@@ -2883,7 +2884,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
2883 wm8962->supplies); 2884 wm8962->supplies);
2884 break; 2885 break;
2885 } 2886 }
2886 codec->bias_level = level; 2887 codec->dapm.bias_level = level;
2887 return 0; 2888 return 0;
2888} 2889}
2889 2890
@@ -3441,6 +3442,7 @@ static void wm8962_beep_work(struct work_struct *work)
3441 struct wm8962_priv *wm8962 = 3442 struct wm8962_priv *wm8962 =
3442 container_of(work, struct wm8962_priv, beep_work); 3443 container_of(work, struct wm8962_priv, beep_work);
3443 struct snd_soc_codec *codec = wm8962->codec; 3444 struct snd_soc_codec *codec = wm8962->codec;
3445 struct snd_soc_dapm_context *dapm = &codec->dapm;
3444 int i; 3446 int i;
3445 int reg = 0; 3447 int reg = 0;
3446 int best = 0; 3448 int best = 0;
@@ -3457,16 +3459,16 @@ static void wm8962_beep_work(struct work_struct *work)
3457 3459
3458 reg = WM8962_BEEP_ENA | (best << WM8962_BEEP_RATE_SHIFT); 3460 reg = WM8962_BEEP_ENA | (best << WM8962_BEEP_RATE_SHIFT);
3459 3461
3460 snd_soc_dapm_enable_pin(codec, "Beep"); 3462 snd_soc_dapm_enable_pin(dapm, "Beep");
3461 } else { 3463 } else {
3462 dev_dbg(codec->dev, "Disabling beep\n"); 3464 dev_dbg(codec->dev, "Disabling beep\n");
3463 snd_soc_dapm_disable_pin(codec, "Beep"); 3465 snd_soc_dapm_disable_pin(dapm, "Beep");
3464 } 3466 }
3465 3467
3466 snd_soc_update_bits(codec, WM8962_BEEP_GENERATOR_1, 3468 snd_soc_update_bits(codec, WM8962_BEEP_GENERATOR_1,
3467 WM8962_BEEP_ENA | WM8962_BEEP_RATE_MASK, reg); 3469 WM8962_BEEP_ENA | WM8962_BEEP_RATE_MASK, reg);
3468 3470
3469 snd_soc_dapm_sync(codec); 3471 snd_soc_dapm_sync(dapm);
3470} 3472}
3471 3473
3472/* For usability define a way of injecting beep events for the device - 3474/* For usability define a way of injecting beep events for the device -
@@ -3713,7 +3715,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)
3713 INIT_DELAYED_WORK(&wm8962->mic_work, wm8962_mic_work); 3715 INIT_DELAYED_WORK(&wm8962->mic_work, wm8962_mic_work);
3714 3716
3715 codec->cache_sync = 1; 3717 codec->cache_sync = 1;
3716 codec->idle_bias_off = 1; 3718 codec->dapm.idle_bias_off = 1;
3717 3719
3718 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_I2C); 3720 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_I2C);
3719 if (ret != 0) { 3721 if (ret != 0) {