]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - sound/core/pcm_native.c
latency.c: use QoS infrastructure
[net-next-2.6.git] / sound / core / pcm_native.c
index 62449117ee14f6a13cc0f76d5bba6624df3596b9..61f5d425b6305660e8cd3bf514664c1f9b225c58 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/file.h>
 #include <linux/slab.h>
 #include <linux/time.h>
-#include <linux/latency.h>
+#include <linux/pm_qos_params.h>
 #include <linux/uio.h>
 #include <sound/core.h>
 #include <sound/control.h>
@@ -443,9 +443,11 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
        snd_pcm_timer_resolution_change(substream);
        runtime->status->state = SNDRV_PCM_STATE_SETUP;
 
-       remove_acceptable_latency(substream->latency_id);
+       pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
+                               substream->latency_id);
        if ((usecs = period_to_usecs(runtime)) >= 0)
-               set_acceptable_latency(substream->latency_id, usecs);
+               pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY,
+                                       substream->latency_id, usecs);
        return 0;
  _error:
        /* hardware might be unuseable from this time,
@@ -505,7 +507,8 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
        if (substream->ops->hw_free)
                result = substream->ops->hw_free(substream);
        runtime->status->state = SNDRV_PCM_STATE_OPEN;
-       remove_acceptable_latency(substream->latency_id);
+       pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
+               substream->latency_id);
        return result;
 }