summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c67
1 files changed, 25 insertions, 42 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index 157996e5f..fff90faca 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -90,52 +90,52 @@ MODULE_PARM_DESC(video_debug, "enable debug messages [video]");
/* supported video standards */
static struct em28xx_fmt format[] = {
{
- .name = "16bpp YUY2, 4:2:2, packed",
+ .name = "16 bpp YUY2, 4:2:2, packed",
.fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16,
.reg = EM28XX_OUTFMT_YUV422_Y0UY1V,
}, {
- .name = "16 bpp RGB, le",
+ .name = "16 bpp RGB 565, LE",
.fourcc = V4L2_PIX_FMT_RGB565,
.depth = 16,
- .reg = EM28XX_OUTFMT_YUV211,
-#if 0
- /* TODO: need tests and newer definitions */
+ .reg = EM28XX_OUTFMT_RGB_16_656,
}, {
- .name = "Y1-U-Y0-V, 16 bpp",
- .fourcc = 0,
- .depth = 16,
- .reg = EM28XX_OUTFMT_YUV422_Y1UY0V
+ .name = "8 bpp Bayer BGBG..GRGR",
+ .fourcc = V4L2_PIX_FMT_SBGGR8,
+ .depth = 8,
+ .reg = EM28XX_OUTFMT_RGB_8_BGBG,
}, {
- .name = "YUV211, 8 bpp",
- .fourcc = 0,
+ .name = "8 bpp Bayer GRGR..BGBG",
+ .fourcc = V4L2_PIX_FMT_SGRBG8,
.depth = 8,
- .reg = EM28XX_OUTFMT_YUV211,
+ .reg = EM28XX_OUTFMT_RGB_8_GRGR,
}, {
- .name = "YUV411, 12 bpp",
- .fourcc = 0,
+ .name = "8 bpp Bayer GBGB..RGRG",
+ .fourcc = V4L2_PIX_FMT_SGBRG8,
+ .depth = 8,
+ .reg = EM28XX_OUTFMT_RGB_8_GBGB,
+ }, {
+ .name = "12 bpp YUV411",
+ .fourcc = V4L2_PIX_FMT_YUV411P,
.depth = 12,
.reg = EM28XX_OUTFMT_YUV411,
+#if 0
+ /* TODO: Those formats need test and fourcc entries */
}, {
- .name = "RGB, 8bit RGRG",
+ .name = "Bayer, 8bit RGRG..GBGB",
.fourcc = 0,
.depth = 8,
- .reg = EM28XX_OUTFMT_YUV211,
+ .reg = EM28XX_OUTFMT_RGB_8_GBGB,
}, {
- .name = "RGB, 8bit GRGR",
+ .name = "Y1-U-Y0-V, 16 bpp",
.fourcc = 0,
- .depth = 8,
- .reg = EM28XX_OUTFMT_YUV211,
+ .depth = 16,
+ .reg = EM28XX_OUTFMT_YUV422_Y1UY0V
}, {
- .name = "RGB, 8bit GBGB",
+ .name = "YUV211, 8 bpp",
.fourcc = 0,
.depth = 8,
.reg = EM28XX_OUTFMT_YUV211,
- }, {
- .name = "RGB, 8bit BGBG",
- .fourcc = 0,
- .depth = 8,
- .reg = EM28XX_OUTFMT_RGB_8_BGBG,
#endif
},
};
@@ -741,10 +741,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
unsigned int hscale, vscale;
struct em28xx_fmt *fmt;
- /* FIXME: This is the only supported fmt */
- if (dev->board.is_27xx)
- f->fmt.pix.pixelformat = V4L2_PIX_FMT_RGB565;
-
fmt = format_by_fourcc(f->fmt.pix.pixelformat);
if (!fmt) {
em28xx_videodbg("Fourcc format (%08x) invalid.\n",
@@ -795,7 +791,6 @@ static int em28xx_set_video_format(struct em28xx *dev, unsigned int fourcc,
/* FIXME: This is the only supported fmt */
if (dev->board.is_27xx) {
- fourcc = V4L2_PIX_FMT_RGB565;
width = 640;
height = 480;
}
@@ -1444,18 +1439,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (unlikely(f->index >= ARRAY_SIZE(format)))
return -EINVAL;
- if (dev->board.is_27xx) {
- struct em28xx_fmt *fmt;
- if (f->index)
- return -EINVAL;
-
- f->pixelformat = V4L2_PIX_FMT_RGB565;
- fmt = format_by_fourcc(f->pixelformat);
- strlcpy(f->description, fmt->name, sizeof(f->description));
-
- return 0;
- }
-
strlcpy(f->description, format[f->index].name, sizeof(f->description));
f->pixelformat = format[f->index].fourcc;