diff options
author | Florian Echtler <floe@butterbrot.org> | 2016-05-31 16:15:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-08-24 09:07:06 -0400 |
commit | f223c30f1ee9d327df2761f0546c413aabe8f356 (patch) | |
tree | ce1f4347f1f7280eb8e83a60cfcac7f73c6f7b46 /drivers/input | |
parent | f22bede31378119e439758ea56f4f79462199a0d (diff) |
[media] sur40: properly report a single frame rate of 60 FPS
The device hardware is always running at 60 FPS, so report this both via
PARM_IOCTL and ENUM_FRAMEINTERVALS.
[hans.verkuil@cisco.com: fix suspect indent checkpatch warning]
[mchehab@s-opensource.com: fix a trivial merge conflict]
Signed-off-by: Martin Kaltenbrunner <modin@yuri.at>
Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/sur40.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index 3967d8c651cc..aefb6e11f88a 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c | |||
@@ -839,6 +839,19 @@ static int sur40_vidioc_g_fmt(struct file *file, void *priv, | |||
839 | return 0; | 839 | return 0; |
840 | } | 840 | } |
841 | 841 | ||
842 | static int sur40_ioctl_parm(struct file *file, void *priv, | ||
843 | struct v4l2_streamparm *p) | ||
844 | { | ||
845 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
846 | return -EINVAL; | ||
847 | |||
848 | p->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; | ||
849 | p->parm.capture.timeperframe.numerator = 1; | ||
850 | p->parm.capture.timeperframe.denominator = 60; | ||
851 | p->parm.capture.readbuffers = 3; | ||
852 | return 0; | ||
853 | } | ||
854 | |||
842 | static int sur40_vidioc_enum_fmt(struct file *file, void *priv, | 855 | static int sur40_vidioc_enum_fmt(struct file *file, void *priv, |
843 | struct v4l2_fmtdesc *f) | 856 | struct v4l2_fmtdesc *f) |
844 | { | 857 | { |
@@ -870,14 +883,14 @@ static int sur40_vidioc_enum_frameintervals(struct file *file, void *priv, | |||
870 | { | 883 | { |
871 | struct sur40_state *sur40 = video_drvdata(file); | 884 | struct sur40_state *sur40 = video_drvdata(file); |
872 | 885 | ||
873 | if ((f->index > 1) || ((f->pixel_format != V4L2_TCH_FMT_TU08) | 886 | if ((f->index > 0) || ((f->pixel_format != V4L2_TCH_FMT_TU08) |
874 | && (f->pixel_format != V4L2_PIX_FMT_GREY)) | 887 | && (f->pixel_format != V4L2_PIX_FMT_GREY)) |
875 | || (f->width != sur40->pix_fmt.width) | 888 | || (f->width != sur40->pix_fmt.width) |
876 | || (f->height != sur40->pix_fmt.height)) | 889 | || (f->height != sur40->pix_fmt.height)) |
877 | return -EINVAL; | 890 | return -EINVAL; |
878 | 891 | ||
879 | f->type = V4L2_FRMIVAL_TYPE_DISCRETE; | 892 | f->type = V4L2_FRMIVAL_TYPE_DISCRETE; |
880 | f->discrete.denominator = 60/(f->index+1); | 893 | f->discrete.denominator = 60; |
881 | f->discrete.numerator = 1; | 894 | f->discrete.numerator = 1; |
882 | return 0; | 895 | return 0; |
883 | } | 896 | } |
@@ -937,6 +950,9 @@ static const struct v4l2_ioctl_ops sur40_video_ioctl_ops = { | |||
937 | .vidioc_enum_framesizes = sur40_vidioc_enum_framesizes, | 950 | .vidioc_enum_framesizes = sur40_vidioc_enum_framesizes, |
938 | .vidioc_enum_frameintervals = sur40_vidioc_enum_frameintervals, | 951 | .vidioc_enum_frameintervals = sur40_vidioc_enum_frameintervals, |
939 | 952 | ||
953 | .vidioc_g_parm = sur40_ioctl_parm, | ||
954 | .vidioc_s_parm = sur40_ioctl_parm, | ||
955 | |||
940 | .vidioc_enum_input = sur40_vidioc_enum_input, | 956 | .vidioc_enum_input = sur40_vidioc_enum_input, |
941 | .vidioc_g_input = sur40_vidioc_g_input, | 957 | .vidioc_g_input = sur40_vidioc_g_input, |
942 | .vidioc_s_input = sur40_vidioc_s_input, | 958 | .vidioc_s_input = sur40_vidioc_s_input, |