aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>2008-04-22 13:45:13 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:44 -0400
commitbb55de3b0e3523469491a48c51dcf7c6738162b2 (patch)
tree364cda8ce8498e85ae0fb6ea280b60dd50bc06af /drivers/media/video
parentb1daf7e1233845db556ace20f80c7c531143498c (diff)
V4L/DVB (7249): Fix advertised pixel formats in mt9m001 and mt9v022
Only advertise pixel formats, that we actually can support in the present configuration. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/mt9m001.c17
-rw-r--r--drivers/media/video/mt9v022.c35
2 files changed, 40 insertions, 12 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index e3afc82050af..4ad834326fa8 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -44,15 +44,23 @@
44#define MT9M001_CHIP_ENABLE 0xF1 44#define MT9M001_CHIP_ENABLE 0xF1
45 45
46static const struct soc_camera_data_format mt9m001_colour_formats[] = { 46static const struct soc_camera_data_format mt9m001_colour_formats[] = {
47 /* Order important: first natively supported,
48 * second supported with a GPIO extender */
47 { 49 {
48 .name = "RGB Bayer (sRGB)", 50 .name = "Bayer (sRGB) 10 bit",
49 .depth = 16, 51 .depth = 10,
52 .fourcc = V4L2_PIX_FMT_SBGGR16,
53 .colorspace = V4L2_COLORSPACE_SRGB,
54 }, {
55 .name = "Bayer (sRGB) 8 bit",
56 .depth = 8,
50 .fourcc = V4L2_PIX_FMT_SBGGR8, 57 .fourcc = V4L2_PIX_FMT_SBGGR8,
51 .colorspace = V4L2_COLORSPACE_SRGB, 58 .colorspace = V4L2_COLORSPACE_SRGB,
52 } 59 }
53}; 60};
54 61
55static const struct soc_camera_data_format mt9m001_monochrome_formats[] = { 62static const struct soc_camera_data_format mt9m001_monochrome_formats[] = {
63 /* Order important - see above */
56 { 64 {
57 .name = "Monochrome 10 bit", 65 .name = "Monochrome 10 bit",
58 .depth = 10, 66 .depth = 10,
@@ -547,7 +555,10 @@ static int mt9m001_video_probe(struct soc_camera_device *icd)
547 case 0x8421: 555 case 0x8421:
548 mt9m001->model = V4L2_IDENT_MT9M001C12ST; 556 mt9m001->model = V4L2_IDENT_MT9M001C12ST;
549 mt9m001_ops.formats = mt9m001_colour_formats; 557 mt9m001_ops.formats = mt9m001_colour_formats;
550 mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_colour_formats); 558 if (mt9m001->client->dev.platform_data)
559 mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_colour_formats);
560 else
561 mt9m001_ops.num_formats = 1;
551 break; 562 break;
552 case 0x8431: 563 case 0x8431:
553 mt9m001->model = V4L2_IDENT_MT9M001C12STM; 564 mt9m001->model = V4L2_IDENT_MT9M001C12STM;
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index 468333946d57..d677344d233d 100644
--- a/drivers/media/video/mt9v022.c
+++ b/drivers/media/video/mt9v022.c
@@ -59,18 +59,25 @@ MODULE_PARM_DESC(sensor_type, "Sensor type: \"colour\" or \"monochrome\"\n");
59/* Progressive scan, master, defaults */ 59/* Progressive scan, master, defaults */
60#define MT9V022_CHIP_CONTROL_DEFAULT 0x188 60#define MT9V022_CHIP_CONTROL_DEFAULT 0x188
61 61
62static const struct soc_camera_data_format mt9v022_formats[] = { 62static const struct soc_camera_data_format mt9v022_colour_formats[] = {
63 /* Order important: first natively supported,
64 * second supported with a GPIO extender */
63 { 65 {
64 .name = "RGB Bayer (sRGB)", 66 .name = "Bayer (sRGB) 10 bit",
65 .depth = 8,
66 .fourcc = V4L2_PIX_FMT_SBGGR8,
67 .colorspace = V4L2_COLORSPACE_SRGB,
68 }, {
69 .name = "RGB Bayer (sRGB)",
70 .depth = 10, 67 .depth = 10,
71 .fourcc = V4L2_PIX_FMT_SBGGR16, 68 .fourcc = V4L2_PIX_FMT_SBGGR16,
72 .colorspace = V4L2_COLORSPACE_SRGB, 69 .colorspace = V4L2_COLORSPACE_SRGB,
73 }, { 70 }, {
71 .name = "Bayer (sRGB) 8 bit",
72 .depth = 8,
73 .fourcc = V4L2_PIX_FMT_SBGGR8,
74 .colorspace = V4L2_COLORSPACE_SRGB,
75 }
76};
77
78static const struct soc_camera_data_format mt9v022_monochrome_formats[] = {
79 /* Order important - see above */
80 {
74 .name = "Monochrome 10 bit", 81 .name = "Monochrome 10 bit",
75 .depth = 10, 82 .depth = 10,
76 .fourcc = V4L2_PIX_FMT_Y16, 83 .fourcc = V4L2_PIX_FMT_Y16,
@@ -486,8 +493,8 @@ static struct soc_camera_ops mt9v022_ops = {
486 .stop_capture = mt9v022_stop_capture, 493 .stop_capture = mt9v022_stop_capture,
487 .set_capture_format = mt9v022_set_capture_format, 494 .set_capture_format = mt9v022_set_capture_format,
488 .try_fmt_cap = mt9v022_try_fmt_cap, 495 .try_fmt_cap = mt9v022_try_fmt_cap,
489 .formats = mt9v022_formats, 496 .formats = NULL, /* Filled in later depending on the */
490 .num_formats = ARRAY_SIZE(mt9v022_formats), 497 .num_formats = 0, /* sensor type and data widths */
491 .get_datawidth = mt9v022_get_datawidth, 498 .get_datawidth = mt9v022_get_datawidth,
492 .controls = mt9v022_controls, 499 .controls = mt9v022_controls,
493 .num_controls = ARRAY_SIZE(mt9v022_controls), 500 .num_controls = ARRAY_SIZE(mt9v022_controls),
@@ -671,9 +678,19 @@ static int mt9v022_video_probe(struct soc_camera_device *icd)
671 !strcmp("color", sensor_type))) { 678 !strcmp("color", sensor_type))) {
672 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11); 679 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11);
673 mt9v022->model = V4L2_IDENT_MT9V022IX7ATC; 680 mt9v022->model = V4L2_IDENT_MT9V022IX7ATC;
681 mt9v022_ops.formats = mt9v022_colour_formats;
682 if (mt9v022->client->dev.platform_data)
683 mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_colour_formats);
684 else
685 mt9v022_ops.num_formats = 1;
674 } else { 686 } else {
675 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 0x11); 687 ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 0x11);
676 mt9v022->model = V4L2_IDENT_MT9V022IX7ATM; 688 mt9v022->model = V4L2_IDENT_MT9V022IX7ATM;
689 mt9v022_ops.formats = mt9v022_monochrome_formats;
690 if (mt9v022->client->dev.platform_data)
691 mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_monochrome_formats);
692 else
693 mt9v022_ops.num_formats = 1;
677 } 694 }
678 695
679 if (ret >= 0) 696 if (ret >= 0)