aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/fsl/imx-pcm-fiq.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 2fc872b2deff..f53b3261b171 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -39,8 +39,6 @@ struct imx_pcm_runtime_data {
39 unsigned int period; 39 unsigned int period;
40 int periods; 40 int periods;
41 unsigned long offset; 41 unsigned long offset;
42 unsigned long last_offset;
43 unsigned long size;
44 struct hrtimer hrt; 42 struct hrtimer hrt;
45 int poll_time_ns; 43 int poll_time_ns;
46 struct snd_pcm_substream *substream; 44 struct snd_pcm_substream *substream;
@@ -55,7 +53,6 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
55 struct snd_pcm_substream *substream = iprtd->substream; 53 struct snd_pcm_substream *substream = iprtd->substream;
56 struct snd_pcm_runtime *runtime = substream->runtime; 54 struct snd_pcm_runtime *runtime = substream->runtime;
57 struct pt_regs regs; 55 struct pt_regs regs;
58 unsigned long delta;
59 56
60 if (!atomic_read(&iprtd->playing) && !atomic_read(&iprtd->capturing)) 57 if (!atomic_read(&iprtd->playing) && !atomic_read(&iprtd->capturing))
61 return HRTIMER_NORESTART; 58 return HRTIMER_NORESTART;
@@ -67,19 +64,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
67 else 64 else
68 iprtd->offset = regs.ARM_r9 & 0xffff; 65 iprtd->offset = regs.ARM_r9 & 0xffff;
69 66
70 /* How much data have we transferred since the last period report? */ 67 snd_pcm_period_elapsed(substream);
71 if (iprtd->offset >= iprtd->last_offset)
72 delta = iprtd->offset - iprtd->last_offset;
73 else
74 delta = runtime->buffer_size + iprtd->offset
75 - iprtd->last_offset;
76
77 /* If we've transferred at least a period then report it and
78 * reset our poll time */
79 if (delta >= iprtd->period) {
80 snd_pcm_period_elapsed(substream);
81 iprtd->last_offset = iprtd->offset;
82 }
83 68
84 hrtimer_forward_now(hrt, ns_to_ktime(iprtd->poll_time_ns)); 69 hrtimer_forward_now(hrt, ns_to_ktime(iprtd->poll_time_ns));
85 70
@@ -96,11 +81,9 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream,
96 struct snd_pcm_runtime *runtime = substream->runtime; 81 struct snd_pcm_runtime *runtime = substream->runtime;
97 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 82 struct imx_pcm_runtime_data *iprtd = runtime->private_data;
98 83
99 iprtd->size = params_buffer_bytes(params);
100 iprtd->periods = params_periods(params); 84 iprtd->periods = params_periods(params);
101 iprtd->period = params_period_bytes(params) ; 85 iprtd->period = params_period_bytes(params);
102 iprtd->offset = 0; 86 iprtd->offset = 0;
103 iprtd->last_offset = 0;
104 iprtd->poll_time_ns = 1000000000 / params_rate(params) * 87 iprtd->poll_time_ns = 1000000000 / params_rate(params) *
105 params_period_size(params); 88 params_period_size(params);
106 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); 89 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);