aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 62182e311060..9b4557a2f6d0 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1802,6 +1802,45 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
1802 return 0; 1802 return 0;
1803} 1803}
1804 1804
1805static int vidioc_enum_framesizes(struct file *file, void *priv,
1806 struct v4l2_frmsizeenum *fsize)
1807{
1808 struct em28xx_fh *fh = priv;
1809 struct em28xx *dev = fh->dev;
1810 struct em28xx_fmt *fmt;
1811 unsigned int maxw = norm_maxw(dev);
1812 unsigned int maxh = norm_maxh(dev);
1813
1814 fmt = format_by_fourcc(fsize->pixel_format);
1815 if (!fmt) {
1816 em28xx_videodbg("Fourcc format (%08x) invalid.\n",
1817 fsize->pixel_format);
1818 return -EINVAL;
1819 }
1820
1821 if (dev->board.is_em2800) {
1822 if (fsize->index > 1)
1823 return -EINVAL;
1824 fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
1825 fsize->discrete.width = maxw / (1 + fsize->index);
1826 fsize->discrete.height = maxh / (1 + fsize->index);
1827 return 0;
1828 }
1829
1830 if (fsize->index != 0)
1831 return -EINVAL;
1832
1833 /* Report a continuous range */
1834 fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
1835 fsize->stepwise.min_width = 48;
1836 fsize->stepwise.min_height = 32;
1837 fsize->stepwise.max_width = maxw;
1838 fsize->stepwise.max_height = maxh;
1839 fsize->stepwise.step_width = 1;
1840 fsize->stepwise.step_height = 1;
1841 return 0;
1842}
1843
1805/* Sliced VBI ioctls */ 1844/* Sliced VBI ioctls */
1806static int vidioc_g_fmt_sliced_vbi_cap(struct file *file, void *priv, 1845static int vidioc_g_fmt_sliced_vbi_cap(struct file *file, void *priv,
1807 struct v4l2_format *f) 1846 struct v4l2_format *f)
@@ -2356,10 +2395,10 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
2356 .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, 2395 .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
2357 .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap, 2396 .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap,
2358 .vidioc_s_fmt_vbi_cap = vidioc_s_fmt_vbi_cap, 2397 .vidioc_s_fmt_vbi_cap = vidioc_s_fmt_vbi_cap,
2398 .vidioc_enum_framesizes = vidioc_enum_framesizes,
2359 .vidioc_g_audio = vidioc_g_audio, 2399 .vidioc_g_audio = vidioc_g_audio,
2360 .vidioc_s_audio = vidioc_s_audio, 2400 .vidioc_s_audio = vidioc_s_audio,
2361 .vidioc_cropcap = vidioc_cropcap, 2401 .vidioc_cropcap = vidioc_cropcap,
2362
2363 .vidioc_g_fmt_sliced_vbi_cap = vidioc_g_fmt_sliced_vbi_cap, 2402 .vidioc_g_fmt_sliced_vbi_cap = vidioc_g_fmt_sliced_vbi_cap,
2364 .vidioc_try_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap, 2403 .vidioc_try_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap,
2365 .vidioc_s_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap, 2404 .vidioc_s_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap,