diff options
Diffstat (limited to 'drivers/media/video/cafe_ccic.c')
-rw-r--r-- | drivers/media/video/cafe_ccic.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index f629c559e7dd..bfae5d2fd744 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c | |||
@@ -705,7 +705,13 @@ static void cafe_ctlr_init(struct cafe_camera *cam) | |||
705 | cafe_reg_write(cam, REG_GL_CSR, GCSR_SRS|GCSR_MRS); /* Needed? */ | 705 | cafe_reg_write(cam, REG_GL_CSR, GCSR_SRS|GCSR_MRS); /* Needed? */ |
706 | cafe_reg_write(cam, REG_GL_CSR, GCSR_SRC|GCSR_MRC); | 706 | cafe_reg_write(cam, REG_GL_CSR, GCSR_SRC|GCSR_MRC); |
707 | cafe_reg_write(cam, REG_GL_CSR, GCSR_SRC|GCSR_MRS); | 707 | cafe_reg_write(cam, REG_GL_CSR, GCSR_SRC|GCSR_MRS); |
708 | /* | ||
709 | * Here we must wait a bit for the controller to come around. | ||
710 | */ | ||
711 | spin_unlock_irqrestore(&cam->dev_lock, flags); | ||
708 | mdelay(5); /* FIXME revisit this */ | 712 | mdelay(5); /* FIXME revisit this */ |
713 | spin_lock_irqsave(&cam->dev_lock, flags); | ||
714 | |||
709 | cafe_reg_write(cam, REG_GL_CSR, GCSR_CCIC_EN|GCSR_SRC|GCSR_MRC); | 715 | cafe_reg_write(cam, REG_GL_CSR, GCSR_CCIC_EN|GCSR_SRC|GCSR_MRC); |
710 | cafe_reg_set_bit(cam, REG_GL_IMASK, GIMSK_CCIC_EN); | 716 | cafe_reg_set_bit(cam, REG_GL_IMASK, GIMSK_CCIC_EN); |
711 | /* | 717 | /* |
@@ -773,9 +779,9 @@ static void cafe_ctlr_power_up(struct cafe_camera *cam) | |||
773 | * Control 1 is power down, set to 0 to operate. | 779 | * Control 1 is power down, set to 0 to operate. |
774 | */ | 780 | */ |
775 | cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN); /* pwr up, reset */ | 781 | cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN); /* pwr up, reset */ |
776 | mdelay(1); /* Marvell says 1ms will do it */ | 782 | // mdelay(1); /* Marvell says 1ms will do it */ |
777 | cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C0); | 783 | cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C0); |
778 | mdelay(1); /* Enough? */ | 784 | // mdelay(1); /* Enough? */ |
779 | spin_unlock_irqrestore(&cam->dev_lock, flags); | 785 | spin_unlock_irqrestore(&cam->dev_lock, flags); |
780 | } | 786 | } |
781 | 787 | ||
@@ -1796,18 +1802,19 @@ static void cafe_frame_tasklet(unsigned long data) | |||
1796 | if (list_empty(&cam->sb_avail)) | 1802 | if (list_empty(&cam->sb_avail)) |
1797 | break; /* Leave it valid, hope for better later */ | 1803 | break; /* Leave it valid, hope for better later */ |
1798 | clear_bit(bufno, &cam->flags); | 1804 | clear_bit(bufno, &cam->flags); |
1799 | /* | ||
1800 | * We could perhaps drop the spinlock during this | ||
1801 | * big copy. Something to consider. | ||
1802 | */ | ||
1803 | sbuf = list_entry(cam->sb_avail.next, | 1805 | sbuf = list_entry(cam->sb_avail.next, |
1804 | struct cafe_sio_buffer, list); | 1806 | struct cafe_sio_buffer, list); |
1807 | /* | ||
1808 | * Drop the lock during the big copy. This *should* be safe... | ||
1809 | */ | ||
1810 | spin_unlock_irqrestore(&cam->dev_lock, flags); | ||
1805 | memcpy(sbuf->buffer, cam->dma_bufs[bufno], | 1811 | memcpy(sbuf->buffer, cam->dma_bufs[bufno], |
1806 | cam->pix_format.sizeimage); | 1812 | cam->pix_format.sizeimage); |
1807 | sbuf->v4lbuf.bytesused = cam->pix_format.sizeimage; | 1813 | sbuf->v4lbuf.bytesused = cam->pix_format.sizeimage; |
1808 | sbuf->v4lbuf.sequence = cam->buf_seq[bufno]; | 1814 | sbuf->v4lbuf.sequence = cam->buf_seq[bufno]; |
1809 | sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_QUEUED; | 1815 | sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_QUEUED; |
1810 | sbuf->v4lbuf.flags |= V4L2_BUF_FLAG_DONE; | 1816 | sbuf->v4lbuf.flags |= V4L2_BUF_FLAG_DONE; |
1817 | spin_lock_irqsave(&cam->dev_lock, flags); | ||
1811 | list_move_tail(&sbuf->list, &cam->sb_full); | 1818 | list_move_tail(&sbuf->list, &cam->sb_full); |
1812 | } | 1819 | } |
1813 | if (! list_empty(&cam->sb_full)) | 1820 | if (! list_empty(&cam->sb_full)) |