aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9v022.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>2008-04-22 14:45:13 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:07:44 -0300
commitbb55de3b0e3523469491a48c51dcf7c6738162b2 (patch)
tree364cda8ce8498e85ae0fb6ea280b60dd50bc06af /drivers/media/video/mt9v022.c
parentb1daf7e1233845db556ace20f80c7c531143498c (diff)
downloadkernel_samsung_smdk4412-bb55de3b0e3523469491a48c51dcf7c6738162b2.zip
kernel_samsung_smdk4412-bb55de3b0e3523469491a48c51dcf7c6738162b2.tar.gz
kernel_samsung_smdk4412-bb55de3b0e3523469491a48c51dcf7c6738162b2.tar.bz2
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/mt9v022.c')
-rw-r--r--drivers/media/video/mt9v022.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index 4683339..d677344 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");
/* Progressive scan, master, defaults */
#define MT9V022_CHIP_CONTROL_DEFAULT 0x188
-static const struct soc_camera_data_format mt9v022_formats[] = {
+static const struct soc_camera_data_format mt9v022_colour_formats[] = {
+ /* Order important: first natively supported,
+ * second supported with a GPIO extender */
{
- .name = "RGB Bayer (sRGB)",
- .depth = 8,
- .fourcc = V4L2_PIX_FMT_SBGGR8,
- .colorspace = V4L2_COLORSPACE_SRGB,
- }, {
- .name = "RGB Bayer (sRGB)",
+ .name = "Bayer (sRGB) 10 bit",
.depth = 10,
.fourcc = V4L2_PIX_FMT_SBGGR16,
.colorspace = V4L2_COLORSPACE_SRGB,
}, {
+ .name = "Bayer (sRGB) 8 bit",
+ .depth = 8,
+ .fourcc = V4L2_PIX_FMT_SBGGR8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ }
+};
+
+static const struct soc_camera_data_format mt9v022_monochrome_formats[] = {
+ /* Order important - see above */
+ {
.name = "Monochrome 10 bit",
.depth = 10,
.fourcc = V4L2_PIX_FMT_Y16,
@@ -486,8 +493,8 @@ static struct soc_camera_ops mt9v022_ops = {
.stop_capture = mt9v022_stop_capture,
.set_capture_format = mt9v022_set_capture_format,
.try_fmt_cap = mt9v022_try_fmt_cap,
- .formats = mt9v022_formats,
- .num_formats = ARRAY_SIZE(mt9v022_formats),
+ .formats = NULL, /* Filled in later depending on the */
+ .num_formats = 0, /* sensor type and data widths */
.get_datawidth = mt9v022_get_datawidth,
.controls = mt9v022_controls,
.num_controls = ARRAY_SIZE(mt9v022_controls),
@@ -671,9 +678,19 @@ static int mt9v022_video_probe(struct soc_camera_device *icd)
!strcmp("color", sensor_type))) {
ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11);
mt9v022->model = V4L2_IDENT_MT9V022IX7ATC;
+ mt9v022_ops.formats = mt9v022_colour_formats;
+ if (mt9v022->client->dev.platform_data)
+ mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_colour_formats);
+ else
+ mt9v022_ops.num_formats = 1;
} else {
ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 0x11);
mt9v022->model = V4L2_IDENT_MT9V022IX7ATM;
+ mt9v022_ops.formats = mt9v022_monochrome_formats;
+ if (mt9v022->client->dev.platform_data)
+ mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_monochrome_formats);
+ else
+ mt9v022_ops.num_formats = 1;
}
if (ret >= 0)