diff options
Diffstat (limited to 'sound/soc/codecs/wm8996.c')
-rw-r--r-- | sound/soc/codecs/wm8996.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 308748a022c5..3dd063f682b2 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -1590,7 +1590,7 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec, | |||
1590 | break; | 1590 | break; |
1591 | 1591 | ||
1592 | case SND_SOC_BIAS_STANDBY: | 1592 | case SND_SOC_BIAS_STANDBY: |
1593 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | 1593 | if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { |
1594 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8996->supplies), | 1594 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8996->supplies), |
1595 | wm8996->supplies); | 1595 | wm8996->supplies); |
1596 | if (ret != 0) { | 1596 | if (ret != 0) { |
@@ -1628,8 +1628,6 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec, | |||
1628 | break; | 1628 | break; |
1629 | } | 1629 | } |
1630 | 1630 | ||
1631 | codec->dapm.bias_level = level; | ||
1632 | |||
1633 | return 0; | 1631 | return 0; |
1634 | } | 1632 | } |
1635 | 1633 | ||
@@ -2247,7 +2245,7 @@ int wm8996_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
2247 | wm8996_polarity_fn polarity_cb) | 2245 | wm8996_polarity_fn polarity_cb) |
2248 | { | 2246 | { |
2249 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); | 2247 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); |
2250 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 2248 | struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); |
2251 | 2249 | ||
2252 | wm8996->jack = jack; | 2250 | wm8996->jack = jack; |
2253 | wm8996->detecting = true; | 2251 | wm8996->detecting = true; |
@@ -2292,6 +2290,7 @@ EXPORT_SYMBOL_GPL(wm8996_detect); | |||
2292 | 2290 | ||
2293 | static void wm8996_hpdet_irq(struct snd_soc_codec *codec) | 2291 | static void wm8996_hpdet_irq(struct snd_soc_codec *codec) |
2294 | { | 2292 | { |
2293 | struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); | ||
2295 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); | 2294 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); |
2296 | int val, reg, report; | 2295 | int val, reg, report; |
2297 | 2296 | ||
@@ -2345,12 +2344,14 @@ out: | |||
2345 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, WM8996_MICD_ENA, | 2344 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, WM8996_MICD_ENA, |
2346 | WM8996_MICD_ENA); | 2345 | WM8996_MICD_ENA); |
2347 | 2346 | ||
2348 | snd_soc_dapm_disable_pin(&codec->dapm, "Bandgap"); | 2347 | snd_soc_dapm_disable_pin(dapm, "Bandgap"); |
2349 | snd_soc_dapm_sync(&codec->dapm); | 2348 | snd_soc_dapm_sync(dapm); |
2350 | } | 2349 | } |
2351 | 2350 | ||
2352 | static void wm8996_hpdet_start(struct snd_soc_codec *codec) | 2351 | static void wm8996_hpdet_start(struct snd_soc_codec *codec) |
2353 | { | 2352 | { |
2353 | struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); | ||
2354 | |||
2354 | /* Unclamp the output, we can't measure while we're shorting it */ | 2355 | /* Unclamp the output, we can't measure while we're shorting it */ |
2355 | snd_soc_update_bits(codec, WM8996_ANALOGUE_HP_1, | 2356 | snd_soc_update_bits(codec, WM8996_ANALOGUE_HP_1, |
2356 | WM8996_HPOUT1L_RMV_SHORT | | 2357 | WM8996_HPOUT1L_RMV_SHORT | |
@@ -2359,8 +2360,8 @@ static void wm8996_hpdet_start(struct snd_soc_codec *codec) | |||
2359 | WM8996_HPOUT1R_RMV_SHORT); | 2360 | WM8996_HPOUT1R_RMV_SHORT); |
2360 | 2361 | ||
2361 | /* We need bandgap for HPDET */ | 2362 | /* We need bandgap for HPDET */ |
2362 | snd_soc_dapm_force_enable_pin(&codec->dapm, "Bandgap"); | 2363 | snd_soc_dapm_force_enable_pin(dapm, "Bandgap"); |
2363 | snd_soc_dapm_sync(&codec->dapm); | 2364 | snd_soc_dapm_sync(dapm); |
2364 | 2365 | ||
2365 | /* Go into headphone detect left mode */ | 2366 | /* Go into headphone detect left mode */ |
2366 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, WM8996_MICD_ENA, 0); | 2367 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, WM8996_MICD_ENA, 0); |
@@ -2646,10 +2647,12 @@ static int wm8996_probe(struct snd_soc_codec *codec) | |||
2646 | if (irq_flags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) | 2647 | if (irq_flags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) |
2647 | ret = request_threaded_irq(i2c->irq, NULL, | 2648 | ret = request_threaded_irq(i2c->irq, NULL, |
2648 | wm8996_edge_irq, | 2649 | wm8996_edge_irq, |
2649 | irq_flags, "wm8996", codec); | 2650 | irq_flags | IRQF_ONESHOT, |
2651 | "wm8996", codec); | ||
2650 | else | 2652 | else |
2651 | ret = request_threaded_irq(i2c->irq, NULL, wm8996_irq, | 2653 | ret = request_threaded_irq(i2c->irq, NULL, wm8996_irq, |
2652 | irq_flags, "wm8996", codec); | 2654 | irq_flags | IRQF_ONESHOT, |
2655 | "wm8996", codec); | ||
2653 | 2656 | ||
2654 | if (ret == 0) { | 2657 | if (ret == 0) { |
2655 | /* Unmask the interrupt */ | 2658 | /* Unmask the interrupt */ |