aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mx1_camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mx1_camera.c')
-rw-r--r--drivers/media/video/mx1_camera.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index 72802291e812..4c1a439373c5 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -99,9 +99,11 @@ struct mx1_buffer {
99 int inwork; 99 int inwork;
100}; 100};
101 101
102/* i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor 102/*
103 * i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor
103 * Interface. If anyone ever builds hardware to enable more than 104 * Interface. If anyone ever builds hardware to enable more than
104 * one camera, they will have to modify this driver too */ 105 * one camera, they will have to modify this driver too
106 */
105struct mx1_camera_dev { 107struct mx1_camera_dev {
106 struct soc_camera_host soc_host; 108 struct soc_camera_host soc_host;
107 struct soc_camera_device *icd; 109 struct soc_camera_device *icd;
@@ -151,8 +153,10 @@ static void free_buffer(struct videobuf_queue *vq, struct mx1_buffer *buf)
151 dev_dbg(icd->dev.parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 153 dev_dbg(icd->dev.parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
152 vb, vb->baddr, vb->bsize); 154 vb, vb->baddr, vb->bsize);
153 155
154 /* This waits until this buffer is out of danger, i.e., until it is no 156 /*
155 * longer in STATE_QUEUED or STATE_ACTIVE */ 157 * This waits until this buffer is out of danger, i.e., until it is no
158 * longer in STATE_QUEUED or STATE_ACTIVE
159 */
156 videobuf_waiton(vb, 0, 0); 160 videobuf_waiton(vb, 0, 0);
157 videobuf_dma_contig_free(vq, vb); 161 videobuf_dma_contig_free(vq, vb);
158 162
@@ -174,8 +178,10 @@ static int mx1_videobuf_prepare(struct videobuf_queue *vq,
174 178
175 BUG_ON(NULL == icd->current_fmt); 179 BUG_ON(NULL == icd->current_fmt);
176 180
177 /* I think, in buf_prepare you only have to protect global data, 181 /*
178 * the actual buffer is yours */ 182 * I think, in buf_prepare you only have to protect global data,
183 * the actual buffer is yours
184 */
179 buf->inwork = 1; 185 buf->inwork = 1;
180 186
181 if (buf->fmt != icd->current_fmt || 187 if (buf->fmt != icd->current_fmt ||
@@ -381,8 +387,10 @@ static int mclk_get_divisor(struct mx1_camera_dev *pcdev)
381 387
382 lcdclk = clk_get_rate(pcdev->clk); 388 lcdclk = clk_get_rate(pcdev->clk);
383 389
384 /* We verify platform_mclk_10khz != 0, so if anyone breaks it, here 390 /*
385 * they get a nice Oops */ 391 * We verify platform_mclk_10khz != 0, so if anyone breaks it, here
392 * they get a nice Oops
393 */
386 div = (lcdclk + 2 * mclk - 1) / (2 * mclk) - 1; 394 div = (lcdclk + 2 * mclk - 1) / (2 * mclk) - 1;
387 395
388 dev_dbg(pcdev->icd->dev.parent, 396 dev_dbg(pcdev->icd->dev.parent,
@@ -420,8 +428,10 @@ static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
420 clk_disable(pcdev->clk); 428 clk_disable(pcdev->clk);
421} 429}
422 430
423/* The following two functions absolutely depend on the fact, that 431/*
424 * there can be only one camera on i.MX1/i.MXL camera sensor interface */ 432 * The following two functions absolutely depend on the fact, that
433 * there can be only one camera on i.MX1/i.MXL camera sensor interface
434 */
425static int mx1_camera_add_device(struct soc_camera_device *icd) 435static int mx1_camera_add_device(struct soc_camera_device *icd)
426{ 436{
427 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 437 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
@@ -578,10 +588,12 @@ static int mx1_camera_reqbufs(struct soc_camera_file *icf,
578{ 588{
579 int i; 589 int i;
580 590
581 /* This is for locking debugging only. I removed spinlocks and now I 591 /*
592 * This is for locking debugging only. I removed spinlocks and now I
582 * check whether .prepare is ever called on a linked buffer, or whether 593 * check whether .prepare is ever called on a linked buffer, or whether
583 * a dma IRQ can occur for an in-work or unlinked buffer. Until now 594 * a dma IRQ can occur for an in-work or unlinked buffer. Until now
584 * it hadn't triggered */ 595 * it hadn't triggered
596 */
585 for (i = 0; i < p->count; i++) { 597 for (i = 0; i < p->count; i++) {
586 struct mx1_buffer *buf = container_of(icf->vb_vidq.bufs[i], 598 struct mx1_buffer *buf = container_of(icf->vb_vidq.bufs[i],
587 struct mx1_buffer, vb); 599 struct mx1_buffer, vb);