aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tvp7002.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-05-09 06:22:37 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:04:38 -0400
commit515d93fb238e201901610bceddedc4027f565d5e (patch)
treefd82dcf99a74890751ab1c39860e0199a78b7df7 /drivers/media/video/tvp7002.c
parent8f56aaa3e65d675b756fac67b8abc8f2acaaf2f2 (diff)
V4L/DVB: tvp7002: remove obsolete enum/try/s/g_fmt
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/tvp7002.c')
-rw-r--r--drivers/media/video/tvp7002.c126
1 files changed, 0 insertions, 126 deletions
diff --git a/drivers/media/video/tvp7002.c b/drivers/media/video/tvp7002.c
index 45eb19fca078..e63b40f5a706 100644
--- a/drivers/media/video/tvp7002.c
+++ b/drivers/media/video/tvp7002.c
@@ -330,19 +330,6 @@ static const struct i2c_reg_value tvp7002_parms_720P50[] = {
330 { TVP7002_EOR, 0xff, TVP7002_RESERVED } 330 { TVP7002_EOR, 0xff, TVP7002_RESERVED }
331}; 331};
332 332
333/* Struct list for available formats */
334static const struct v4l2_fmtdesc tvp7002_fmt_list[] = {
335 {
336 .index = 0,
337 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
338 .flags = 0,
339 .description = "8-bit UYVY 4:2:2 Format",
340 .pixelformat = V4L2_PIX_FMT_UYVY,
341 },
342};
343
344#define NUM_FORMATS ARRAY_SIZE(tvp7002_fmt_list)
345
346/* Preset definition for handling device operation */ 333/* Preset definition for handling device operation */
347struct tvp7002_preset_definition { 334struct tvp7002_preset_definition {
348 u32 preset; 335 u32 preset;
@@ -439,7 +426,6 @@ struct tvp7002 {
439 int ver; 426 int ver;
440 int streaming; 427 int streaming;
441 428
442 struct v4l2_pix_format pix;
443 const struct tvp7002_preset_definition *current_preset; 429 const struct tvp7002_preset_definition *current_preset;
444 u8 gain; 430 u8 gain;
445}; 431};
@@ -726,85 +712,6 @@ static int tvp7002_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *f
726} 712}
727 713
728/* 714/*
729 * tvp7002_try_fmt_cap() - V4L2 decoder interface handler for try_fmt
730 * @sd: pointer to standard V4L2 sub-device structure
731 * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure
732 *
733 * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This
734 * ioctl is used to negotiate the image capture size and pixel format
735 * without actually making it take effect.
736 */
737static int tvp7002_try_fmt_cap(struct v4l2_subdev *sd, struct v4l2_format *f)
738{
739 struct tvp7002 *device = to_tvp7002(sd);
740 struct v4l2_dv_enum_preset e_preset;
741 struct v4l2_pix_format *pix;
742 int error = 0;
743
744 pix = &f->fmt.pix;
745
746 /* Calculate height and width based on current standard */
747 error = v4l_fill_dv_preset_info(device->current_preset->preset, &e_preset);
748 if (error)
749 return -EINVAL;
750
751 pix->width = e_preset.width;
752 pix->height = e_preset.height;
753 pix->pixelformat = V4L2_PIX_FMT_UYVY;
754 pix->field = device->current_preset->scanmode;
755 pix->bytesperline = pix->width * 2;
756 pix->sizeimage = pix->bytesperline * pix->height;
757 pix->colorspace = device->current_preset->color_space;
758 pix->priv = 0;
759
760 v4l2_dbg(1, debug, sd, "Try FMT: pixelformat - %s, bytesperline - %d"
761 "Width - %d, Height - %d", "8-bit UYVY 4:2:2 Format",
762 pix->bytesperline, pix->width, pix->height);
763 return error;
764}
765
766/*
767 * tvp7002_s_fmt() - V4L2 decoder interface handler for s_fmt
768 * @sd: pointer to standard V4L2 sub-device structure
769 * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure
770 *
771 * If the requested format is supported, configures the HW to use that
772 * format, returns error code if format not supported or HW can't be
773 * correctly configured.
774 */
775static int tvp7002_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
776{
777 struct tvp7002 *decoder = to_tvp7002(sd);
778 int rval;
779
780 rval = tvp7002_try_fmt_cap(sd, f);
781 if (!rval)
782 decoder->pix = f->fmt.pix;
783 return rval;
784}
785
786/*
787 * tvp7002_g_fmt() - V4L2 decoder interface handler for tvp7002_g_fmt
788 * @sd: pointer to standard V4L2 sub-device structure
789 * @f: pointer to standard V4L2 v4l2_format structure
790 *
791 * Returns the decoder's current pixel format in the v4l2_format
792 * parameter.
793 */
794static int tvp7002_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
795{
796 struct tvp7002 *decoder = to_tvp7002(sd);
797
798 f->fmt.pix = decoder->pix;
799
800 v4l2_dbg(1, debug, sd, "Current FMT: bytesperline - %d"
801 "Width - %d, Height - %d",
802 decoder->pix.bytesperline,
803 decoder->pix.width, decoder->pix.height);
804 return 0;
805}
806
807/*
808 * tvp7002_query_dv_preset() - query DV preset 715 * tvp7002_query_dv_preset() - query DV preset
809 * @sd: pointer to standard V4L2 sub-device structure 716 * @sd: pointer to standard V4L2 sub-device structure
810 * @qpreset: standard V4L2 v4l2_dv_preset structure 717 * @qpreset: standard V4L2 v4l2_dv_preset structure
@@ -925,25 +832,6 @@ static int tvp7002_s_register(struct v4l2_subdev *sd,
925#endif 832#endif
926 833
927/* 834/*
928 * tvp7002_enum_fmt() - Enum supported formats
929 * @sd: pointer to standard V4L2 sub-device structure
930 * @fmtdesc: pointer to format struct
931 *
932 * Enumerate supported formats.
933 */
934
935static int tvp7002_enum_fmt(struct v4l2_subdev *sd,
936 struct v4l2_fmtdesc *fmtdesc)
937{
938 /* Check requested format index is within range */
939 if (fmtdesc->index < 0 || fmtdesc->index >= NUM_FORMATS)
940 return -EINVAL;
941 *fmtdesc = tvp7002_fmt_list[fmtdesc->index];
942
943 return 0;
944}
945
946/*
947 * tvp7002_enum_mbus_fmt() - Enum supported mediabus formats 835 * tvp7002_enum_mbus_fmt() - Enum supported mediabus formats
948 * @sd: pointer to standard V4L2 sub-device structure 836 * @sd: pointer to standard V4L2 sub-device structure
949 * @index: format index 837 * @index: format index
@@ -1077,9 +965,6 @@ static const struct v4l2_subdev_video_ops tvp7002_video_ops = {
1077 .s_dv_preset = tvp7002_s_dv_preset, 965 .s_dv_preset = tvp7002_s_dv_preset,
1078 .query_dv_preset = tvp7002_query_dv_preset, 966 .query_dv_preset = tvp7002_query_dv_preset,
1079 .s_stream = tvp7002_s_stream, 967 .s_stream = tvp7002_s_stream,
1080 .g_fmt = tvp7002_g_fmt,
1081 .s_fmt = tvp7002_s_fmt,
1082 .enum_fmt = tvp7002_enum_fmt,
1083 .g_mbus_fmt = tvp7002_mbus_fmt, 968 .g_mbus_fmt = tvp7002_mbus_fmt,
1084 .try_mbus_fmt = tvp7002_mbus_fmt, 969 .try_mbus_fmt = tvp7002_mbus_fmt,
1085 .s_mbus_fmt = tvp7002_mbus_fmt, 970 .s_mbus_fmt = tvp7002_mbus_fmt,
@@ -1094,17 +979,6 @@ static const struct v4l2_subdev_ops tvp7002_ops = {
1094 979
1095static struct tvp7002 tvp7002_dev = { 980static struct tvp7002 tvp7002_dev = {
1096 .streaming = 0, 981 .streaming = 0,
1097
1098 .pix = {
1099 .width = 1280,
1100 .height = 720,
1101 .pixelformat = V4L2_PIX_FMT_UYVY,
1102 .field = V4L2_FIELD_NONE,
1103 .bytesperline = 1280 * 2,
1104 .sizeimage = 1280 * 2 * 720,
1105 .colorspace = V4L2_COLORSPACE_REC709,
1106 },
1107
1108 .current_preset = tvp7002_presets, 982 .current_preset = tvp7002_presets,
1109 .gain = 0, 983 .gain = 0,
1110}; 984};