Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-next
authorMark Brown <broonie@linaro.org>
Thu, 22 Aug 2013 13:29:02 +0000 (14:29 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 22 Aug 2013 13:29:02 +0000 (14:29 +0100)
1  2 
sound/soc/codecs/wm8994.c

@@@ -819,8 -819,9 +819,9 @@@ static int clk_sys_event(struct snd_soc
                 * don't want false reports.
                 */
                if (wm8994->jackdet && !wm8994->clk_has_run) {
-                       schedule_delayed_work(&wm8994->jackdet_bootstrap,
-                                             msecs_to_jiffies(1000));
+                       queue_delayed_work(system_power_efficient_wq,
+                                          &wm8994->jackdet_bootstrap,
+                                          msecs_to_jiffies(1000));
                        wm8994->clk_has_run = true;
                }
                break;
@@@ -1432,12 -1433,14 +1433,12 @@@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994
  
  #define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \
        SOC_SINGLE_EXT(xname, reg, shift, max, invert, \
-               snd_soc_get_volsw, wm8994_put_class_w)
+               snd_soc_dapm_get_volsw, wm8994_put_class_w)
  
  static int wm8994_put_class_w(struct snd_kcontrol *kcontrol,
                              struct snd_ctl_elem_value *ucontrol)
  {
 -      struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
 -      struct snd_soc_dapm_widget *w = wlist->widgets[0];
 -      struct snd_soc_codec *codec = w->codec;
 +      struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
        int ret;
  
        ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol);
@@@ -3485,7 -3488,8 +3486,8 @@@ static irqreturn_t wm8994_mic_irq(int i
  
        pm_wakeup_event(codec->dev, 300);
  
-       schedule_delayed_work(&priv->mic_work, msecs_to_jiffies(250));
+       queue_delayed_work(system_power_efficient_wq,
+                          &priv->mic_work, msecs_to_jiffies(250));
  
        return IRQ_HANDLED;
  }
@@@ -3573,8 -3577,9 +3575,9 @@@ static void wm8958_mic_id(void *data, u
                /* If nothing present then clear our statuses */
                dev_dbg(codec->dev, "Detected open circuit\n");
  
-               schedule_delayed_work(&wm8994->open_circuit_work,
-                                     msecs_to_jiffies(2500));
+               queue_delayed_work(system_power_efficient_wq,
+                                  &wm8994->open_circuit_work,
+                                  msecs_to_jiffies(2500));
                return;
        }
  
@@@ -3688,8 -3693,9 +3691,9 @@@ static irqreturn_t wm1811_jackdet_irq(i
                                    WM1811_JACKDET_DB, 0);
  
                delay = control->pdata.micdet_delay;
-               schedule_delayed_work(&wm8994->mic_work,
-                                     msecs_to_jiffies(delay));
+               queue_delayed_work(system_power_efficient_wq,
+                                  &wm8994->mic_work,
+                                  msecs_to_jiffies(delay));
        } else {
                dev_dbg(codec->dev, "Jack not detected\n");
  
@@@ -3850,6 -3856,8 +3854,6 @@@ static void wm8958_mic_work(struct work
                                                  mic_complete_work.work);
        struct snd_soc_codec *codec = wm8994->hubs.codec;
  
 -      dev_crit(codec->dev, "MIC WORK %x\n", wm8994->mic_status);
 -
        pm_runtime_get_sync(codec->dev);
  
        mutex_lock(&wm8994->accdet_lock);
        mutex_unlock(&wm8994->accdet_lock);
  
        pm_runtime_put(codec->dev);
 -
 -      dev_crit(codec->dev, "MIC WORK %x DONE\n", wm8994->mic_status);
  }
  
  static irqreturn_t wm8958_mic_irq(int irq, void *data)
        id_delay = wm8994->wm8994->pdata.mic_id_delay;
  
        if (wm8994->mic_detecting)
-               schedule_delayed_work(&wm8994->mic_complete_work,
-                                     msecs_to_jiffies(id_delay));
+               queue_delayed_work(system_power_efficient_wq,
+                                  &wm8994->mic_complete_work,
+                                  msecs_to_jiffies(id_delay));
        else
                wm8958_button_det(codec, reg);
  
@@@ -4008,9 -4019,6 +4013,6 @@@ static int wm8994_codec_probe(struct sn
  
        wm8994->micdet_irq = control->pdata.micdet_irq;
  
-       pm_runtime_enable(codec->dev);
-       pm_runtime_idle(codec->dev);
        /* By default use idle_bias_off, will override for WM8994 */
        codec->dapm.idle_bias_off = 1;
  
@@@ -4383,8 -4391,6 +4385,6 @@@ static int wm8994_codec_remove(struct s
  
        wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF);
  
-       pm_runtime_disable(codec->dev);
        for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++)
                wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i,
                                &wm8994->fll_locked[i]);
@@@ -4443,6 -4449,9 +4443,9 @@@ static int wm8994_probe(struct platform
  
        wm8994->wm8994 = dev_get_drvdata(pdev->dev.parent);
  
+       pm_runtime_enable(&pdev->dev);
+       pm_runtime_idle(&pdev->dev);
        return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8994,
                        wm8994_dai, ARRAY_SIZE(wm8994_dai));
  }
  static int wm8994_remove(struct platform_device *pdev)
  {
        snd_soc_unregister_codec(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
        return 0;
  }