aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2014-07-03 05:23:11 -0400
committerSandor Yu <R01008@freescale.com>2014-07-03 07:09:57 -0400
commitedcbe8af9bd3a0c0f7db321da94a1cc6ffbea293 (patch)
tree0010b3e604e1a48c862df6b389dec4f1a48d3245
parent81585f8a2b299eec47c20c92cc352accba0f3bdb (diff)
ENGR00321092 vadc: Add VIDIOC_ENUM_FRAMEINTERVALS support
Add VIDIOC_ENUM_FRAMEINTERVALS support for vadc driver. Signed-off-by: Sandor Yu <R01008@freescale.com> (cherry picked from commit 4863515c732d86589b7f2c9243c11c81669bd711)
-rw-r--r--drivers/media/platform/mxc/capture/mxc_vadc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/media/platform/mxc/capture/mxc_vadc.c b/drivers/media/platform/mxc/capture/mxc_vadc.c
index a5aa3f128268..1999be468a3a 100644
--- a/drivers/media/platform/mxc/capture/mxc_vadc.c
+++ b/drivers/media/platform/mxc/capture/mxc_vadc.c
@@ -84,6 +84,7 @@ typedef struct {
84 u16 raw_height; /* Raw height. */ 84 u16 raw_height; /* Raw height. */
85 u16 active_width; /* Active width. */ 85 u16 active_width; /* Active width. */
86 u16 active_height; /* Active height. */ 86 u16 active_height; /* Active height. */
87 u16 framerates;
87} video_fmt_t; 88} video_fmt_t;
88 89
89/* Description of video formats supported. 90/* Description of video formats supported.
@@ -100,6 +101,7 @@ static video_fmt_t video_fmts[] = {
100 .raw_height = 525, 101 .raw_height = 525,
101 .active_width = 720, 102 .active_width = 720,
102 .active_height = 480, 103 .active_height = 480,
104 .framerates = 30,
103 }, 105 },
104 /* (B, G, H, I, N) PAL */ 106 /* (B, G, H, I, N) PAL */
105 { 107 {
@@ -109,6 +111,7 @@ static video_fmt_t video_fmts[] = {
109 .raw_height = 625, 111 .raw_height = 625,
110 .active_width = 720, 112 .active_width = 720,
111 .active_height = 576, 113 .active_height = 576,
114 .framerates = 25,
112 }, 115 },
113}; 116};
114 117
@@ -688,6 +691,28 @@ static int ioctl_enum_framesizes(struct v4l2_int_device *s,
688} 691}
689 692
690/*! 693/*!
694 * ioctl_enum_frameintervals - V4L2 sensor interface handler for
695 * VIDIOC_ENUM_FRAMEINTERVALS ioctl
696 * @s: pointer to standard V4L2 device structure
697 * @fival: standard V4L2 VIDIOC_ENUM_FRAMEINTERVALS ioctl structure
698 *
699 * Return 0 if successful, otherwise -EINVAL.
700 */
701static int ioctl_enum_frameintervals(struct v4l2_int_device *s,
702 struct v4l2_frmivalenum *fival)
703{
704 if (fival->index < 0 || fival->index >= 1)
705 return -EINVAL;
706
707 fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
708 fival->discrete.numerator = 1;
709
710 fival->discrete.denominator = video_fmts[video_idx].framerates;
711
712 return 0;
713}
714
715/*!
691 * ioctl_g_chip_ident - V4L2 sensor interface handler for 716 * ioctl_g_chip_ident - V4L2 sensor interface handler for
692 * VIDIOC_DBG_G_CHIP_IDENT ioctl 717 * VIDIOC_DBG_G_CHIP_IDENT ioctl
693 * @s: pointer to standard V4L2 device structure 718 * @s: pointer to standard V4L2 device structure
@@ -788,6 +813,8 @@ static struct v4l2_int_ioctl_desc vadc_ioctl_desc[] = {
788 (v4l2_int_ioctl_func *)ioctl_s_ctrl }, 813 (v4l2_int_ioctl_func *)ioctl_s_ctrl },
789 { vidioc_int_enum_framesizes_num, 814 { vidioc_int_enum_framesizes_num,
790 (v4l2_int_ioctl_func *)ioctl_enum_framesizes }, 815 (v4l2_int_ioctl_func *)ioctl_enum_framesizes },
816 { vidioc_int_enum_frameintervals_num,
817 (v4l2_int_ioctl_func *)ioctl_enum_frameintervals },
791 { vidioc_int_g_chip_ident_num, 818 { vidioc_int_g_chip_ident_num,
792 (v4l2_int_ioctl_func *)ioctl_g_chip_ident }, 819 (v4l2_int_ioctl_func *)ioctl_g_chip_ident },
793}; 820};