Commit 009cb7d5 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: media/usb: don't set description in ENUM_FMT

The V4L2 core sets the description for the driver in order to ensure
consistent naming.

So drop the strscpy of the description in drivers. Also remove any
description strings in driver-internal structures since those are
no longer needed.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 4747bd0f
...@@ -81,11 +81,9 @@ struct rtl2832_sdr_format { ...@@ -81,11 +81,9 @@ struct rtl2832_sdr_format {
static struct rtl2832_sdr_format formats[] = { static struct rtl2832_sdr_format formats[] = {
{ {
.name = "Complex U8",
.pixelformat = V4L2_SDR_FMT_CU8, .pixelformat = V4L2_SDR_FMT_CU8,
.buffersize = BULK_BUFFER_SIZE, .buffersize = BULK_BUFFER_SIZE,
}, { }, {
.name = "Complex U16LE (emulated)",
.pixelformat = V4L2_SDR_FMT_CU16LE, .pixelformat = V4L2_SDR_FMT_CU16LE,
.buffersize = BULK_BUFFER_SIZE * 2, .buffersize = BULK_BUFFER_SIZE * 2,
}, },
...@@ -1116,7 +1114,6 @@ static int rtl2832_sdr_enum_fmt_sdr_cap(struct file *file, void *priv, ...@@ -1116,7 +1114,6 @@ static int rtl2832_sdr_enum_fmt_sdr_cap(struct file *file, void *priv,
if (f->index >= dev->num_formats) if (f->index >= dev->num_formats)
return -EINVAL; return -EINVAL;
strscpy(f->description, formats[f->index].name, sizeof(f->description));
f->pixelformat = formats[f->index].pixelformat; f->pixelformat = formats[f->index].pixelformat;
return 0; return 0;
......
...@@ -71,7 +71,6 @@ static const struct v4l2_frequency_band bands_rf[] = { ...@@ -71,7 +71,6 @@ static const struct v4l2_frequency_band bands_rf[] = {
/* stream formats */ /* stream formats */
struct airspy_format { struct airspy_format {
char *name;
u32 pixelformat; u32 pixelformat;
u32 buffersize; u32 buffersize;
}; };
...@@ -79,7 +78,6 @@ struct airspy_format { ...@@ -79,7 +78,6 @@ struct airspy_format {
/* format descriptions for capture and preview */ /* format descriptions for capture and preview */
static struct airspy_format formats[] = { static struct airspy_format formats[] = {
{ {
.name = "Real U12LE",
.pixelformat = V4L2_SDR_FMT_RU12LE, .pixelformat = V4L2_SDR_FMT_RU12LE,
.buffersize = BULK_BUFFER_SIZE, .buffersize = BULK_BUFFER_SIZE,
}, },
...@@ -622,7 +620,6 @@ static int airspy_enum_fmt_sdr_cap(struct file *file, void *priv, ...@@ -622,7 +620,6 @@ static int airspy_enum_fmt_sdr_cap(struct file *file, void *priv,
if (f->index >= NUM_FORMATS) if (f->index >= NUM_FORMATS)
return -EINVAL; return -EINVAL;
strscpy(f->description, formats[f->index].name, sizeof(f->description));
f->pixelformat = formats[f->index].pixelformat; f->pixelformat = formats[f->index].pixelformat;
return 0; return 0;
......
...@@ -1207,10 +1207,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -1207,10 +1207,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
dprintk(1, "%s called\n", __func__); dprintk(1, "%s called\n", __func__);
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
strscpy(f->description, "Packed YUV2", sizeof(f->description));
f->flags = 0;
f->pixelformat = V4L2_PIX_FMT_UYVY; f->pixelformat = V4L2_PIX_FMT_UYVY;
return 0; return 0;
......
...@@ -292,28 +292,13 @@ static int cpia2_s_input(struct file *file, void *fh, unsigned int i) ...@@ -292,28 +292,13 @@ static int cpia2_s_input(struct file *file, void *fh, unsigned int i)
static int cpia2_enum_fmt_vid_cap(struct file *file, void *fh, static int cpia2_enum_fmt_vid_cap(struct file *file, void *fh,
struct v4l2_fmtdesc *f) struct v4l2_fmtdesc *f)
{ {
int index = f->index; if (f->index > 1)
return -EINVAL;
if (index < 0 || index > 1)
return -EINVAL;
memset(f, 0, sizeof(*f)); if (f->index == 0)
f->index = index;
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
f->flags = V4L2_FMT_FLAG_COMPRESSED;
switch(index) {
case 0:
strscpy(f->description, "MJPEG", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_MJPEG; f->pixelformat = V4L2_PIX_FMT_MJPEG;
break; else
case 1:
strscpy(f->description, "JPEG", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_JPEG; f->pixelformat = V4L2_PIX_FMT_JPEG;
break;
default:
return -EINVAL;
}
return 0; return 0;
} }
......
...@@ -1592,7 +1592,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -1592,7 +1592,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (f->index != 0) if (f->index != 0)
return -EINVAL; return -EINVAL;
strscpy(f->description, "MPEG", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_MPEG; f->pixelformat = V4L2_PIX_FMT_MPEG;
return 0; return 0;
......
...@@ -80,7 +80,6 @@ MODULE_PARM_DESC(video_debug, "enable debug messages [video]"); ...@@ -80,7 +80,6 @@ MODULE_PARM_DESC(video_debug, "enable debug messages [video]");
/* supported video standards */ /* supported video standards */
static struct cx231xx_fmt format[] = { static struct cx231xx_fmt format[] = {
{ {
.name = "16bpp YUY2, 4:2:2, packed",
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16, .depth = 16,
.reg = 0, .reg = 0,
...@@ -1578,7 +1577,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -1578,7 +1577,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (unlikely(f->index >= ARRAY_SIZE(format))) if (unlikely(f->index >= ARRAY_SIZE(format)))
return -EINVAL; return -EINVAL;
strscpy(f->description, format[f->index].name, sizeof(f->description));
f->pixelformat = format[f->index].fourcc; f->pixelformat = format[f->index].fourcc;
return 0; return 0;
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
#define CX23417_RESET 9 #define CX23417_RESET 9
struct cx23417_fmt { struct cx23417_fmt {
char *name;
u32 fourcc; /* v4l2 format id */ u32 fourcc; /* v4l2 format id */
int depth; int depth;
int flags; int flags;
......
...@@ -102,37 +102,30 @@ MODULE_PARM_DESC(video_debug, "enable debug messages [video]"); ...@@ -102,37 +102,30 @@ MODULE_PARM_DESC(video_debug, "enable debug messages [video]");
/* supported video standards */ /* supported video standards */
static struct em28xx_fmt format[] = { static struct em28xx_fmt format[] = {
{ {
.name = "16 bpp YUY2, 4:2:2, packed",
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16, .depth = 16,
.reg = EM28XX_OUTFMT_YUV422_Y0UY1V, .reg = EM28XX_OUTFMT_YUV422_Y0UY1V,
}, { }, {
.name = "16 bpp RGB 565, LE",
.fourcc = V4L2_PIX_FMT_RGB565, .fourcc = V4L2_PIX_FMT_RGB565,
.depth = 16, .depth = 16,
.reg = EM28XX_OUTFMT_RGB_16_656, .reg = EM28XX_OUTFMT_RGB_16_656,
}, { }, {
.name = "8 bpp Bayer RGRG..GBGB",
.fourcc = V4L2_PIX_FMT_SRGGB8, .fourcc = V4L2_PIX_FMT_SRGGB8,
.depth = 8, .depth = 8,
.reg = EM28XX_OUTFMT_RGB_8_RGRG, .reg = EM28XX_OUTFMT_RGB_8_RGRG,
}, { }, {
.name = "8 bpp Bayer BGBG..GRGR",
.fourcc = V4L2_PIX_FMT_SBGGR8, .fourcc = V4L2_PIX_FMT_SBGGR8,
.depth = 8, .depth = 8,
.reg = EM28XX_OUTFMT_RGB_8_BGBG, .reg = EM28XX_OUTFMT_RGB_8_BGBG,
}, { }, {
.name = "8 bpp Bayer GRGR..BGBG",
.fourcc = V4L2_PIX_FMT_SGRBG8, .fourcc = V4L2_PIX_FMT_SGRBG8,
.depth = 8, .depth = 8,
.reg = EM28XX_OUTFMT_RGB_8_GRGR, .reg = EM28XX_OUTFMT_RGB_8_GRGR,
}, { }, {
.name = "8 bpp Bayer GBGB..RGRG",
.fourcc = V4L2_PIX_FMT_SGBRG8, .fourcc = V4L2_PIX_FMT_SGBRG8,
.depth = 8, .depth = 8,
.reg = EM28XX_OUTFMT_RGB_8_GBGB, .reg = EM28XX_OUTFMT_RGB_8_GBGB,
}, { }, {
.name = "12 bpp YUV411",
.fourcc = V4L2_PIX_FMT_YUV411P, .fourcc = V4L2_PIX_FMT_YUV411P,
.depth = 12, .depth = 12,
.reg = EM28XX_OUTFMT_YUV411, .reg = EM28XX_OUTFMT_YUV411,
...@@ -2011,7 +2004,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -2011,7 +2004,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (unlikely(f->index >= ARRAY_SIZE(format))) if (unlikely(f->index >= ARRAY_SIZE(format)))
return -EINVAL; return -EINVAL;
strscpy(f->description, format[f->index].name, sizeof(f->description));
f->pixelformat = format[f->index].fourcc; f->pixelformat = format[f->index].fourcc;
return 0; return 0;
......
...@@ -251,13 +251,11 @@ struct em28xx_usb_ctl { ...@@ -251,13 +251,11 @@ struct em28xx_usb_ctl {
/** /**
* struct em28xx_fmt - Struct to enumberate video formats * struct em28xx_fmt - Struct to enumberate video formats
* *
* @name: Name for the video standard
* @fourcc: v4l2 format id * @fourcc: v4l2 format id
* @depth: mean number of bits to represent a pixel * @depth: mean number of bits to represent a pixel
* @reg: em28xx register value to set it * @reg: em28xx register value to set it
*/ */
struct em28xx_fmt { struct em28xx_fmt {
char *name;
u32 fourcc; u32 fourcc;
int depth; int depth;
int reg; int reg;
......
...@@ -285,33 +285,22 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -285,33 +285,22 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *fmt) struct v4l2_fmtdesc *fmt)
{ {
char *desc = NULL;
switch (fmt->index) { switch (fmt->index) {
case 0: case 0:
fmt->pixelformat = V4L2_PIX_FMT_MJPEG; fmt->pixelformat = V4L2_PIX_FMT_MJPEG;
desc = "Motion JPEG";
break; break;
case 1: case 1:
fmt->pixelformat = V4L2_PIX_FMT_MPEG1; fmt->pixelformat = V4L2_PIX_FMT_MPEG1;
desc = "MPEG-1 ES";
break; break;
case 2: case 2:
fmt->pixelformat = V4L2_PIX_FMT_MPEG2; fmt->pixelformat = V4L2_PIX_FMT_MPEG2;
desc = "MPEG-2 ES";
break; break;
case 3: case 3:
fmt->pixelformat = V4L2_PIX_FMT_MPEG4; fmt->pixelformat = V4L2_PIX_FMT_MPEG4;
desc = "MPEG-4 ES";
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt->flags = V4L2_FMT_FLAG_COMPRESSED;
strscpy(fmt->description, desc, sizeof(fmt->description));
return 0; return 0;
} }
......
...@@ -1024,15 +1024,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -1024,15 +1024,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
return -EINVAL; /* no more format */ return -EINVAL; /* no more format */
fmtdesc->pixelformat = fmt_tb[index]; fmtdesc->pixelformat = fmt_tb[index];
if (gspca_dev->cam.cam_mode[i].sizeimage <
gspca_dev->cam.cam_mode[i].width *
gspca_dev->cam.cam_mode[i].height)
fmtdesc->flags = V4L2_FMT_FLAG_COMPRESSED;
fmtdesc->description[0] = fmtdesc->pixelformat & 0xff;
fmtdesc->description[1] = (fmtdesc->pixelformat >> 8) & 0xff;
fmtdesc->description[2] = (fmtdesc->pixelformat >> 16) & 0xff;
fmtdesc->description[3] = fmtdesc->pixelformat >> 24;
fmtdesc->description[4] = '\0';
return 0; return 0;
} }
......
...@@ -987,9 +987,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *private_data, ...@@ -987,9 +987,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *private_data,
if (f->index != 0) if (f->index != 0)
return -EINVAL; return -EINVAL;
f->flags = V4L2_FMT_FLAG_COMPRESSED;
strscpy(f->description, "MPEG2-TS with AVC/AAC streams",
sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_MPEG; f->pixelformat = V4L2_PIX_FMT_MPEG;
return 0; return 0;
......
...@@ -66,7 +66,6 @@ static const struct v4l2_frequency_band bands[] = { ...@@ -66,7 +66,6 @@ static const struct v4l2_frequency_band bands[] = {
/* stream formats */ /* stream formats */
struct msi2500_format { struct msi2500_format {
char *name;
u32 pixelformat; u32 pixelformat;
u32 buffersize; u32 buffersize;
}; };
...@@ -74,27 +73,21 @@ struct msi2500_format { ...@@ -74,27 +73,21 @@ struct msi2500_format {
/* format descriptions for capture and preview */ /* format descriptions for capture and preview */
static struct msi2500_format formats[] = { static struct msi2500_format formats[] = {
{ {
.name = "Complex S8",
.pixelformat = V4L2_SDR_FMT_CS8, .pixelformat = V4L2_SDR_FMT_CS8,
.buffersize = 3 * 1008, .buffersize = 3 * 1008,
#if 0 #if 0
}, { }, {
.name = "10+2-bit signed",
.pixelformat = MSI2500_PIX_FMT_SDR_MSI2500_384, .pixelformat = MSI2500_PIX_FMT_SDR_MSI2500_384,
}, { }, {
.name = "12-bit signed",
.pixelformat = MSI2500_PIX_FMT_SDR_S12, .pixelformat = MSI2500_PIX_FMT_SDR_S12,
#endif #endif
}, { }, {
.name = "Complex S14LE",
.pixelformat = V4L2_SDR_FMT_CS14LE, .pixelformat = V4L2_SDR_FMT_CS14LE,
.buffersize = 3 * 1008, .buffersize = 3 * 1008,
}, { }, {
.name = "Complex U8 (emulated)",
.pixelformat = V4L2_SDR_FMT_CU8, .pixelformat = V4L2_SDR_FMT_CU8,
.buffersize = 3 * 1008, .buffersize = 3 * 1008,
}, { }, {
.name = "Complex U16LE (emulated)",
.pixelformat = V4L2_SDR_FMT_CU16LE, .pixelformat = V4L2_SDR_FMT_CU16LE,
.buffersize = 3 * 1008, .buffersize = 3 * 1008,
}, },
...@@ -904,7 +897,6 @@ static int msi2500_enum_fmt_sdr_cap(struct file *file, void *priv, ...@@ -904,7 +897,6 @@ static int msi2500_enum_fmt_sdr_cap(struct file *file, void *priv,
if (f->index >= dev->num_formats) if (f->index >= dev->num_formats)
return -EINVAL; return -EINVAL;
strscpy(f->description, formats[f->index].name, sizeof(f->description));
f->pixelformat = formats[f->index].pixelformat; f->pixelformat = formats[f->index].pixelformat;
return 0; return 0;
......
...@@ -873,14 +873,9 @@ static int pwc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc ...@@ -873,14 +873,9 @@ static int pwc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc
case 0: case 0:
/* RAW format */ /* RAW format */
f->pixelformat = pdev->type <= 646 ? V4L2_PIX_FMT_PWC1 : V4L2_PIX_FMT_PWC2; f->pixelformat = pdev->type <= 646 ? V4L2_PIX_FMT_PWC1 : V4L2_PIX_FMT_PWC2;
f->flags = V4L2_FMT_FLAG_COMPRESSED;
strscpy(f->description, "Raw Philips Webcam",
sizeof(f->description));
break; break;
case 1: case 1:
f->pixelformat = V4L2_PIX_FMT_YUV420; f->pixelformat = V4L2_PIX_FMT_YUV420;
strscpy(f->description, "4:2:0, planar, Y-Cb-Cr",
sizeof(f->description));
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
...@@ -273,7 +273,6 @@ static inline struct s2255_dev *to_s2255_dev(struct v4l2_device *v4l2_dev) ...@@ -273,7 +273,6 @@ static inline struct s2255_dev *to_s2255_dev(struct v4l2_device *v4l2_dev)
} }
struct s2255_fmt { struct s2255_fmt {
char *name;
u32 fourcc; u32 fourcc;
int depth; int depth;
}; };
...@@ -385,29 +384,23 @@ MODULE_DEVICE_TABLE(usb, s2255_table); ...@@ -385,29 +384,23 @@ MODULE_DEVICE_TABLE(usb, s2255_table);
/* JPEG formats must be defined last to support jpeg_enable parameter */ /* JPEG formats must be defined last to support jpeg_enable parameter */
static const struct s2255_fmt formats[] = { static const struct s2255_fmt formats[] = {
{ {
.name = "4:2:2, packed, YUYV",
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16 .depth = 16
}, { }, {
.name = "4:2:2, packed, UYVY",
.fourcc = V4L2_PIX_FMT_UYVY, .fourcc = V4L2_PIX_FMT_UYVY,
.depth = 16 .depth = 16
}, { }, {
.name = "4:2:2, planar, YUV422P",
.fourcc = V4L2_PIX_FMT_YUV422P, .fourcc = V4L2_PIX_FMT_YUV422P,
.depth = 16 .depth = 16
}, { }, {
.name = "8bpp GREY",
.fourcc = V4L2_PIX_FMT_GREY, .fourcc = V4L2_PIX_FMT_GREY,
.depth = 8 .depth = 8
}, { }, {
.name = "JPG",
.fourcc = V4L2_PIX_FMT_JPEG, .fourcc = V4L2_PIX_FMT_JPEG,
.depth = 24 .depth = 24
}, { }, {
.name = "MJPG",
.fourcc = V4L2_PIX_FMT_MJPEG, .fourcc = V4L2_PIX_FMT_MJPEG,
.depth = 24 .depth = 24
} }
...@@ -737,7 +730,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -737,7 +730,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) || if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) ||
(formats[index].fourcc == V4L2_PIX_FMT_MJPEG))) (formats[index].fourcc == V4L2_PIX_FMT_MJPEG)))
return -EINVAL; return -EINVAL;
strscpy(f->description, formats[index].name, sizeof(f->description));
f->pixelformat = formats[index].fourcc; f->pixelformat = formats[index].fourcc;
return 0; return 0;
} }
......
...@@ -46,7 +46,6 @@ struct stk1160_decimate_ctrl { ...@@ -46,7 +46,6 @@ struct stk1160_decimate_ctrl {
/* supported video standards */ /* supported video standards */
static struct stk1160_fmt format[] = { static struct stk1160_fmt format[] = {
{ {
.name = "16 bpp YUY2, 4:2:2, packed",
.fourcc = V4L2_PIX_FMT_UYVY, .fourcc = V4L2_PIX_FMT_UYVY,
.depth = 16, .depth = 16,
} }
...@@ -346,7 +345,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -346,7 +345,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (f->index != 0) if (f->index != 0)
return -EINVAL; return -EINVAL;
strscpy(f->description, format[f->index].name, sizeof(f->description));
f->pixelformat = format[f->index].fourcc; f->pixelformat = format[f->index].fourcc;
return 0; return 0;
} }
......
...@@ -102,7 +102,6 @@ struct stk1160_isoc_ctl { ...@@ -102,7 +102,6 @@ struct stk1160_isoc_ctl {
}; };
struct stk1160_fmt { struct stk1160_fmt {
char *name;
u32 fourcc; /* v4l2 format id */ u32 fourcc; /* v4l2 format id */
int depth; int depth;
}; };
......
...@@ -857,23 +857,18 @@ static int stk_vidioc_enum_fmt_vid_cap(struct file *filp, ...@@ -857,23 +857,18 @@ static int stk_vidioc_enum_fmt_vid_cap(struct file *filp,
switch (fmtd->index) { switch (fmtd->index) {
case 0: case 0:
fmtd->pixelformat = V4L2_PIX_FMT_RGB565; fmtd->pixelformat = V4L2_PIX_FMT_RGB565;
strscpy(fmtd->description, "r5g6b5", sizeof(fmtd->description));
break; break;
case 1: case 1:
fmtd->pixelformat = V4L2_PIX_FMT_RGB565X; fmtd->pixelformat = V4L2_PIX_FMT_RGB565X;
strscpy(fmtd->description, "r5g6b5BE", sizeof(fmtd->description));
break; break;
case 2: case 2:
fmtd->pixelformat = V4L2_PIX_FMT_UYVY; fmtd->pixelformat = V4L2_PIX_FMT_UYVY;
strscpy(fmtd->description, "yuv4:2:2", sizeof(fmtd->description));
break; break;
case 3: case 3:
fmtd->pixelformat = V4L2_PIX_FMT_SBGGR8; fmtd->pixelformat = V4L2_PIX_FMT_SBGGR8;
strscpy(fmtd->description, "Raw bayer", sizeof(fmtd->description));
break; break;
case 4: case 4:
fmtd->pixelformat = V4L2_PIX_FMT_YUYV; fmtd->pixelformat = V4L2_PIX_FMT_YUYV;
strscpy(fmtd->description, "yuv4:2:2", sizeof(fmtd->description));
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
...@@ -52,15 +52,12 @@ EXPORT_SYMBOL_GPL(tm6000_debug); ...@@ -52,15 +52,12 @@ EXPORT_SYMBOL_GPL(tm6000_debug);
static struct tm6000_fmt format[] = { static struct tm6000_fmt format[] = {
{ {
.name = "4:2:2, packed, YVY2",
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16, .depth = 16,
}, { }, {
.name = "4:2:2, packed, UYVY",
.fourcc = V4L2_PIX_FMT_UYVY, .fourcc = V4L2_PIX_FMT_UYVY,
.depth = 16, .depth = 16,
}, { }, {
.name = "A/V + VBI mux packet",
.fourcc = V4L2_PIX_FMT_TM6000, .fourcc = V4L2_PIX_FMT_TM6000,
.depth = 16, .depth = 16,
} }
...@@ -875,7 +872,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -875,7 +872,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (f->index >= ARRAY_SIZE(format)) if (f->index >= ARRAY_SIZE(format))
return -EINVAL; return -EINVAL;
strscpy(f->description, format[f->index].name, sizeof(f->description));
f->pixelformat = format[f->index].fourcc; f->pixelformat = format[f->index].fourcc;
return 0; return 0;
} }
......
...@@ -64,7 +64,6 @@ struct tm6000_input { ...@@ -64,7 +64,6 @@ struct tm6000_input {
*/ */
struct tm6000_fmt { struct tm6000_fmt {
char *name;
u32 fourcc; /* v4l2 format id */ u32 fourcc; /* v4l2 format id */
int depth; int depth;
}; };
......
...@@ -633,8 +633,6 @@ static int usbtv_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -633,8 +633,6 @@ static int usbtv_enum_fmt_vid_cap(struct file *file, void *priv,
if (f->index > 0) if (f->index > 0)
return -EINVAL; return -EINVAL;
strscpy(f->description, "16 bpp YUY2, 4:2:2, packed",
sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_YUYV; f->pixelformat = V4L2_PIX_FMT_YUYV;
return 0; return 0;
} }
......
...@@ -87,14 +87,14 @@ ...@@ -87,14 +87,14 @@
static int usbvision_nr; static int usbvision_nr;
static struct usbvision_v4l2_format_st usbvision_v4l2_format[] = { static struct usbvision_v4l2_format_st usbvision_v4l2_format[] = {
{ 1, 1, 8, V4L2_PIX_FMT_GREY , "GREY" }, { 1, 1, 8, V4L2_PIX_FMT_GREY },
{ 1, 2, 16, V4L2_PIX_FMT_RGB565 , "RGB565" }, { 1, 2, 16, V4L2_PIX_FMT_RGB565 },
{ 1, 3, 24, V4L2_PIX_FMT_RGB24 , "RGB24" }, { 1, 3, 24, V4L2_PIX_FMT_RGB24 },
{ 1, 4, 32, V4L2_PIX_FMT_RGB32 , "RGB32" }, { 1, 4, 32, V4L2_PIX_FMT_RGB32 },
{ 1, 2, 16, V4L2_PIX_FMT_RGB555 , "RGB555" }, { 1, 2, 16, V4L2_PIX_FMT_RGB555 },
{ 1, 2, 16, V4L2_PIX_FMT_YUYV , "YUV422" }, { 1, 2, 16, V4L2_PIX_FMT_YUYV },
{ 1, 2, 12, V4L2_PIX_FMT_YVU420 , "YUV420P" }, /* 1.5 ! */ { 1, 2, 12, V4L2_PIX_FMT_YVU420 }, /* 1.5 ! */
{ 1, 2, 16, V4L2_PIX_FMT_YUV422P , "YUV422P" } { 1, 2, 16, V4L2_PIX_FMT_YUV422P }
}; };
/* Function prototypes */ /* Function prototypes */
...@@ -796,8 +796,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -796,8 +796,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
{ {
if (vfd->index >= USBVISION_SUPPORTED_PALETTES - 1) if (vfd->index >= USBVISION_SUPPORTED_PALETTES - 1)
return -EINVAL; return -EINVAL;
strscpy(vfd->description, usbvision_v4l2_format[vfd->index].desc,
sizeof(vfd->description));
vfd->pixelformat = usbvision_v4l2_format[vfd->index].format; vfd->pixelformat = usbvision_v4l2_format[vfd->index].format;
return 0; return 0;
} }
......
...@@ -264,7 +264,6 @@ struct usbvision_v4l2_format_st { ...@@ -264,7 +264,6 @@ struct usbvision_v4l2_format_st {
int bytes_per_pixel; int bytes_per_pixel;
int depth; int depth;
int format; int format;
char *desc;
}; };
#define USBVISION_SUPPORTED_PALETTES ARRAY_SIZE(usbvision_v4l2_format) #define USBVISION_SUPPORTED_PALETTES ARRAY_SIZE(usbvision_v4l2_format)
......
...@@ -141,7 +141,6 @@ struct zr364xx_pipeinfo { ...@@ -141,7 +141,6 @@ struct zr364xx_pipeinfo {
}; };
struct zr364xx_fmt { struct zr364xx_fmt {
char *name;
u32 fourcc; u32 fourcc;
int depth; int depth;
}; };
...@@ -149,7 +148,6 @@ struct zr364xx_fmt { ...@@ -149,7 +148,6 @@ struct zr364xx_fmt {
/* image formats. */ /* image formats. */
static const struct zr364xx_fmt formats[] = { static const struct zr364xx_fmt formats[] = {
{ {
.name = "JPG",
.fourcc = V4L2_PIX_FMT_JPEG, .fourcc = V4L2_PIX_FMT_JPEG,
.depth = 24 .depth = 24
} }
...@@ -376,8 +374,7 @@ static int buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, ...@@ -376,8 +374,7 @@ static int buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
vb); vb);
int rc; int rc;
DBG("%s, field=%d, fmt name = %s\n", __func__, field, DBG("%s, field=%d\n", __func__, field);
cam->fmt ? cam->fmt->name : "");
if (!cam->fmt) if (!cam->fmt)
return -EINVAL; return -EINVAL;
...@@ -751,8 +748,6 @@ static int zr364xx_vidioc_enum_fmt_vid_cap(struct file *file, ...@@ -751,8 +748,6 @@ static int zr364xx_vidioc_enum_fmt_vid_cap(struct file *file,
{ {
if (f->index > 0) if (f->index > 0)
return -EINVAL; return -EINVAL;
f->flags = V4L2_FMT_FLAG_COMPRESSED;
strscpy(f->description, formats[0].name, sizeof(f->description));
f->pixelformat = formats[0].fourcc; f->pixelformat = formats[0].fourcc;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment