diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2008-12-30 20:48:42 +0100 |
---|---|---|
committer | Erik Andr?n <erik.andren@gmail.com> | 2008-12-30 20:48:42 +0100 |
commit | 63e01b8a8e4578a822d040b6acb59fabd531b9b6 (patch) | |
tree | 91d63d6ad34035de185006c1ad85dfc7a12e2633 /linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c | |
parent | 5d2a8429aa0bc4f056fbf716fc5cb094c68ef979 (diff) | |
download | mediapointer-dvb-s2-63e01b8a8e4578a822d040b6acb59fabd531b9b6.tar.gz mediapointer-dvb-s2-63e01b8a8e4578a822d040b6acb59fabd531b9b6.tar.bz2 |
gspca - m5602-mt9m111: Separate mode vectors per sensor.
From: Erik Andr?n <erik.andren@gmail.com>
By separating the supported for each sensor into a separate vector we can
eliminate the nmodes variable and instead calculate it at runtime.
Priority: normal
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c')
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c index 6880b3157..fcc8c3752 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c @@ -18,6 +18,20 @@ #include "m5602_s5k83a.h" +static struct v4l2_pix_format s5k83a_modes[] = { + { + 640, + 480, + V4L2_PIX_FMT_SBGGR8, + V4L2_FIELD_NONE, + .sizeimage = + 640 * 480, + .bytesperline = 640, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 0 + } +}; + static void s5k83a_dump_registers(struct sd *sd); int s5k83a_probe(struct sd *sd) @@ -63,8 +77,8 @@ int s5k83a_probe(struct sd *sd) info("Detected a s5k83a sensor"); sensor_found: - sd->gspca_dev.cam.cam_mode = s5k83a.modes; - sd->gspca_dev.cam.nmodes = s5k83a.nmodes; + sd->gspca_dev.cam.cam_mode = s5k83a_modes; + sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k83a_modes); sd->desc->ctrls = s5k83a.ctrls; sd->desc->nctrls = ARRAY_SIZE(s5k83a_ctrls); return 0; |