diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2008-12-30 14:48:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 20:44:40 -0400 |
commit | 74cadfe1314f4cc6060dcfa5cea9ef13c6a824fd (patch) | |
tree | 437f0599f3b737876bf83e783c94132e714c9605 /drivers/media/video/gspca/m5602/m5602_mt9m111.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_mt9m111.c')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_mt9m111.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c index 69f8f6ce5811..5b57fb1eb4d0 100644 --- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c | |||
@@ -18,6 +18,19 @@ | |||
18 | 18 | ||
19 | #include "m5602_mt9m111.h" | 19 | #include "m5602_mt9m111.h" |
20 | 20 | ||
21 | static struct v4l2_pix_format mt9m111_modes[] = { | ||
22 | { | ||
23 | 640, | ||
24 | 480, | ||
25 | V4L2_PIX_FMT_SBGGR8, | ||
26 | V4L2_FIELD_NONE, | ||
27 | .sizeimage = 640 * 480, | ||
28 | .bytesperline = 640, | ||
29 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
30 | .priv = 0 | ||
31 | } | ||
32 | }; | ||
33 | |||
21 | static void mt9m111_dump_registers(struct sd *sd); | 34 | static void mt9m111_dump_registers(struct sd *sd); |
22 | 35 | ||
23 | int mt9m111_probe(struct sd *sd) | 36 | int mt9m111_probe(struct sd *sd) |
@@ -62,8 +75,8 @@ int mt9m111_probe(struct sd *sd) | |||
62 | return -ENODEV; | 75 | return -ENODEV; |
63 | 76 | ||
64 | sensor_found: | 77 | sensor_found: |
65 | sd->gspca_dev.cam.cam_mode = mt9m111.modes; | 78 | sd->gspca_dev.cam.cam_mode = mt9m111_modes; |
66 | sd->gspca_dev.cam.nmodes = mt9m111.nmodes; | 79 | sd->gspca_dev.cam.nmodes = ARRAY_SIZE(mt9m111_modes); |
67 | sd->desc->ctrls = mt9m111.ctrls; | 80 | sd->desc->ctrls = mt9m111.ctrls; |
68 | sd->desc->nctrls = ARRAY_SIZE(mt9m111_ctrls); | 81 | sd->desc->nctrls = ARRAY_SIZE(mt9m111_ctrls); |
69 | return 0; | 82 | return 0; |