aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJaime Velasco Juan <jsagarribay@gmail.com>2008-01-27 10:24:58 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-02-18 09:14:57 -0500
commit1112fb68ae9c838294d38e1f209fedbc0dbf11d5 (patch)
treeb67cebd5214e32a60c9691873519c47e60bc0b61 /drivers/media/video
parent0ed464e13e9321de9d1fff356eda58498574272e (diff)
V4L/DVB (7088): V4L: stkwebcam: Add support for YUYV format
Signed-off-by: Jaime Velasco Juan <jsagarribay@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/stk-sensor.c19
-rw-r--r--drivers/media/video/stk-webcam.c7
2 files changed, 24 insertions, 2 deletions
diff --git a/drivers/media/video/stk-sensor.c b/drivers/media/video/stk-sensor.c
index 4a9a0b62efa3..1a8692d9ee5a 100644
--- a/drivers/media/video/stk-sensor.c
+++ b/drivers/media/video/stk-sensor.c
@@ -380,7 +380,7 @@ int stk_sensor_init(struct stk_camera *dev)
380 STK_ERROR("Strange error reading sensor ID\n"); 380 STK_ERROR("Strange error reading sensor ID\n");
381 return -ENODEV; 381 return -ENODEV;
382 } 382 }
383 if (idh != 0x7F || idl != 0xA2) { 383 if (idh != 0x7f || idl != 0xa2) {
384 STK_ERROR("Huh? you don't have a sensor from ovt\n"); 384 STK_ERROR("Huh? you don't have a sensor from ovt\n");
385 return -ENODEV; 385 return -ENODEV;
386 } 386 }
@@ -409,6 +409,19 @@ static struct regval ov_fmt_uyvy[] = {
409 {REG_COM15, COM15_R00FF }, 409 {REG_COM15, COM15_R00FF },
410 {0xff, 0xff}, /* END MARKER */ 410 {0xff, 0xff}, /* END MARKER */
411}; 411};
412/* V4L2_PIX_FMT_YUYV */
413static struct regval ov_fmt_yuyv[] = {
414 {REG_TSLB, 0 },
415 { 0x4f, 0x80 }, /* "matrix coefficient 1" */
416 { 0x50, 0x80 }, /* "matrix coefficient 2" */
417 { 0x51, 0 }, /* vb */
418 { 0x52, 0x22 }, /* "matrix coefficient 4" */
419 { 0x53, 0x5e }, /* "matrix coefficient 5" */
420 { 0x54, 0x80 }, /* "matrix coefficient 6" */
421 {REG_COM13, COM13_UVSAT|COM13_CMATRIX},
422 {REG_COM15, COM15_R00FF },
423 {0xff, 0xff}, /* END MARKER */
424};
412 425
413/* V4L2_PIX_FMT_RGB565X rrrrrggg gggbbbbb */ 426/* V4L2_PIX_FMT_RGB565X rrrrrggg gggbbbbb */
414static struct regval ov_fmt_rgbr[] = { 427static struct regval ov_fmt_rgbr[] = {
@@ -519,6 +532,10 @@ int stk_sensor_configure(struct stk_camera *dev)
519 com7 |= COM7_YUV; 532 com7 |= COM7_YUV;
520 rv = ov_fmt_uyvy; 533 rv = ov_fmt_uyvy;
521 break; 534 break;
535 case V4L2_PIX_FMT_YUYV:
536 com7 |= COM7_YUV;
537 rv = ov_fmt_yuyv;
538 break;
522 case V4L2_PIX_FMT_RGB565: 539 case V4L2_PIX_FMT_RGB565:
523 com7 |= COM7_RGB; 540 com7 |= COM7_RGB;
524 rv = ov_fmt_rgbp; 541 rv = ov_fmt_rgbp;
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index d37e5e2594b4..ba4fe934ee9e 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -993,6 +993,10 @@ static int stk_vidioc_enum_fmt_cap(struct file *filp,
993 fmtd->pixelformat = V4L2_PIX_FMT_SBGGR8; 993 fmtd->pixelformat = V4L2_PIX_FMT_SBGGR8;
994 strcpy(fmtd->description, "Raw bayer"); 994 strcpy(fmtd->description, "Raw bayer");
995 break; 995 break;
996 case 4:
997 fmtd->pixelformat = V4L2_PIX_FMT_YUYV;
998 strcpy(fmtd->description, "yuv4:2:2");
999 break;
996 default: 1000 default:
997 return -EINVAL; 1001 return -EINVAL;
998 } 1002 }
@@ -1048,6 +1052,7 @@ static int stk_vidioc_try_fmt_cap(struct file *filp,
1048 case V4L2_PIX_FMT_RGB565: 1052 case V4L2_PIX_FMT_RGB565:
1049 case V4L2_PIX_FMT_RGB565X: 1053 case V4L2_PIX_FMT_RGB565X:
1050 case V4L2_PIX_FMT_UYVY: 1054 case V4L2_PIX_FMT_UYVY:
1055 case V4L2_PIX_FMT_YUYV:
1051 case V4L2_PIX_FMT_SBGGR8: 1056 case V4L2_PIX_FMT_SBGGR8:
1052 break; 1057 break;
1053 default: 1058 default:
@@ -1403,7 +1408,7 @@ static int stk_camera_probe(struct usb_interface *interface,
1403 dev->vsettings.brightness = 0x7fff; 1408 dev->vsettings.brightness = 0x7fff;
1404 dev->vsettings.palette = V4L2_PIX_FMT_RGB565; 1409 dev->vsettings.palette = V4L2_PIX_FMT_RGB565;
1405 dev->vsettings.mode = MODE_VGA; 1410 dev->vsettings.mode = MODE_VGA;
1406 dev->frame_size = 640*480*2; 1411 dev->frame_size = 640 * 480 * 2;
1407 1412
1408 INIT_LIST_HEAD(&dev->sio_avail); 1413 INIT_LIST_HEAD(&dev->sio_avail);
1409 INIT_LIST_HEAD(&dev->sio_full); 1414 INIT_LIST_HEAD(&dev->sio_full);