aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mt9m001.c36
-rw-r--r--drivers/media/video/mt9t031.c24
-rw-r--r--drivers/media/video/mt9v022.c48
-rw-r--r--drivers/media/video/mx1_camera.c36
-rw-r--r--drivers/media/video/mx3_camera.c18
-rw-r--r--drivers/media/video/pxa_camera.c54
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c18
-rw-r--r--drivers/media/video/soc_camera.c24
-rw-r--r--drivers/media/video/tw9910.c8
9 files changed, 176 insertions, 90 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index 17be2d46fd40..cc9066000c2d 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -17,9 +17,11 @@
17#include <media/v4l2-chip-ident.h> 17#include <media/v4l2-chip-ident.h>
18#include <media/soc_camera.h> 18#include <media/soc_camera.h>
19 19
20/* mt9m001 i2c address 0x5d 20/*
21 * mt9m001 i2c address 0x5d
21 * The platform has to define ctruct i2c_board_info objects and link to them 22 * The platform has to define ctruct i2c_board_info objects and link to them
22 * from struct soc_camera_link */ 23 * from struct soc_camera_link
24 */
23 25
24/* mt9m001 selected register addresses */ 26/* mt9m001 selected register addresses */
25#define MT9M001_CHIP_VERSION 0x00 27#define MT9M001_CHIP_VERSION 0x00
@@ -47,8 +49,10 @@
47#define MT9M001_ROW_SKIP 12 49#define MT9M001_ROW_SKIP 12
48 50
49static const struct soc_camera_data_format mt9m001_colour_formats[] = { 51static const struct soc_camera_data_format mt9m001_colour_formats[] = {
50 /* Order important: first natively supported, 52 /*
51 * second supported with a GPIO extender */ 53 * Order important: first natively supported,
54 * second supported with a GPIO extender
55 */
52 { 56 {
53 .name = "Bayer (sRGB) 10 bit", 57 .name = "Bayer (sRGB) 10 bit",
54 .depth = 10, 58 .depth = 10,
@@ -230,8 +234,10 @@ static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
230 if (!ret) 234 if (!ret)
231 ret = reg_write(client, MT9M001_VERTICAL_BLANKING, vblank); 235 ret = reg_write(client, MT9M001_VERTICAL_BLANKING, vblank);
232 236
233 /* The caller provides a supported format, as verified per 237 /*
234 * call to icd->try_fmt() */ 238 * The caller provides a supported format, as verified per
239 * call to icd->try_fmt()
240 */
235 if (!ret) 241 if (!ret)
236 ret = reg_write(client, MT9M001_COLUMN_START, rect.left); 242 ret = reg_write(client, MT9M001_COLUMN_START, rect.left);
237 if (!ret) 243 if (!ret)
@@ -569,8 +575,10 @@ static int mt9m001_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
569 return 0; 575 return 0;
570} 576}
571 577
572/* Interface active, can use i2c. If it fails, it can indeed mean, that 578/*
573 * this wasn't our capture interface, so, we wait for the right one */ 579 * Interface active, can use i2c. If it fails, it can indeed mean, that
580 * this wasn't our capture interface, so, we wait for the right one
581 */
574static int mt9m001_video_probe(struct soc_camera_device *icd, 582static int mt9m001_video_probe(struct soc_camera_device *icd,
575 struct i2c_client *client) 583 struct i2c_client *client)
576{ 584{
@@ -580,8 +588,10 @@ static int mt9m001_video_probe(struct soc_camera_device *icd,
580 unsigned long flags; 588 unsigned long flags;
581 int ret; 589 int ret;
582 590
583 /* We must have a parent by now. And it cannot be a wrong one. 591 /*
584 * So this entire test is completely redundant. */ 592 * We must have a parent by now. And it cannot be a wrong one.
593 * So this entire test is completely redundant.
594 */
585 if (!icd->dev.parent || 595 if (!icd->dev.parent ||
586 to_soc_camera_host(icd->dev.parent)->nr != icd->iface) 596 to_soc_camera_host(icd->dev.parent)->nr != icd->iface)
587 return -ENODEV; 597 return -ENODEV;
@@ -737,8 +747,10 @@ static int mt9m001_probe(struct i2c_client *client,
737 mt9m001->rect.width = MT9M001_MAX_WIDTH; 747 mt9m001->rect.width = MT9M001_MAX_WIDTH;
738 mt9m001->rect.height = MT9M001_MAX_HEIGHT; 748 mt9m001->rect.height = MT9M001_MAX_HEIGHT;
739 749
740 /* Simulated autoexposure. If enabled, we calculate shutter width 750 /*
741 * ourselves in the driver based on vertical blanking and frame width */ 751 * Simulated autoexposure. If enabled, we calculate shutter width
752 * ourselves in the driver based on vertical blanking and frame width
753 */
742 mt9m001->autoexposure = 1; 754 mt9m001->autoexposure = 1;
743 755
744 ret = mt9m001_video_probe(icd, client); 756 ret = mt9m001_video_probe(icd, client);
diff --git a/drivers/media/video/mt9t031.c b/drivers/media/video/mt9t031.c
index 1adbb7b2b580..e3f664f21c48 100644
--- a/drivers/media/video/mt9t031.c
+++ b/drivers/media/video/mt9t031.c
@@ -17,9 +17,11 @@
17#include <media/v4l2-chip-ident.h> 17#include <media/v4l2-chip-ident.h>
18#include <media/soc_camera.h> 18#include <media/soc_camera.h>
19 19
20/* mt9t031 i2c address 0x5d 20/*
21 * mt9t031 i2c address 0x5d
21 * The platform has to define i2c_board_info and link to it from 22 * The platform has to define i2c_board_info and link to it from
22 * struct soc_camera_link */ 23 * struct soc_camera_link
24 */
23 25
24/* mt9t031 selected register addresses */ 26/* mt9t031 selected register addresses */
25#define MT9T031_CHIP_VERSION 0x00 27#define MT9T031_CHIP_VERSION 0x00
@@ -292,8 +294,10 @@ static int mt9t031_set_params(struct soc_camera_device *icd,
292 dev_dbg(&client->dev, "new physical left %u, top %u\n", 294 dev_dbg(&client->dev, "new physical left %u, top %u\n",
293 rect->left, rect->top); 295 rect->left, rect->top);
294 296
295 /* The caller provides a supported format, as guaranteed by 297 /*
296 * icd->try_fmt_cap(), soc_camera_s_crop() and soc_camera_cropcap() */ 298 * The caller provides a supported format, as guaranteed by
299 * icd->try_fmt_cap(), soc_camera_s_crop() and soc_camera_cropcap()
300 */
297 if (ret >= 0) 301 if (ret >= 0)
298 ret = reg_write(client, MT9T031_COLUMN_START, rect->left); 302 ret = reg_write(client, MT9T031_COLUMN_START, rect->left);
299 if (ret >= 0) 303 if (ret >= 0)
@@ -674,8 +678,10 @@ static int mt9t031_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
674 return 0; 678 return 0;
675} 679}
676 680
677/* Interface active, can use i2c. If it fails, it can indeed mean, that 681/*
678 * this wasn't our capture interface, so, we wait for the right one */ 682 * Interface active, can use i2c. If it fails, it can indeed mean, that
683 * this wasn't our capture interface, so, we wait for the right one
684 */
679static int mt9t031_video_probe(struct i2c_client *client) 685static int mt9t031_video_probe(struct i2c_client *client)
680{ 686{
681 struct soc_camera_device *icd = client->dev.platform_data; 687 struct soc_camera_device *icd = client->dev.platform_data;
@@ -796,8 +802,10 @@ static int mt9t031_probe(struct i2c_client *client,
796 mt9t031->rect.width = MT9T031_MAX_WIDTH; 802 mt9t031->rect.width = MT9T031_MAX_WIDTH;
797 mt9t031->rect.height = MT9T031_MAX_HEIGHT; 803 mt9t031->rect.height = MT9T031_MAX_HEIGHT;
798 804
799 /* Simulated autoexposure. If enabled, we calculate shutter width 805 /*
800 * ourselves in the driver based on vertical blanking and frame width */ 806 * Simulated autoexposure. If enabled, we calculate shutter width
807 * ourselves in the driver based on vertical blanking and frame width
808 */
801 mt9t031->autoexposure = 1; 809 mt9t031->autoexposure = 1;
802 810
803 mt9t031->xskip = 1; 811 mt9t031->xskip = 1;
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index b71898f1b085..f60a9a107f20 100644
--- a/drivers/media/video/mt9v022.c
+++ b/drivers/media/video/mt9v022.c
@@ -18,9 +18,11 @@
18#include <media/v4l2-chip-ident.h> 18#include <media/v4l2-chip-ident.h>
19#include <media/soc_camera.h> 19#include <media/soc_camera.h>
20 20
21/* mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c 21/*
22 * mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c
22 * The platform has to define ctruct i2c_board_info objects and link to them 23 * The platform has to define ctruct i2c_board_info objects and link to them
23 * from struct soc_camera_link */ 24 * from struct soc_camera_link
25 */
24 26
25static char *sensor_type; 27static char *sensor_type;
26module_param(sensor_type, charp, S_IRUGO); 28module_param(sensor_type, charp, S_IRUGO);
@@ -63,8 +65,10 @@ MODULE_PARM_DESC(sensor_type, "Sensor type: \"colour\" or \"monochrome\"");
63#define MT9V022_ROW_SKIP 4 65#define MT9V022_ROW_SKIP 4
64 66
65static const struct soc_camera_data_format mt9v022_colour_formats[] = { 67static const struct soc_camera_data_format mt9v022_colour_formats[] = {
66 /* Order important: first natively supported, 68 /*
67 * second supported with a GPIO extender */ 69 * Order important: first natively supported,
70 * second supported with a GPIO extender
71 */
68 { 72 {
69 .name = "Bayer (sRGB) 10 bit", 73 .name = "Bayer (sRGB) 10 bit",
70 .depth = 10, 74 .depth = 10,
@@ -144,9 +148,11 @@ static int mt9v022_init(struct i2c_client *client)
144 struct mt9v022 *mt9v022 = to_mt9v022(client); 148 struct mt9v022 *mt9v022 = to_mt9v022(client);
145 int ret; 149 int ret;
146 150
147 /* Almost the default mode: master, parallel, simultaneous, and an 151 /*
152 * Almost the default mode: master, parallel, simultaneous, and an
148 * undocumented bit 0x200, which is present in table 7, but not in 8, 153 * undocumented bit 0x200, which is present in table 7, but not in 8,
149 * plus snapshot mode to disable scan for now */ 154 * plus snapshot mode to disable scan for now
155 */
150 mt9v022->chip_control |= 0x10; 156 mt9v022->chip_control |= 0x10;
151 ret = reg_write(client, MT9V022_CHIP_CONTROL, mt9v022->chip_control); 157 ret = reg_write(client, MT9V022_CHIP_CONTROL, mt9v022->chip_control);
152 if (!ret) 158 if (!ret)
@@ -298,8 +304,10 @@ static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
298 if (!ret) 304 if (!ret)
299 ret = reg_write(client, MT9V022_ROW_START, rect.top); 305 ret = reg_write(client, MT9V022_ROW_START, rect.top);
300 if (!ret) 306 if (!ret)
301 /* Default 94, Phytec driver says: 307 /*
302 * "width + horizontal blank >= 660" */ 308 * Default 94, Phytec driver says:
309 * "width + horizontal blank >= 660"
310 */
303 ret = reg_write(client, MT9V022_HORIZONTAL_BLANKING, 311 ret = reg_write(client, MT9V022_HORIZONTAL_BLANKING,
304 rect.width > 660 - 43 ? 43 : 312 rect.width > 660 - 43 ? 43 :
305 660 - rect.width); 313 660 - rect.width);
@@ -376,8 +384,10 @@ static int mt9v022_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
376 }; 384 };
377 int ret; 385 int ret;
378 386
379 /* The caller provides a supported format, as verified per call to 387 /*
380 * icd->try_fmt(), datawidth is from our supported format list */ 388 * The caller provides a supported format, as verified per call to
389 * icd->try_fmt(), datawidth is from our supported format list
390 */
381 switch (pix->pixelformat) { 391 switch (pix->pixelformat) {
382 case V4L2_PIX_FMT_GREY: 392 case V4L2_PIX_FMT_GREY:
383 case V4L2_PIX_FMT_Y16: 393 case V4L2_PIX_FMT_Y16:
@@ -635,8 +645,10 @@ static int mt9v022_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
635 48 + range / 2) / range + 16; 645 48 + range / 2) / range + 16;
636 if (gain >= 32) 646 if (gain >= 32)
637 gain &= ~1; 647 gain &= ~1;
638 /* The user wants to set gain manually, hope, she 648 /*
639 * knows, what she's doing... Switch AGC off. */ 649 * The user wants to set gain manually, hope, she
650 * knows, what she's doing... Switch AGC off.
651 */
640 652
641 if (reg_clear(client, MT9V022_AEC_AGC_ENABLE, 0x2) < 0) 653 if (reg_clear(client, MT9V022_AEC_AGC_ENABLE, 0x2) < 0)
642 return -EIO; 654 return -EIO;
@@ -655,8 +667,10 @@ static int mt9v022_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
655 unsigned long range = qctrl->maximum - qctrl->minimum; 667 unsigned long range = qctrl->maximum - qctrl->minimum;
656 unsigned long shutter = ((ctrl->value - qctrl->minimum) * 668 unsigned long shutter = ((ctrl->value - qctrl->minimum) *
657 479 + range / 2) / range + 1; 669 479 + range / 2) / range + 1;
658 /* The user wants to set shutter width manually, hope, 670 /*
659 * she knows, what she's doing... Switch AEC off. */ 671 * The user wants to set shutter width manually, hope,
672 * she knows, what she's doing... Switch AEC off.
673 */
660 674
661 if (reg_clear(client, MT9V022_AEC_AGC_ENABLE, 0x1) < 0) 675 if (reg_clear(client, MT9V022_AEC_AGC_ENABLE, 0x1) < 0)
662 return -EIO; 676 return -EIO;
@@ -689,8 +703,10 @@ static int mt9v022_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
689 return 0; 703 return 0;
690} 704}
691 705
692/* Interface active, can use i2c. If it fails, it can indeed mean, that 706/*
693 * this wasn't our capture interface, so, we wait for the right one */ 707 * Interface active, can use i2c. If it fails, it can indeed mean, that
708 * this wasn't our capture interface, so, we wait for the right one
709 */
694static int mt9v022_video_probe(struct soc_camera_device *icd, 710static int mt9v022_video_probe(struct soc_camera_device *icd,
695 struct i2c_client *client) 711 struct i2c_client *client)
696{ 712{
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);
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index 7db82bdf6f31..ae7d48324493 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -564,8 +564,10 @@ static int test_platform_param(struct mx3_camera_dev *mx3_cam,
564 SOCAM_DATA_ACTIVE_HIGH | 564 SOCAM_DATA_ACTIVE_HIGH |
565 SOCAM_DATA_ACTIVE_LOW; 565 SOCAM_DATA_ACTIVE_LOW;
566 566
567 /* If requested data width is supported by the platform, use it or any 567 /*
568 * possible lower value - i.MX31 is smart enough to schift bits */ 568 * If requested data width is supported by the platform, use it or any
569 * possible lower value - i.MX31 is smart enough to schift bits
570 */
569 switch (buswidth) { 571 switch (buswidth) {
570 case 15: 572 case 15:
571 if (!(mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_15)) 573 if (!(mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_15))
@@ -1027,8 +1029,10 @@ static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
1027 common_flags &= ~SOCAM_PCLK_SAMPLE_FALLING; 1029 common_flags &= ~SOCAM_PCLK_SAMPLE_FALLING;
1028 } 1030 }
1029 1031
1030 /* Make the camera work in widest common mode, we'll take care of 1032 /*
1031 * the rest */ 1033 * Make the camera work in widest common mode, we'll take care of
1034 * the rest
1035 */
1032 if (common_flags & SOCAM_DATAWIDTH_15) 1036 if (common_flags & SOCAM_DATAWIDTH_15)
1033 common_flags = (common_flags & ~SOCAM_DATAWIDTH_MASK) | 1037 common_flags = (common_flags & ~SOCAM_DATAWIDTH_MASK) |
1034 SOCAM_DATAWIDTH_15; 1038 SOCAM_DATAWIDTH_15;
@@ -1152,8 +1156,10 @@ static int __devinit mx3_camera_probe(struct platform_device *pdev)
1152 if (!(mx3_cam->platform_flags & (MX3_CAMERA_DATAWIDTH_4 | 1156 if (!(mx3_cam->platform_flags & (MX3_CAMERA_DATAWIDTH_4 |
1153 MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10 | 1157 MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10 |
1154 MX3_CAMERA_DATAWIDTH_15))) { 1158 MX3_CAMERA_DATAWIDTH_15))) {
1155 /* Platform hasn't set available data widths. This is bad. 1159 /*
1156 * Warn and use a default. */ 1160 * Platform hasn't set available data widths. This is bad.
1161 * Warn and use a default.
1162 */
1157 dev_warn(&pdev->dev, "WARNING! Platform hasn't set available " 1163 dev_warn(&pdev->dev, "WARNING! Platform hasn't set available "
1158 "data widths, using default 8 bit\n"); 1164 "data widths, using default 8 bit\n");
1159 mx3_cam->platform_flags |= MX3_CAMERA_DATAWIDTH_8; 1165 mx3_cam->platform_flags |= MX3_CAMERA_DATAWIDTH_8;
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 4df09a693ec7..f063f5981f43 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -197,9 +197,11 @@ struct pxa_buffer {
197 197
198struct pxa_camera_dev { 198struct pxa_camera_dev {
199 struct soc_camera_host soc_host; 199 struct soc_camera_host soc_host;
200 /* PXA27x is only supposed to handle one camera on its Quick Capture 200 /*
201 * PXA27x is only supposed to handle one camera on its Quick Capture
201 * interface. If anyone ever builds hardware to enable more than 202 * interface. If anyone ever builds hardware to enable more than
202 * one camera, they will have to modify this driver too */ 203 * one camera, they will have to modify this driver too
204 */
203 struct soc_camera_device *icd; 205 struct soc_camera_device *icd;
204 struct clk *clk; 206 struct clk *clk;
205 207
@@ -267,8 +269,10 @@ static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf)
267 dev_dbg(icd->dev.parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 269 dev_dbg(icd->dev.parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
268 &buf->vb, buf->vb.baddr, buf->vb.bsize); 270 &buf->vb, buf->vb.baddr, buf->vb.bsize);
269 271
270 /* This waits until this buffer is out of danger, i.e., until it is no 272 /*
271 * longer in STATE_QUEUED or STATE_ACTIVE */ 273 * This waits until this buffer is out of danger, i.e., until it is no
274 * longer in STATE_QUEUED or STATE_ACTIVE
275 */
272 videobuf_waiton(&buf->vb, 0, 0); 276 videobuf_waiton(&buf->vb, 0, 0);
273 videobuf_dma_unmap(vq, dma); 277 videobuf_dma_unmap(vq, dma);
274 videobuf_dma_free(dma); 278 videobuf_dma_free(dma);
@@ -437,15 +441,19 @@ static int pxa_videobuf_prepare(struct videobuf_queue *vq,
437 WARN_ON(!list_empty(&vb->queue)); 441 WARN_ON(!list_empty(&vb->queue));
438 442
439#ifdef DEBUG 443#ifdef DEBUG
440 /* This can be useful if you want to see if we actually fill 444 /*
441 * the buffer with something */ 445 * This can be useful if you want to see if we actually fill
446 * the buffer with something
447 */
442 memset((void *)vb->baddr, 0xaa, vb->bsize); 448 memset((void *)vb->baddr, 0xaa, vb->bsize);
443#endif 449#endif
444 450
445 BUG_ON(NULL == icd->current_fmt); 451 BUG_ON(NULL == icd->current_fmt);
446 452
447 /* I think, in buf_prepare you only have to protect global data, 453 /*
448 * the actual buffer is yours */ 454 * I think, in buf_prepare you only have to protect global data,
455 * the actual buffer is yours
456 */
449 buf->inwork = 1; 457 buf->inwork = 1;
450 458
451 if (buf->fmt != icd->current_fmt || 459 if (buf->fmt != icd->current_fmt ||
@@ -834,8 +842,10 @@ static void pxa_camera_init_videobuf(struct videobuf_queue *q,
834 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 842 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
835 struct pxa_camera_dev *pcdev = ici->priv; 843 struct pxa_camera_dev *pcdev = ici->priv;
836 844
837 /* We must pass NULL as dev pointer, then all pci_* dma operations 845 /*
838 * transform to normal dma_* ones. */ 846 * We must pass NULL as dev pointer, then all pci_* dma operations
847 * transform to normal dma_* ones.
848 */
839 videobuf_queue_sg_init(q, &pxa_videobuf_ops, NULL, &pcdev->lock, 849 videobuf_queue_sg_init(q, &pxa_videobuf_ops, NULL, &pcdev->lock,
840 V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, 850 V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE,
841 sizeof(struct pxa_buffer), icd); 851 sizeof(struct pxa_buffer), icd);
@@ -1059,8 +1069,10 @@ static void pxa_camera_setup_cicr(struct soc_camera_device *icd,
1059 if (ret < 0) 1069 if (ret < 0)
1060 y_skip_top = 0; 1070 y_skip_top = 0;
1061 1071
1062 /* Datawidth is now guaranteed to be equal to one of the three values. 1072 /*
1063 * We fix bit-per-pixel equal to data-width... */ 1073 * Datawidth is now guaranteed to be equal to one of the three values.
1074 * We fix bit-per-pixel equal to data-width...
1075 */
1064 switch (flags & SOCAM_DATAWIDTH_MASK) { 1076 switch (flags & SOCAM_DATAWIDTH_MASK) {
1065 case SOCAM_DATAWIDTH_10: 1077 case SOCAM_DATAWIDTH_10:
1066 dw = 4; 1078 dw = 4;
@@ -1071,8 +1083,10 @@ static void pxa_camera_setup_cicr(struct soc_camera_device *icd,
1071 bpp = 0x20; 1083 bpp = 0x20;
1072 break; 1084 break;
1073 default: 1085 default:
1074 /* Actually it can only be 8 now, 1086 /*
1075 * default is just to silence compiler warnings */ 1087 * Actually it can only be 8 now,
1088 * default is just to silence compiler warnings
1089 */
1076 case SOCAM_DATAWIDTH_8: 1090 case SOCAM_DATAWIDTH_8:
1077 dw = 2; 1091 dw = 2;
1078 bpp = 0; 1092 bpp = 0;
@@ -1524,10 +1538,12 @@ static int pxa_camera_reqbufs(struct soc_camera_file *icf,
1524{ 1538{
1525 int i; 1539 int i;
1526 1540
1527 /* This is for locking debugging only. I removed spinlocks and now I 1541 /*
1542 * This is for locking debugging only. I removed spinlocks and now I
1528 * check whether .prepare is ever called on a linked buffer, or whether 1543 * check whether .prepare is ever called on a linked buffer, or whether
1529 * a dma IRQ can occur for an in-work or unlinked buffer. Until now 1544 * a dma IRQ can occur for an in-work or unlinked buffer. Until now
1530 * it hadn't triggered */ 1545 * it hadn't triggered
1546 */
1531 for (i = 0; i < p->count; i++) { 1547 for (i = 0; i < p->count; i++) {
1532 struct pxa_buffer *buf = container_of(icf->vb_vidq.bufs[i], 1548 struct pxa_buffer *buf = container_of(icf->vb_vidq.bufs[i],
1533 struct pxa_buffer, vb); 1549 struct pxa_buffer, vb);
@@ -1662,8 +1678,10 @@ static int __devinit pxa_camera_probe(struct platform_device *pdev)
1662 pcdev->platform_flags = pcdev->pdata->flags; 1678 pcdev->platform_flags = pcdev->pdata->flags;
1663 if (!(pcdev->platform_flags & (PXA_CAMERA_DATAWIDTH_8 | 1679 if (!(pcdev->platform_flags & (PXA_CAMERA_DATAWIDTH_8 |
1664 PXA_CAMERA_DATAWIDTH_9 | PXA_CAMERA_DATAWIDTH_10))) { 1680 PXA_CAMERA_DATAWIDTH_9 | PXA_CAMERA_DATAWIDTH_10))) {
1665 /* Platform hasn't set available data widths. This is bad. 1681 /*
1666 * Warn and use a default. */ 1682 * Platform hasn't set available data widths. This is bad.
1683 * Warn and use a default.
1684 */
1667 dev_warn(&pdev->dev, "WARNING! Platform hasn't set available " 1685 dev_warn(&pdev->dev, "WARNING! Platform hasn't set available "
1668 "data widths, using default 10 bit\n"); 1686 "data widths, using default 10 bit\n");
1669 pcdev->platform_flags |= PXA_CAMERA_DATAWIDTH_10; 1687 pcdev->platform_flags |= PXA_CAMERA_DATAWIDTH_10;
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 7509990c65d7..3271944f261c 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -252,7 +252,8 @@ static int sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
252 u32 status; 252 u32 status;
253 int ret = 0; 253 int ret = 0;
254 254
255 /* The hardware is _very_ picky about this sequence. Especially 255 /*
256 * The hardware is _very_ picky about this sequence. Especially
256 * the CEU_CETCR_MAGIC value. It seems like we need to acknowledge 257 * the CEU_CETCR_MAGIC value. It seems like we need to acknowledge
257 * several not-so-well documented interrupt sources in CETCR. 258 * several not-so-well documented interrupt sources in CETCR.
258 */ 259 */
@@ -321,8 +322,10 @@ static int sh_mobile_ceu_videobuf_prepare(struct videobuf_queue *vq,
321 WARN_ON(!list_empty(&vb->queue)); 322 WARN_ON(!list_empty(&vb->queue));
322 323
323#ifdef DEBUG 324#ifdef DEBUG
324 /* This can be useful if you want to see if we actually fill 325 /*
325 * the buffer with something */ 326 * This can be useful if you want to see if we actually fill
327 * the buffer with something
328 */
326 memset((void *)vb->baddr, 0xaa, vb->bsize); 329 memset((void *)vb->baddr, 0xaa, vb->bsize);
327#endif 330#endif
328 331
@@ -709,7 +712,8 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
709 712
710 ceu_write(pcdev, CFLCR, pcdev->cflcr); 713 ceu_write(pcdev, CFLCR, pcdev->cflcr);
711 714
712 /* A few words about byte order (observed in Big Endian mode) 715 /*
716 * A few words about byte order (observed in Big Endian mode)
713 * 717 *
714 * In data fetch mode bytes are received in chunks of 8 bytes. 718 * In data fetch mode bytes are received in chunks of 8 bytes.
715 * D0, D1, D2, D3, D4, D5, D6, D7 (D0 received first) 719 * D0, D1, D2, D3, D4, D5, D6, D7 (D0 received first)
@@ -1573,10 +1577,12 @@ static int sh_mobile_ceu_reqbufs(struct soc_camera_file *icf,
1573{ 1577{
1574 int i; 1578 int i;
1575 1579
1576 /* This is for locking debugging only. I removed spinlocks and now I 1580 /*
1581 * This is for locking debugging only. I removed spinlocks and now I
1577 * check whether .prepare is ever called on a linked buffer, or whether 1582 * check whether .prepare is ever called on a linked buffer, or whether
1578 * a dma IRQ can occur for an in-work or unlinked buffer. Until now 1583 * a dma IRQ can occur for an in-work or unlinked buffer. Until now
1579 * it hadn't triggered */ 1584 * it hadn't triggered
1585 */
1580 for (i = 0; i < p->count; i++) { 1586 for (i = 0; i < p->count; i++) {
1581 struct sh_mobile_ceu_buffer *buf; 1587 struct sh_mobile_ceu_buffer *buf;
1582 1588
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 804c675f2cb9..5fdedc766401 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -621,8 +621,10 @@ static int soc_camera_streamoff(struct file *file, void *priv,
621 621
622 mutex_lock(&icd->video_lock); 622 mutex_lock(&icd->video_lock);
623 623
624 /* This calls buf_release from host driver's videobuf_queue_ops for all 624 /*
625 * remaining buffers. When the last buffer is freed, stop capture */ 625 * This calls buf_release from host driver's videobuf_queue_ops for all
626 * remaining buffers. When the last buffer is freed, stop capture
627 */
626 videobuf_streamoff(&icf->vb_vidq); 628 videobuf_streamoff(&icf->vb_vidq);
627 629
628 v4l2_subdev_call(sd, video, s_stream, 0); 630 v4l2_subdev_call(sd, video, s_stream, 0);
@@ -1004,8 +1006,10 @@ epower:
1004 return ret; 1006 return ret;
1005} 1007}
1006 1008
1007/* This is called on device_unregister, which only means we have to disconnect 1009/*
1008 * from the host, but not remove ourselves from the device list */ 1010 * This is called on device_unregister, which only means we have to disconnect
1011 * from the host, but not remove ourselves from the device list
1012 */
1009static int soc_camera_remove(struct device *dev) 1013static int soc_camera_remove(struct device *dev)
1010{ 1014{
1011 struct soc_camera_device *icd = to_soc_camera_dev(dev); 1015 struct soc_camera_device *icd = to_soc_camera_dev(dev);
@@ -1205,8 +1209,10 @@ static int soc_camera_device_register(struct soc_camera_device *icd)
1205 } 1209 }
1206 1210
1207 if (num < 0) 1211 if (num < 0)
1208 /* ok, we have 256 cameras on this host... 1212 /*
1209 * man, stay reasonable... */ 1213 * ok, we have 256 cameras on this host...
1214 * man, stay reasonable...
1215 */
1210 return -ENOMEM; 1216 return -ENOMEM;
1211 1217
1212 icd->devnum = num; 1218 icd->devnum = num;
@@ -1333,9 +1339,11 @@ escdevreg:
1333 return ret; 1339 return ret;
1334} 1340}
1335 1341
1336/* Only called on rmmod for each platform device, since they are not 1342/*
1343 * Only called on rmmod for each platform device, since they are not
1337 * hot-pluggable. Now we know, that all our users - hosts and devices have 1344 * hot-pluggable. Now we know, that all our users - hosts and devices have
1338 * been unloaded already */ 1345 * been unloaded already
1346 */
1339static int __devexit soc_camera_pdrv_remove(struct platform_device *pdev) 1347static int __devexit soc_camera_pdrv_remove(struct platform_device *pdev)
1340{ 1348{
1341 struct soc_camera_device *icd = platform_get_drvdata(pdev); 1349 struct soc_camera_device *icd = platform_get_drvdata(pdev);
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
index 7bf90a29daee..3cb9ba6caa41 100644
--- a/drivers/media/video/tw9910.c
+++ b/drivers/media/video/tw9910.c
@@ -180,9 +180,8 @@
180 */ 180 */
181 181
182/* VBICNTL */ 182/* VBICNTL */
183/* RTSEL : control the real time signal 183
184* output from the MPOUT pin 184/* RTSEL : control the real time signal output from the MPOUT pin */
185*/
186#define RTSEL_MASK 0x07 185#define RTSEL_MASK 0x07
187#define RTSEL_VLOSS 0x00 /* 0000 = Video loss */ 186#define RTSEL_VLOSS 0x00 /* 0000 = Video loss */
188#define RTSEL_HLOCK 0x01 /* 0001 = H-lock */ 187#define RTSEL_HLOCK 0x01 /* 0001 = H-lock */
@@ -596,7 +595,8 @@ static int tw9910_g_register(struct v4l2_subdev *sd,
596 if (ret < 0) 595 if (ret < 0)
597 return ret; 596 return ret;
598 597
599 /* ret = int 598 /*
599 * ret = int
600 * reg->val = __u64 600 * reg->val = __u64
601 */ 601 */
602 reg->val = (__u64)ret; 602 reg->val = (__u64)ret;