aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index fa88d382d5b5..2407607f2eff 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -165,6 +165,7 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
165 ceu_write(pcdev, CETCR, 0x0317f313 ^ 0x10); 165 ceu_write(pcdev, CETCR, 0x0317f313 ^ 0x10);
166 166
167 if (pcdev->active) { 167 if (pcdev->active) {
168 pcdev->active->state = VIDEOBUF_ACTIVE;
168 ceu_write(pcdev, CDAYR, videobuf_to_dma_contig(pcdev->active)); 169 ceu_write(pcdev, CDAYR, videobuf_to_dma_contig(pcdev->active));
169 ceu_write(pcdev, CAPSR, 0x1); /* start capture */ 170 ceu_write(pcdev, CAPSR, 0x1); /* start capture */
170 } 171 }
@@ -236,7 +237,7 @@ static void sh_mobile_ceu_videobuf_queue(struct videobuf_queue *vq,
236 dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, 237 dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,
237 vb, vb->baddr, vb->bsize); 238 vb, vb->baddr, vb->bsize);
238 239
239 vb->state = VIDEOBUF_ACTIVE; 240 vb->state = VIDEOBUF_QUEUED;
240 spin_lock_irqsave(&pcdev->lock, flags); 241 spin_lock_irqsave(&pcdev->lock, flags);
241 list_add_tail(&vb->queue, &pcdev->capture); 242 list_add_tail(&vb->queue, &pcdev->capture);
242 243
@@ -323,12 +324,24 @@ static void sh_mobile_ceu_remove_device(struct soc_camera_device *icd)
323{ 324{
324 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 325 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
325 struct sh_mobile_ceu_dev *pcdev = ici->priv; 326 struct sh_mobile_ceu_dev *pcdev = ici->priv;
327 unsigned long flags;
326 328
327 BUG_ON(icd != pcdev->icd); 329 BUG_ON(icd != pcdev->icd);
328 330
329 /* disable capture, disable interrupts */ 331 /* disable capture, disable interrupts */
330 ceu_write(pcdev, CEIER, 0); 332 ceu_write(pcdev, CEIER, 0);
331 ceu_write(pcdev, CAPSR, 1 << 16); /* reset */ 333 ceu_write(pcdev, CAPSR, 1 << 16); /* reset */
334
335 /* make sure active buffer is canceled */
336 spin_lock_irqsave(&pcdev->lock, flags);
337 if (pcdev->active) {
338 list_del(&pcdev->active->queue);
339 pcdev->active->state = VIDEOBUF_ERROR;
340 wake_up_all(&pcdev->active->done);
341 pcdev->active = NULL;
342 }
343 spin_unlock_irqrestore(&pcdev->lock, flags);
344
332 icd->ops->release(icd); 345 icd->ops->release(icd);
333 346
334 dev_info(&icd->dev, 347 dev_info(&icd->dev,