aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-21 01:57:38 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-26 11:54:58 -0400
commita399810ca69d9d4bd30ab8c1678c7439e567f90b (patch)
tree32939ef77bc75c3a224d37cf4e885d7f808741bf /drivers/media/video/cx88
parentb654fcdc0ea3b6e5724c9873ae062bdfe7f28efe (diff)
V4L/DVB (8482): videodev: move all ioctl callbacks to a new v4l2_ioctl_ops struct
All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it. This ensures a clean separation between the const ops struct and the non-const video_device struct. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c16
-rw-r--r--drivers/media/video/cx88/cx88-video.c33
2 files changed, 30 insertions, 19 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 4d1a461f329f..55c35482089e 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1175,12 +1175,7 @@ static const struct file_operations mpeg_fops =
1175 .llseek = no_llseek, 1175 .llseek = no_llseek,
1176}; 1176};
1177 1177
1178static struct video_device cx8802_mpeg_template = 1178static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
1179{
1180 .name = "cx8802",
1181 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES|VID_TYPE_MPEG_ENCODER,
1182 .fops = &mpeg_fops,
1183 .minor = -1,
1184 .vidioc_querymenu = vidioc_querymenu, 1179 .vidioc_querymenu = vidioc_querymenu,
1185 .vidioc_querycap = vidioc_querycap, 1180 .vidioc_querycap = vidioc_querycap,
1186 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, 1181 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
@@ -1208,6 +1203,15 @@ static struct video_device cx8802_mpeg_template =
1208 .vidioc_g_tuner = vidioc_g_tuner, 1203 .vidioc_g_tuner = vidioc_g_tuner,
1209 .vidioc_s_tuner = vidioc_s_tuner, 1204 .vidioc_s_tuner = vidioc_s_tuner,
1210 .vidioc_s_std = vidioc_s_std, 1205 .vidioc_s_std = vidioc_s_std,
1206};
1207
1208static struct video_device cx8802_mpeg_template = {
1209 .name = "cx8802",
1210 .type = VID_TYPE_CAPTURE | VID_TYPE_TUNER |
1211 VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER,
1212 .fops = &mpeg_fops,
1213 .ioctl_ops = &mpeg_ioctl_ops,
1214 .minor = -1,
1211 .tvnorms = CX88_NORMS, 1215 .tvnorms = CX88_NORMS,
1212 .current_norm = V4L2_STD_NTSC_M, 1216 .current_norm = V4L2_STD_NTSC_M,
1213}; 1217};
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index f8cc55db9f42..24b403b238d1 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1683,13 +1683,7 @@ static const struct file_operations video_fops =
1683 .llseek = no_llseek, 1683 .llseek = no_llseek,
1684}; 1684};
1685 1685
1686static struct video_device cx8800_vbi_template; 1686static const struct v4l2_ioctl_ops video_ioctl_ops = {
1687static struct video_device cx8800_video_template =
1688{
1689 .name = "cx8800-video",
1690 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES,
1691 .fops = &video_fops,
1692 .minor = -1,
1693 .vidioc_querycap = vidioc_querycap, 1687 .vidioc_querycap = vidioc_querycap,
1694 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, 1688 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
1695 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, 1689 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
@@ -1722,6 +1716,16 @@ static struct video_device cx8800_video_template =
1722 .vidioc_g_register = vidioc_g_register, 1716 .vidioc_g_register = vidioc_g_register,
1723 .vidioc_s_register = vidioc_s_register, 1717 .vidioc_s_register = vidioc_s_register,
1724#endif 1718#endif
1719};
1720
1721static struct video_device cx8800_vbi_template;
1722
1723static struct video_device cx8800_video_template = {
1724 .name = "cx8800-video",
1725 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES,
1726 .fops = &video_fops,
1727 .minor = -1,
1728 .ioctl_ops = &video_ioctl_ops,
1725 .tvnorms = CX88_NORMS, 1729 .tvnorms = CX88_NORMS,
1726 .current_norm = V4L2_STD_NTSC_M, 1730 .current_norm = V4L2_STD_NTSC_M,
1727}; 1731};
@@ -1736,12 +1740,7 @@ static const struct file_operations radio_fops =
1736 .llseek = no_llseek, 1740 .llseek = no_llseek,
1737}; 1741};
1738 1742
1739static struct video_device cx8800_radio_template = 1743static const struct v4l2_ioctl_ops radio_ioctl_ops = {
1740{
1741 .name = "cx8800-radio",
1742 .type = VID_TYPE_TUNER,
1743 .fops = &radio_fops,
1744 .minor = -1,
1745 .vidioc_querycap = radio_querycap, 1744 .vidioc_querycap = radio_querycap,
1746 .vidioc_g_tuner = radio_g_tuner, 1745 .vidioc_g_tuner = radio_g_tuner,
1747 .vidioc_enum_input = radio_enum_input, 1746 .vidioc_enum_input = radio_enum_input,
@@ -1760,6 +1759,14 @@ static struct video_device cx8800_radio_template =
1760#endif 1759#endif
1761}; 1760};
1762 1761
1762static struct video_device cx8800_radio_template = {
1763 .name = "cx8800-radio",
1764 .type = VID_TYPE_TUNER,
1765 .fops = &radio_fops,
1766 .minor = -1,
1767 .ioctl_ops = &radio_ioctl_ops,
1768};
1769
1763/* ----------------------------------------------------------- */ 1770/* ----------------------------------------------------------- */
1764 1771
1765static void cx8800_unregister_video(struct cx8800_dev *dev) 1772static void cx8800_unregister_video(struct cx8800_dev *dev)