diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2008-12-30 16:48:42 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 21:44:40 -0300 |
commit | 74cadfe1314f4cc6060dcfa5cea9ef13c6a824fd (patch) | |
tree | 437f0599f3b737876bf83e783c94132e714c9605 /drivers/media/video/gspca/m5602/m5602_ov9650.c | |
parent | 4eecb1767e0f1f800948eec9a3705c49a1b768aa (diff) |
V4L/DVB (11413): gspca - m5602-mt9m111: Separate mode vectors per sensor.
By separating the supported for each sensor into a separate vector we can
eliminate the nmodes variable and instead calculate it at runtime.
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/m5602/m5602_ov9650.c')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_ov9650.c | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c index 4d3fc78bdf4..130a29c7c53 100644 --- a/drivers/media/video/gspca/m5602/m5602_ov9650.c +++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c @@ -68,6 +68,50 @@ static { } }; +static struct v4l2_pix_format ov9650_modes[] = { + { + 176, + 144, + V4L2_PIX_FMT_SBGGR8, + V4L2_FIELD_NONE, + .sizeimage = + 176 * 144, + .bytesperline = 176, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 0 + }, { + 320, + 240, + V4L2_PIX_FMT_SBGGR8, + V4L2_FIELD_NONE, + .sizeimage = + 320 * 240, + .bytesperline = 320, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 0 + }, { + 352, + 288, + V4L2_PIX_FMT_SBGGR8, + V4L2_FIELD_NONE, + .sizeimage = + 352 * 288, + .bytesperline = 352, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 0 + }, { + 640, + 480, + V4L2_PIX_FMT_SBGGR8, + V4L2_FIELD_NONE, + .sizeimage = + 640 * 480, + .bytesperline = 640, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 0 + } +}; + static void ov9650_dump_registers(struct sd *sd); int ov9650_probe(struct sd *sd) @@ -110,8 +154,11 @@ int ov9650_probe(struct sd *sd) return -ENODEV; sensor_found: - sd->gspca_dev.cam.cam_mode = ov9650.modes; - sd->gspca_dev.cam.nmodes = ov9650.nmodes; +// sd->gspca_dev.cam.cam_mode = ov9650.modes; +// sd->gspca_dev.cam.nmodes = ov9650.nmodes; + sd->gspca_dev.cam.cam_mode = ov9650_modes; + sd->gspca_dev.cam.nmodes = ARRAY_SIZE(ov9650_modes); + sd->desc->ctrls = ov9650.ctrls; sd->desc->nctrls = ARRAY_SIZE(ov9650_ctrls); return 0; |