diff options
Diffstat (limited to 'sound/soc/codecs/wm8994.c')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index b6d47e771519..e6dfa103ad2a 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -2416,8 +2416,19 @@ static struct snd_soc_dai_driver wm8994_dai[] = { | |||
2416 | static int wm8994_suspend(struct snd_soc_codec *codec, pm_message_t state) | 2416 | static int wm8994_suspend(struct snd_soc_codec *codec, pm_message_t state) |
2417 | { | 2417 | { |
2418 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2418 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2419 | struct wm8994 *control = codec->control_data; | ||
2419 | int i, ret; | 2420 | int i, ret; |
2420 | 2421 | ||
2422 | switch (control->type) { | ||
2423 | case WM8994: | ||
2424 | snd_soc_update_bits(codec, WM8994_MICBIAS, WM8994_MICD_ENA, 0); | ||
2425 | break; | ||
2426 | case WM8958: | ||
2427 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | ||
2428 | WM8958_MICD_ENA, 0); | ||
2429 | break; | ||
2430 | } | ||
2431 | |||
2421 | for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { | 2432 | for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { |
2422 | memcpy(&wm8994->fll_suspend[i], &wm8994->fll[i], | 2433 | memcpy(&wm8994->fll_suspend[i], &wm8994->fll[i], |
2423 | sizeof(struct wm8994_fll_config)); | 2434 | sizeof(struct wm8994_fll_config)); |
@@ -2435,6 +2446,7 @@ static int wm8994_suspend(struct snd_soc_codec *codec, pm_message_t state) | |||
2435 | static int wm8994_resume(struct snd_soc_codec *codec) | 2446 | static int wm8994_resume(struct snd_soc_codec *codec) |
2436 | { | 2447 | { |
2437 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2448 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2449 | struct wm8994 *control = codec->control_data; | ||
2438 | int i, ret; | 2450 | int i, ret; |
2439 | unsigned int val, mask; | 2451 | unsigned int val, mask; |
2440 | 2452 | ||
@@ -2473,6 +2485,19 @@ static int wm8994_resume(struct snd_soc_codec *codec) | |||
2473 | i + 1, ret); | 2485 | i + 1, ret); |
2474 | } | 2486 | } |
2475 | 2487 | ||
2488 | switch (control->type) { | ||
2489 | case WM8994: | ||
2490 | if (wm8994->micdet[0].jack || wm8994->micdet[1].jack) | ||
2491 | snd_soc_update_bits(codec, WM8994_MICBIAS, | ||
2492 | WM8994_MICD_ENA, WM8994_MICD_ENA); | ||
2493 | break; | ||
2494 | case WM8958: | ||
2495 | if (wm8994->jack_cb) | ||
2496 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | ||
2497 | WM8958_MICD_ENA, WM8958_MICD_ENA); | ||
2498 | break; | ||
2499 | } | ||
2500 | |||
2476 | return 0; | 2501 | return 0; |
2477 | } | 2502 | } |
2478 | #else | 2503 | #else |