Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189958
b: refs/heads/master
c: 8392609
h: refs/heads/master
v: v3
  • Loading branch information
Sascha Hauer authored and Mark Brown committed Apr 15, 2010
1 parent 2e8eb7b commit 4873cbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 565a79f74af96ae90dfec411da14dc38d2cd56bc
refs/heads/master: 8392609969b3b37a4da5cff08161661f7a8c16af
10 changes: 8 additions & 2 deletions trunk/sound/soc/imx/imx-pcm-fiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct imx_pcm_runtime_data {
struct hrtimer hrt;
int poll_time_ns;
struct snd_pcm_substream *substream;
atomic_t running;
};

static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
Expand All @@ -52,6 +53,9 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
struct pt_regs regs;
unsigned long delta;

if (!atomic_read(&iprtd->running))
return HRTIMER_NORESTART;

get_fiq_regs(&regs);

if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
Expand Down Expand Up @@ -129,6 +133,7 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
atomic_set(&iprtd->running, 1);
hrtimer_start(&iprtd->hrt, ns_to_ktime(iprtd->poll_time_ns),
HRTIMER_MODE_REL);
if (++fiq_enable == 1)
Expand All @@ -139,11 +144,11 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
hrtimer_cancel(&iprtd->hrt);
atomic_set(&iprtd->running, 0);

if (--fiq_enable == 0)
disable_fiq(imx_pcm_fiq);


break;
default:
return -EINVAL;
Expand Down Expand Up @@ -190,6 +195,7 @@ static int snd_imx_open(struct snd_pcm_substream *substream)

iprtd->substream = substream;

atomic_set(&iprtd->running, 0);
hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
iprtd->hrt.function = snd_hrtimer_callback;

Expand Down

0 comments on commit 4873cbd

Please sign in to comment.