diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2010-01-06 22:56:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:44 -0500 |
commit | 94b12d9ea555851632deee1c2b06c4f281a45e12 (patch) | |
tree | d98767316a132848927458384058f17f5f6d972f /drivers/media/video/cx18 | |
parent | c71fd169a13d34f26997b27183b510e0b7fc2623 (diff) |
V4L/DVB: cx18-alsa: Fix the rates definition and move some buffer freeing code.
Clarify the rates available for the device, and move the freeing of the buffer
to the free routine instead of the close (per Takashi's suggestion).
Thanks to Takashi Iwai for reviewing and providing feedback.
This work was sponsored by ONELAN Limited.
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r-- | drivers/media/video/cx18/cx18-alsa-pcm.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/media/video/cx18/cx18-alsa-pcm.c b/drivers/media/video/cx18/cx18-alsa-pcm.c index e613826d5a47..6e56df94e34b 100644 --- a/drivers/media/video/cx18/cx18-alsa-pcm.c +++ b/drivers/media/video/cx18/cx18-alsa-pcm.c | |||
@@ -55,7 +55,7 @@ static struct snd_pcm_hardware snd_cx18_hw_capture = { | |||
55 | 55 | ||
56 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 56 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
57 | 57 | ||
58 | .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT, | 58 | .rates = SNDRV_PCM_RATE_48000, |
59 | 59 | ||
60 | .rate_min = 48000, | 60 | .rate_min = 48000, |
61 | .rate_max = 48000, | 61 | .rate_max = 48000, |
@@ -196,7 +196,6 @@ static int snd_cx18_pcm_capture_open(struct snd_pcm_substream *substream) | |||
196 | 196 | ||
197 | static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream) | 197 | static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream) |
198 | { | 198 | { |
199 | unsigned long flags; | ||
200 | struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); | 199 | struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); |
201 | struct v4l2_device *v4l2_dev = cxsc->v4l2_dev; | 200 | struct v4l2_device *v4l2_dev = cxsc->v4l2_dev; |
202 | struct cx18 *cx = to_cx18(v4l2_dev); | 201 | struct cx18 *cx = to_cx18(v4l2_dev); |
@@ -212,14 +211,6 @@ static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream) | |||
212 | 211 | ||
213 | cx->pcm_announce_callback = NULL; | 212 | cx->pcm_announce_callback = NULL; |
214 | 213 | ||
215 | spin_lock_irqsave(&cxsc->slock, flags); | ||
216 | if (substream->runtime->dma_area) { | ||
217 | dprintk("freeing pcm capture region\n"); | ||
218 | vfree(substream->runtime->dma_area); | ||
219 | substream->runtime->dma_area = NULL; | ||
220 | } | ||
221 | spin_unlock_irqrestore(&cxsc->slock, flags); | ||
222 | |||
223 | return 0; | 214 | return 0; |
224 | } | 215 | } |
225 | 216 | ||
@@ -265,6 +256,17 @@ static int snd_cx18_pcm_hw_params(struct snd_pcm_substream *substream, | |||
265 | 256 | ||
266 | static int snd_cx18_pcm_hw_free(struct snd_pcm_substream *substream) | 257 | static int snd_cx18_pcm_hw_free(struct snd_pcm_substream *substream) |
267 | { | 258 | { |
259 | struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); | ||
260 | unsigned long flags; | ||
261 | |||
262 | spin_lock_irqsave(&cxsc->slock, flags); | ||
263 | if (substream->runtime->dma_area) { | ||
264 | dprintk("freeing pcm capture region\n"); | ||
265 | vfree(substream->runtime->dma_area); | ||
266 | substream->runtime->dma_area = NULL; | ||
267 | } | ||
268 | spin_unlock_irqrestore(&cxsc->slock, flags); | ||
269 | |||
268 | return 0; | 270 | return 0; |
269 | } | 271 | } |
270 | 272 | ||