aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/vivi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 523f78c4847..2a6ebc126c0 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -134,6 +134,11 @@ static struct vivi_fmt formats[] = {
134 .fourcc = V4L2_PIX_FMT_YUYV, 134 .fourcc = V4L2_PIX_FMT_YUYV,
135 .depth = 16, 135 .depth = 16,
136 }, 136 },
137 {
138 .name = "4:2:2, packed, UYVY",
139 .fourcc = V4L2_PIX_FMT_UYVY,
140 .depth = 16,
141 },
137}; 142};
138 143
139static struct vivi_fmt *get_format(struct v4l2_format *f) 144static struct vivi_fmt *get_format(struct v4l2_format *f)
@@ -282,6 +287,20 @@ static void gen_twopix(struct vivi_fh *fh, unsigned char *buf, int colorpos)
282 break; 287 break;
283 } 288 }
284 break; 289 break;
290 case V4L2_PIX_FMT_UYVY:
291 switch (color) {
292 case 1:
293 case 3:
294 *p = r_y;
295 break;
296 case 0:
297 *p = g_u;
298 break;
299 case 2:
300 *p = b_v;
301 break;
302 }
303 break;
285 } 304 }
286 } 305 }
287} 306}
@@ -756,6 +775,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
756 775
757 switch (fh->fmt->fourcc) { 776 switch (fh->fmt->fourcc) {
758 case V4L2_PIX_FMT_YUYV: 777 case V4L2_PIX_FMT_YUYV:
778 case V4L2_PIX_FMT_UYVY:
759 is_yuv = 1; 779 is_yuv = 1;
760 break; 780 break;
761 } 781 }