ASoC: Decouple DAPM from CODECs
[deliverable/linux.git] / sound / soc / soc-jack.c
index 8a0a9205b1e785bf92d6ddd773b0a70cc7cf568d..4d95abb40288d3b89e24c5131243ca89c311bebf 100644 (file)
@@ -60,6 +60,7 @@ EXPORT_SYMBOL_GPL(snd_soc_jack_new);
 void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
 {
        struct snd_soc_codec *codec;
+       struct snd_soc_dapm_context *dapm;
        struct snd_soc_jack_pin *pin;
        int enable;
        int oldstatus;
@@ -68,6 +69,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
                return;
 
        codec = jack->codec;
+       dapm =  &codec->dapm;
 
        mutex_lock(&codec->mutex);
 
@@ -88,15 +90,15 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
                        enable = !enable;
 
                if (enable)
-                       snd_soc_dapm_enable_pin(codec, pin->pin);
+                       snd_soc_dapm_enable_pin(dapm, pin->pin);
                else
-                       snd_soc_dapm_disable_pin(codec, pin->pin);
+                       snd_soc_dapm_disable_pin(dapm, pin->pin);
        }
 
        /* Report before the DAPM sync to help users updating micbias status */
        blocking_notifier_call_chain(&jack->notifier, status, NULL);
 
-       snd_soc_dapm_sync(codec);
+       snd_soc_dapm_sync(dapm);
 
        snd_jack_report(jack->jack, status);
 
@@ -263,11 +265,12 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
                INIT_DELAYED_WORK(&gpios[i].work, gpio_work);
                gpios[i].jack = jack;
 
-               ret = request_irq(gpio_to_irq(gpios[i].gpio),
-                               gpio_handler,
-                               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-                               jack->codec->dev->driver->name,
-                               &gpios[i]);
+               ret = request_any_context_irq(gpio_to_irq(gpios[i].gpio),
+                                             gpio_handler,
+                                             IRQF_TRIGGER_RISING |
+                                             IRQF_TRIGGER_FALLING,
+                                             jack->codec->dev->driver->name,
+                                             &gpios[i]);
                if (ret)
                        goto err;
 
This page took 0.02784 seconds and 5 git commands to generate.