diff options
Diffstat (limited to 'sound/soc/codecs/wm8994.c')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index ba832b77c543..86426a117b07 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -819,8 +819,9 @@ static int clk_sys_event(struct snd_soc_dapm_widget *w, | |||
819 | * don't want false reports. | 819 | * don't want false reports. |
820 | */ | 820 | */ |
821 | if (wm8994->jackdet && !wm8994->clk_has_run) { | 821 | if (wm8994->jackdet && !wm8994->clk_has_run) { |
822 | schedule_delayed_work(&wm8994->jackdet_bootstrap, | 822 | queue_delayed_work(system_power_efficient_wq, |
823 | msecs_to_jiffies(1000)); | 823 | &wm8994->jackdet_bootstrap, |
824 | msecs_to_jiffies(1000)); | ||
824 | wm8994->clk_has_run = true; | 825 | wm8994->clk_has_run = true; |
825 | } | 826 | } |
826 | break; | 827 | break; |
@@ -1432,14 +1433,12 @@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING, | |||
1432 | 1433 | ||
1433 | #define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \ | 1434 | #define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \ |
1434 | SOC_SINGLE_EXT(xname, reg, shift, max, invert, \ | 1435 | SOC_SINGLE_EXT(xname, reg, shift, max, invert, \ |
1435 | snd_soc_get_volsw, wm8994_put_class_w) | 1436 | snd_soc_dapm_get_volsw, wm8994_put_class_w) |
1436 | 1437 | ||
1437 | static int wm8994_put_class_w(struct snd_kcontrol *kcontrol, | 1438 | static int wm8994_put_class_w(struct snd_kcontrol *kcontrol, |
1438 | struct snd_ctl_elem_value *ucontrol) | 1439 | struct snd_ctl_elem_value *ucontrol) |
1439 | { | 1440 | { |
1440 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); | 1441 | struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol); |
1441 | struct snd_soc_dapm_widget *w = wlist->widgets[0]; | ||
1442 | struct snd_soc_codec *codec = w->codec; | ||
1443 | int ret; | 1442 | int ret; |
1444 | 1443 | ||
1445 | ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); | 1444 | ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); |
@@ -3487,7 +3486,8 @@ static irqreturn_t wm8994_mic_irq(int irq, void *data) | |||
3487 | 3486 | ||
3488 | pm_wakeup_event(codec->dev, 300); | 3487 | pm_wakeup_event(codec->dev, 300); |
3489 | 3488 | ||
3490 | schedule_delayed_work(&priv->mic_work, msecs_to_jiffies(250)); | 3489 | queue_delayed_work(system_power_efficient_wq, |
3490 | &priv->mic_work, msecs_to_jiffies(250)); | ||
3491 | 3491 | ||
3492 | return IRQ_HANDLED; | 3492 | return IRQ_HANDLED; |
3493 | } | 3493 | } |
@@ -3575,8 +3575,9 @@ static void wm8958_mic_id(void *data, u16 status) | |||
3575 | /* If nothing present then clear our statuses */ | 3575 | /* If nothing present then clear our statuses */ |
3576 | dev_dbg(codec->dev, "Detected open circuit\n"); | 3576 | dev_dbg(codec->dev, "Detected open circuit\n"); |
3577 | 3577 | ||
3578 | schedule_delayed_work(&wm8994->open_circuit_work, | 3578 | queue_delayed_work(system_power_efficient_wq, |
3579 | msecs_to_jiffies(2500)); | 3579 | &wm8994->open_circuit_work, |
3580 | msecs_to_jiffies(2500)); | ||
3580 | return; | 3581 | return; |
3581 | } | 3582 | } |
3582 | 3583 | ||
@@ -3690,8 +3691,9 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) | |||
3690 | WM1811_JACKDET_DB, 0); | 3691 | WM1811_JACKDET_DB, 0); |
3691 | 3692 | ||
3692 | delay = control->pdata.micdet_delay; | 3693 | delay = control->pdata.micdet_delay; |
3693 | schedule_delayed_work(&wm8994->mic_work, | 3694 | queue_delayed_work(system_power_efficient_wq, |
3694 | msecs_to_jiffies(delay)); | 3695 | &wm8994->mic_work, |
3696 | msecs_to_jiffies(delay)); | ||
3695 | } else { | 3697 | } else { |
3696 | dev_dbg(codec->dev, "Jack not detected\n"); | 3698 | dev_dbg(codec->dev, "Jack not detected\n"); |
3697 | 3699 | ||
@@ -3936,8 +3938,9 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) | |||
3936 | id_delay = wm8994->wm8994->pdata.mic_id_delay; | 3938 | id_delay = wm8994->wm8994->pdata.mic_id_delay; |
3937 | 3939 | ||
3938 | if (wm8994->mic_detecting) | 3940 | if (wm8994->mic_detecting) |
3939 | schedule_delayed_work(&wm8994->mic_complete_work, | 3941 | queue_delayed_work(system_power_efficient_wq, |
3940 | msecs_to_jiffies(id_delay)); | 3942 | &wm8994->mic_complete_work, |
3943 | msecs_to_jiffies(id_delay)); | ||
3941 | else | 3944 | else |
3942 | wm8958_button_det(codec, reg); | 3945 | wm8958_button_det(codec, reg); |
3943 | 3946 | ||
@@ -4010,9 +4013,6 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
4010 | 4013 | ||
4011 | wm8994->micdet_irq = control->pdata.micdet_irq; | 4014 | wm8994->micdet_irq = control->pdata.micdet_irq; |
4012 | 4015 | ||
4013 | pm_runtime_enable(codec->dev); | ||
4014 | pm_runtime_idle(codec->dev); | ||
4015 | |||
4016 | /* By default use idle_bias_off, will override for WM8994 */ | 4016 | /* By default use idle_bias_off, will override for WM8994 */ |
4017 | codec->dapm.idle_bias_off = 1; | 4017 | codec->dapm.idle_bias_off = 1; |
4018 | 4018 | ||
@@ -4385,8 +4385,6 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) | |||
4385 | 4385 | ||
4386 | wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF); | 4386 | wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF); |
4387 | 4387 | ||
4388 | pm_runtime_disable(codec->dev); | ||
4389 | |||
4390 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) | 4388 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) |
4391 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, | 4389 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, |
4392 | &wm8994->fll_locked[i]); | 4390 | &wm8994->fll_locked[i]); |
@@ -4445,6 +4443,9 @@ static int wm8994_probe(struct platform_device *pdev) | |||
4445 | 4443 | ||
4446 | wm8994->wm8994 = dev_get_drvdata(pdev->dev.parent); | 4444 | wm8994->wm8994 = dev_get_drvdata(pdev->dev.parent); |
4447 | 4445 | ||
4446 | pm_runtime_enable(&pdev->dev); | ||
4447 | pm_runtime_idle(&pdev->dev); | ||
4448 | |||
4448 | return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8994, | 4449 | return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8994, |
4449 | wm8994_dai, ARRAY_SIZE(wm8994_dai)); | 4450 | wm8994_dai, ARRAY_SIZE(wm8994_dai)); |
4450 | } | 4451 | } |
@@ -4452,6 +4453,8 @@ static int wm8994_probe(struct platform_device *pdev) | |||
4452 | static int wm8994_remove(struct platform_device *pdev) | 4453 | static int wm8994_remove(struct platform_device *pdev) |
4453 | { | 4454 | { |
4454 | snd_soc_unregister_codec(&pdev->dev); | 4455 | snd_soc_unregister_codec(&pdev->dev); |
4456 | pm_runtime_disable(&pdev->dev); | ||
4457 | |||
4455 | return 0; | 4458 | return 0; |
4456 | } | 4459 | } |
4457 | 4460 | ||