aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-05-08 17:55:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:04:41 -0400
commitaabb541118af0a2fee3a878f61292384bf80fb2f (patch)
tree7814ec62dbfd53915b1d413a8cf4160867f05ff9
parent1e426228839f93c1a61c215b57557f1eb4f79a2d (diff)
V4L/DVB: ov7670: remove obsolete enum/try/s_fmt ops
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/ov7670.c74
1 files changed, 0 insertions, 74 deletions
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index 715feb12f47c..c141d2e604e3 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -576,49 +576,34 @@ static int ov7670_detect(struct v4l2_subdev *sd)
576 * The magic matrix numbers come from OmniVision. 576 * The magic matrix numbers come from OmniVision.
577 */ 577 */
578static struct ov7670_format_struct { 578static struct ov7670_format_struct {
579 __u8 *desc;
580 __u32 pixelformat;
581 enum v4l2_mbus_pixelcode mbus_code; 579 enum v4l2_mbus_pixelcode mbus_code;
582 enum v4l2_colorspace colorspace; 580 enum v4l2_colorspace colorspace;
583 struct regval_list *regs; 581 struct regval_list *regs;
584 int cmatrix[CMATRIX_LEN]; 582 int cmatrix[CMATRIX_LEN];
585 int bpp; /* Bytes per pixel */
586} ov7670_formats[] = { 583} ov7670_formats[] = {
587 { 584 {
588 .desc = "YUYV 4:2:2",
589 .pixelformat = V4L2_PIX_FMT_YUYV,
590 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 585 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8,
591 .colorspace = V4L2_COLORSPACE_JPEG, 586 .colorspace = V4L2_COLORSPACE_JPEG,
592 .regs = ov7670_fmt_yuv422, 587 .regs = ov7670_fmt_yuv422,
593 .cmatrix = { 128, -128, 0, -34, -94, 128 }, 588 .cmatrix = { 128, -128, 0, -34, -94, 128 },
594 .bpp = 2,
595 }, 589 },
596 { 590 {
597 .desc = "RGB 444",
598 .pixelformat = V4L2_PIX_FMT_RGB444,
599 .mbus_code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, 591 .mbus_code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
600 .colorspace = V4L2_COLORSPACE_SRGB, 592 .colorspace = V4L2_COLORSPACE_SRGB,
601 .regs = ov7670_fmt_rgb444, 593 .regs = ov7670_fmt_rgb444,
602 .cmatrix = { 179, -179, 0, -61, -176, 228 }, 594 .cmatrix = { 179, -179, 0, -61, -176, 228 },
603 .bpp = 2,
604 }, 595 },
605 { 596 {
606 .desc = "RGB 565",
607 .pixelformat = V4L2_PIX_FMT_RGB565,
608 .mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE, 597 .mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE,
609 .colorspace = V4L2_COLORSPACE_SRGB, 598 .colorspace = V4L2_COLORSPACE_SRGB,
610 .regs = ov7670_fmt_rgb565, 599 .regs = ov7670_fmt_rgb565,
611 .cmatrix = { 179, -179, 0, -61, -176, 228 }, 600 .cmatrix = { 179, -179, 0, -61, -176, 228 },
612 .bpp = 2,
613 }, 601 },
614 { 602 {
615 .desc = "Raw RGB Bayer",
616 .pixelformat = V4L2_PIX_FMT_SBGGR8,
617 .mbus_code = V4L2_MBUS_FMT_SBGGR8_1X8, 603 .mbus_code = V4L2_MBUS_FMT_SBGGR8_1X8,
618 .colorspace = V4L2_COLORSPACE_SRGB, 604 .colorspace = V4L2_COLORSPACE_SRGB,
619 .regs = ov7670_fmt_raw, 605 .regs = ov7670_fmt_raw,
620 .cmatrix = { 0, 0, 0, 0, 0, 0 }, 606 .cmatrix = { 0, 0, 0, 0, 0, 0 },
621 .bpp = 1
622 }, 607 },
623}; 608};
624#define N_OV7670_FMTS ARRAY_SIZE(ov7670_formats) 609#define N_OV7670_FMTS ARRAY_SIZE(ov7670_formats)
@@ -745,20 +730,6 @@ static int ov7670_set_hw(struct v4l2_subdev *sd, int hstart, int hstop,
745} 730}
746 731
747 732
748static int ov7670_enum_fmt(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmt)
749{
750 struct ov7670_format_struct *ofmt;
751
752 if (fmt->index >= N_OV7670_FMTS)
753 return -EINVAL;
754
755 ofmt = ov7670_formats + fmt->index;
756 fmt->flags = 0;
757 strcpy(fmt->description, ofmt->desc);
758 fmt->pixelformat = ofmt->pixelformat;
759 return 0;
760}
761
762static int ov7670_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned index, 733static int ov7670_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned index,
763 enum v4l2_mbus_pixelcode *code) 734 enum v4l2_mbus_pixelcode *code)
764{ 735{
@@ -818,28 +789,6 @@ static int ov7670_try_mbus_fmt(struct v4l2_subdev *sd,
818 return ov7670_try_fmt_internal(sd, fmt, NULL, NULL); 789 return ov7670_try_fmt_internal(sd, fmt, NULL, NULL);
819} 790}
820 791
821static int ov7670_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
822{
823 struct v4l2_mbus_framefmt mbus_fmt;
824 struct v4l2_pix_format *pix = &fmt->fmt.pix;
825 unsigned index;
826 int ret;
827
828 for (index = 0; index < N_OV7670_FMTS; index++)
829 if (ov7670_formats[index].pixelformat == pix->pixelformat)
830 break;
831 if (index >= N_OV7670_FMTS) {
832 index = 0;
833 pix->pixelformat = ov7670_formats[index].pixelformat;
834 }
835 v4l2_fill_mbus_format(&mbus_fmt, pix, ov7670_formats[index].mbus_code);
836 ret = ov7670_try_fmt_internal(sd, &mbus_fmt, NULL, NULL);
837 v4l2_fill_pix_format(pix, &mbus_fmt);
838 pix->bytesperline = pix->width * ov7670_formats[index].bpp;
839 pix->sizeimage = pix->height * pix->bytesperline;
840 return ret;
841}
842
843/* 792/*
844 * Set a format. 793 * Set a format.
845 */ 794 */
@@ -891,26 +840,6 @@ static int ov7670_s_mbus_fmt(struct v4l2_subdev *sd,
891 return 0; 840 return 0;
892} 841}
893 842
894static int ov7670_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
895{
896 struct v4l2_mbus_framefmt mbus_fmt;
897 struct v4l2_pix_format *pix = &fmt->fmt.pix;
898 unsigned index;
899 int ret;
900
901 for (index = 0; index < N_OV7670_FMTS; index++)
902 if (ov7670_formats[index].pixelformat == pix->pixelformat)
903 break;
904 if (index >= N_OV7670_FMTS) {
905 index = 0;
906 pix->pixelformat = ov7670_formats[index].pixelformat;
907 }
908 v4l2_fill_mbus_format(&mbus_fmt, pix, ov7670_formats[index].mbus_code);
909 ret = ov7670_s_mbus_fmt(sd, &mbus_fmt);
910 v4l2_fill_pix_format(pix, &mbus_fmt);
911 return ret;
912}
913
914/* 843/*
915 * Implement G/S_PARM. There is a "high quality" mode we could try 844 * Implement G/S_PARM. There is a "high quality" mode we could try
916 * to do someday; for now, we just do the frame rate tweak. 845 * to do someday; for now, we just do the frame rate tweak.
@@ -1505,9 +1434,6 @@ static const struct v4l2_subdev_core_ops ov7670_core_ops = {
1505}; 1434};
1506 1435
1507static const struct v4l2_subdev_video_ops ov7670_video_ops = { 1436static const struct v4l2_subdev_video_ops ov7670_video_ops = {
1508 .enum_fmt = ov7670_enum_fmt,
1509 .try_fmt = ov7670_try_fmt,
1510 .s_fmt = ov7670_s_fmt,
1511 .enum_mbus_fmt = ov7670_enum_mbus_fmt, 1437 .enum_mbus_fmt = ov7670_enum_mbus_fmt,
1512 .try_mbus_fmt = ov7670_try_mbus_fmt, 1438 .try_mbus_fmt = ov7670_try_mbus_fmt,
1513 .s_mbus_fmt = ov7670_s_mbus_fmt, 1439 .s_mbus_fmt = ov7670_s_mbus_fmt,