aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-06-14 04:48:00 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-23 02:11:24 -0400
commit124cc9c0c8acc77ac2f1114ee7eea961334020ba (patch)
tree9dc1a6fdeda3a5482c287fd86868732982433daf /drivers/media/video
parent7d9713735d7537baf2b00be806a8de08a5c9f11b (diff)
V4L/DVB (12074): gspca_ov519: Add 320x240 and 160x120 support for cif sensor cams
gspca_ov519: Add 320x240 and 160x120 support for cif sensor cams Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/ov519.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index 2d5d95f0277..55db32c95be 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -241,11 +241,21 @@ static const struct v4l2_pix_format ov519_vga_mode[] = {
241 .priv = 0}, 241 .priv = 0},
242}; 242};
243static const struct v4l2_pix_format ov519_sif_mode[] = { 243static const struct v4l2_pix_format ov519_sif_mode[] = {
244 {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
245 .bytesperline = 160,
246 .sizeimage = 160 * 120 * 3 / 8 + 590,
247 .colorspace = V4L2_COLORSPACE_JPEG,
248 .priv = 3},
244 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, 249 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
245 .bytesperline = 176, 250 .bytesperline = 176,
246 .sizeimage = 176 * 144 * 3 / 8 + 590, 251 .sizeimage = 176 * 144 * 3 / 8 + 590,
247 .colorspace = V4L2_COLORSPACE_JPEG, 252 .colorspace = V4L2_COLORSPACE_JPEG,
248 .priv = 1}, 253 .priv = 1},
254 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
255 .bytesperline = 320,
256 .sizeimage = 320 * 240 * 3 / 8 + 590,
257 .colorspace = V4L2_COLORSPACE_JPEG,
258 .priv = 2},
249 {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, 259 {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
250 .bytesperline = 352, 260 .bytesperline = 352,
251 .sizeimage = 352 * 288 * 3 / 8 + 590, 261 .sizeimage = 352 * 288 * 3 / 8 + 590,
@@ -266,11 +276,21 @@ static const struct v4l2_pix_format ov518_vga_mode[] = {
266 .priv = 0}, 276 .priv = 0},
267}; 277};
268static const struct v4l2_pix_format ov518_sif_mode[] = { 278static const struct v4l2_pix_format ov518_sif_mode[] = {
279 {160, 120, V4L2_PIX_FMT_OV518, V4L2_FIELD_NONE,
280 .bytesperline = 160,
281 .sizeimage = 40000,
282 .colorspace = V4L2_COLORSPACE_JPEG,
283 .priv = 3},
269 {176, 144, V4L2_PIX_FMT_OV518, V4L2_FIELD_NONE, 284 {176, 144, V4L2_PIX_FMT_OV518, V4L2_FIELD_NONE,
270 .bytesperline = 176, 285 .bytesperline = 176,
271 .sizeimage = 40000, 286 .sizeimage = 40000,
272 .colorspace = V4L2_COLORSPACE_JPEG, 287 .colorspace = V4L2_COLORSPACE_JPEG,
273 .priv = 1}, 288 .priv = 1},
289 {320, 240, V4L2_PIX_FMT_OV518, V4L2_FIELD_NONE,
290 .bytesperline = 320,
291 .sizeimage = 320 * 240 * 3 / 8 + 590,
292 .colorspace = V4L2_COLORSPACE_JPEG,
293 .priv = 2},
274 {352, 288, V4L2_PIX_FMT_OV518, V4L2_FIELD_NONE, 294 {352, 288, V4L2_PIX_FMT_OV518, V4L2_FIELD_NONE,
275 .bytesperline = 352, 295 .bytesperline = 352,
276 .sizeimage = 352 * 288 * 3 / 8 + 590, 296 .sizeimage = 352 * 288 * 3 / 8 + 590,
@@ -2039,7 +2059,7 @@ static int mode_init_ov_sensor_regs(struct sd *sd)
2039 int qvga; 2059 int qvga;
2040 2060
2041 gspca_dev = &sd->gspca_dev; 2061 gspca_dev = &sd->gspca_dev;
2042 qvga = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; 2062 qvga = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv & 1;
2043 2063
2044 /******** Mode (VGA/QVGA) and sensor specific regs ********/ 2064 /******** Mode (VGA/QVGA) and sensor specific regs ********/
2045 switch (sd->sensor) { 2065 switch (sd->sensor) {
@@ -2168,13 +2188,14 @@ static void sethvflip(struct sd *sd)
2168static int set_ov_sensor_window(struct sd *sd) 2188static int set_ov_sensor_window(struct sd *sd)
2169{ 2189{
2170 struct gspca_dev *gspca_dev; 2190 struct gspca_dev *gspca_dev;
2171 int qvga; 2191 int qvga, crop;
2172 int hwsbase, hwebase, vwsbase, vwebase, hwscale, vwscale; 2192 int hwsbase, hwebase, vwsbase, vwebase, hwscale, vwscale;
2173 int ret, hstart, hstop, vstop, vstart; 2193 int ret, hstart, hstop, vstop, vstart;
2174 __u8 v; 2194 __u8 v;
2175 2195
2176 gspca_dev = &sd->gspca_dev; 2196 gspca_dev = &sd->gspca_dev;
2177 qvga = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; 2197 qvga = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv & 1;
2198 crop = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv & 2;
2178 2199
2179 /* The different sensor ICs handle setting up of window differently. 2200 /* The different sensor ICs handle setting up of window differently.
2180 * IF YOU SET IT WRONG, YOU WILL GET ALL ZERO ISOC DATA FROM OV51x!! */ 2201 * IF YOU SET IT WRONG, YOU WILL GET ALL ZERO ISOC DATA FROM OV51x!! */
@@ -2201,6 +2222,12 @@ static int set_ov_sensor_window(struct sd *sd)
2201 if (sd->sensor == SEN_OV66308AF && qvga) 2222 if (sd->sensor == SEN_OV66308AF && qvga)
2202 /* HDG: this fixes U and V getting swapped */ 2223 /* HDG: this fixes U and V getting swapped */
2203 hwsbase++; 2224 hwsbase++;
2225 if (crop) {
2226 hwsbase += 8;
2227 hwebase += 8;
2228 vwsbase += 11;
2229 vwebase += 11;
2230 }
2204 break; 2231 break;
2205 case SEN_OV7620: 2232 case SEN_OV7620:
2206 hwsbase = 0x2f; /* From 7620.SET (spec is wrong) */ 2233 hwsbase = 0x2f; /* From 7620.SET (spec is wrong) */