aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/wm8962.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 00793b7b0a83..c5748fd4f296 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2361,7 +2361,7 @@ static int wm8962_add_widgets(struct snd_soc_codec *codec)
2361{ 2361{
2362 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 2362 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
2363 struct wm8962_pdata *pdata = &wm8962->pdata; 2363 struct wm8962_pdata *pdata = &wm8962->pdata;
2364 struct snd_soc_dapm_context *dapm = &codec->dapm; 2364 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
2365 2365
2366 snd_soc_add_codec_controls(codec, wm8962_snd_controls, 2366 snd_soc_add_codec_controls(codec, wm8962_snd_controls,
2367 ARRAY_SIZE(wm8962_snd_controls)); 2367 ARRAY_SIZE(wm8962_snd_controls));
@@ -2446,13 +2446,13 @@ static void wm8962_configure_bclk(struct snd_soc_codec *codec)
2446 * So we here provisionally enable it and then disable it afterward 2446 * So we here provisionally enable it and then disable it afterward
2447 * if current bias_level hasn't reached SND_SOC_BIAS_ON. 2447 * if current bias_level hasn't reached SND_SOC_BIAS_ON.
2448 */ 2448 */
2449 if (codec->dapm.bias_level != SND_SOC_BIAS_ON) 2449 if (snd_soc_codec_get_bias_level(codec) != SND_SOC_BIAS_ON)
2450 snd_soc_update_bits(codec, WM8962_CLOCKING2, 2450 snd_soc_update_bits(codec, WM8962_CLOCKING2,
2451 WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA); 2451 WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA);
2452 2452
2453 dspclk = snd_soc_read(codec, WM8962_CLOCKING1); 2453 dspclk = snd_soc_read(codec, WM8962_CLOCKING1);
2454 2454
2455 if (codec->dapm.bias_level != SND_SOC_BIAS_ON) 2455 if (snd_soc_codec_get_bias_level(codec) != SND_SOC_BIAS_ON)
2456 snd_soc_update_bits(codec, WM8962_CLOCKING2, 2456 snd_soc_update_bits(codec, WM8962_CLOCKING2,
2457 WM8962_SYSCLK_ENA_MASK, 0); 2457 WM8962_SYSCLK_ENA_MASK, 0);
2458 2458
@@ -2510,9 +2510,6 @@ static void wm8962_configure_bclk(struct snd_soc_codec *codec)
2510static int wm8962_set_bias_level(struct snd_soc_codec *codec, 2510static int wm8962_set_bias_level(struct snd_soc_codec *codec,
2511 enum snd_soc_bias_level level) 2511 enum snd_soc_bias_level level)
2512{ 2512{
2513 if (level == codec->dapm.bias_level)
2514 return 0;
2515
2516 switch (level) { 2513 switch (level) {
2517 case SND_SOC_BIAS_ON: 2514 case SND_SOC_BIAS_ON:
2518 break; 2515 break;
@@ -2530,7 +2527,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
2530 snd_soc_update_bits(codec, WM8962_PWR_MGMT_1, 2527 snd_soc_update_bits(codec, WM8962_PWR_MGMT_1,
2531 WM8962_VMID_SEL_MASK, 0x100); 2528 WM8962_VMID_SEL_MASK, 0x100);
2532 2529
2533 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) 2530 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF)
2534 msleep(100); 2531 msleep(100);
2535 break; 2532 break;
2536 2533
@@ -2613,7 +2610,7 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream,
2613 dev_dbg(codec->dev, "hw_params set BCLK %dHz LRCLK %dHz\n", 2610 dev_dbg(codec->dev, "hw_params set BCLK %dHz LRCLK %dHz\n",
2614 wm8962->bclk, wm8962->lrclk); 2611 wm8962->bclk, wm8962->lrclk);
2615 2612
2616 if (codec->dapm.bias_level == SND_SOC_BIAS_ON) 2613 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON)
2617 wm8962_configure_bclk(codec); 2614 wm8962_configure_bclk(codec);
2618 2615
2619 return 0; 2616 return 0;
@@ -3117,7 +3114,7 @@ static irqreturn_t wm8962_irq(int irq, void *data)
3117int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) 3114int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack)
3118{ 3115{
3119 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 3116 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
3120 struct snd_soc_dapm_context *dapm = &codec->dapm; 3117 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
3121 int irq_mask, enable; 3118 int irq_mask, enable;
3122 3119
3123 wm8962->jack = jack; 3120 wm8962->jack = jack;
@@ -3163,7 +3160,7 @@ static void wm8962_beep_work(struct work_struct *work)
3163 struct wm8962_priv *wm8962 = 3160 struct wm8962_priv *wm8962 =
3164 container_of(work, struct wm8962_priv, beep_work); 3161 container_of(work, struct wm8962_priv, beep_work);
3165 struct snd_soc_codec *codec = wm8962->codec; 3162 struct snd_soc_codec *codec = wm8962->codec;
3166 struct snd_soc_dapm_context *dapm = &codec->dapm; 3163 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
3167 int i; 3164 int i;
3168 int reg = 0; 3165 int reg = 0;
3169 int best = 0; 3166 int best = 0;
@@ -3414,6 +3411,7 @@ static void wm8962_free_gpio(struct snd_soc_codec *codec)
3414 3411
3415static int wm8962_probe(struct snd_soc_codec *codec) 3412static int wm8962_probe(struct snd_soc_codec *codec)
3416{ 3413{
3414 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
3417 int ret; 3415 int ret;
3418 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 3416 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
3419 int i; 3417 int i;
@@ -3461,7 +3459,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)
3461 } 3459 }
3462 if (!dmicclk || !dmicdat) { 3460 if (!dmicclk || !dmicdat) {
3463 dev_dbg(codec->dev, "DMIC not in use, disabling\n"); 3461 dev_dbg(codec->dev, "DMIC not in use, disabling\n");
3464 snd_soc_dapm_nc_pin(&codec->dapm, "DMICDAT"); 3462 snd_soc_dapm_nc_pin(dapm, "DMICDAT");
3465 } 3463 }
3466 if (dmicclk != dmicdat) 3464 if (dmicclk != dmicdat)
3467 dev_warn(codec->dev, "DMIC GPIOs partially configured\n"); 3465 dev_warn(codec->dev, "DMIC GPIOs partially configured\n");