diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-21 01:57:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-26 11:54:58 -0400 |
commit | a399810ca69d9d4bd30ab8c1678c7439e567f90b (patch) | |
tree | 32939ef77bc75c3a224d37cf4e885d7f808741bf /drivers/media/video/soc_camera.c | |
parent | b654fcdc0ea3b6e5724c9873ae062bdfe7f28efe (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/soc_camera.c')
-rw-r--r-- | drivers/media/video/soc_camera.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index b01749088472..9ff561452587 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
@@ -862,6 +862,35 @@ void soc_camera_device_unregister(struct soc_camera_device *icd) | |||
862 | } | 862 | } |
863 | EXPORT_SYMBOL(soc_camera_device_unregister); | 863 | EXPORT_SYMBOL(soc_camera_device_unregister); |
864 | 864 | ||
865 | static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = { | ||
866 | .vidioc_querycap = soc_camera_querycap, | ||
867 | .vidioc_g_fmt_vid_cap = soc_camera_g_fmt_vid_cap, | ||
868 | .vidioc_enum_fmt_vid_cap = soc_camera_enum_fmt_vid_cap, | ||
869 | .vidioc_s_fmt_vid_cap = soc_camera_s_fmt_vid_cap, | ||
870 | .vidioc_enum_input = soc_camera_enum_input, | ||
871 | .vidioc_g_input = soc_camera_g_input, | ||
872 | .vidioc_s_input = soc_camera_s_input, | ||
873 | .vidioc_s_std = soc_camera_s_std, | ||
874 | .vidioc_reqbufs = soc_camera_reqbufs, | ||
875 | .vidioc_try_fmt_vid_cap = soc_camera_try_fmt_vid_cap, | ||
876 | .vidioc_querybuf = soc_camera_querybuf, | ||
877 | .vidioc_qbuf = soc_camera_qbuf, | ||
878 | .vidioc_dqbuf = soc_camera_dqbuf, | ||
879 | .vidioc_streamon = soc_camera_streamon, | ||
880 | .vidioc_streamoff = soc_camera_streamoff, | ||
881 | .vidioc_queryctrl = soc_camera_queryctrl, | ||
882 | .vidioc_g_ctrl = soc_camera_g_ctrl, | ||
883 | .vidioc_s_ctrl = soc_camera_s_ctrl, | ||
884 | .vidioc_cropcap = soc_camera_cropcap, | ||
885 | .vidioc_g_crop = soc_camera_g_crop, | ||
886 | .vidioc_s_crop = soc_camera_s_crop, | ||
887 | .vidioc_g_chip_ident = soc_camera_g_chip_ident, | ||
888 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
889 | .vidioc_g_register = soc_camera_g_register, | ||
890 | .vidioc_s_register = soc_camera_s_register, | ||
891 | #endif | ||
892 | }; | ||
893 | |||
865 | int soc_camera_video_start(struct soc_camera_device *icd) | 894 | int soc_camera_video_start(struct soc_camera_device *icd) |
866 | { | 895 | { |
867 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 896 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); |
@@ -882,35 +911,10 @@ int soc_camera_video_start(struct soc_camera_device *icd) | |||
882 | vdev->type = VID_TYPE_CAPTURE; | 911 | vdev->type = VID_TYPE_CAPTURE; |
883 | vdev->current_norm = V4L2_STD_UNKNOWN; | 912 | vdev->current_norm = V4L2_STD_UNKNOWN; |
884 | vdev->fops = &soc_camera_fops; | 913 | vdev->fops = &soc_camera_fops; |
914 | vdev->ioctl_ops = &soc_camera_ioctl_ops; | ||
885 | vdev->release = video_device_release; | 915 | vdev->release = video_device_release; |
886 | vdev->minor = -1; | 916 | vdev->minor = -1; |
887 | vdev->tvnorms = V4L2_STD_UNKNOWN, | 917 | vdev->tvnorms = V4L2_STD_UNKNOWN, |
888 | vdev->vidioc_querycap = soc_camera_querycap; | ||
889 | vdev->vidioc_g_fmt_vid_cap = soc_camera_g_fmt_vid_cap; | ||
890 | vdev->vidioc_enum_fmt_vid_cap = soc_camera_enum_fmt_vid_cap; | ||
891 | vdev->vidioc_s_fmt_vid_cap = soc_camera_s_fmt_vid_cap; | ||
892 | vdev->vidioc_enum_input = soc_camera_enum_input; | ||
893 | vdev->vidioc_g_input = soc_camera_g_input; | ||
894 | vdev->vidioc_s_input = soc_camera_s_input; | ||
895 | vdev->vidioc_s_std = soc_camera_s_std; | ||
896 | vdev->vidioc_reqbufs = soc_camera_reqbufs; | ||
897 | vdev->vidioc_try_fmt_vid_cap = soc_camera_try_fmt_vid_cap; | ||
898 | vdev->vidioc_querybuf = soc_camera_querybuf; | ||
899 | vdev->vidioc_qbuf = soc_camera_qbuf; | ||
900 | vdev->vidioc_dqbuf = soc_camera_dqbuf; | ||
901 | vdev->vidioc_streamon = soc_camera_streamon; | ||
902 | vdev->vidioc_streamoff = soc_camera_streamoff; | ||
903 | vdev->vidioc_queryctrl = soc_camera_queryctrl; | ||
904 | vdev->vidioc_g_ctrl = soc_camera_g_ctrl; | ||
905 | vdev->vidioc_s_ctrl = soc_camera_s_ctrl; | ||
906 | vdev->vidioc_cropcap = soc_camera_cropcap; | ||
907 | vdev->vidioc_g_crop = soc_camera_g_crop; | ||
908 | vdev->vidioc_s_crop = soc_camera_s_crop; | ||
909 | vdev->vidioc_g_chip_ident = soc_camera_g_chip_ident; | ||
910 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
911 | vdev->vidioc_g_register = soc_camera_g_register; | ||
912 | vdev->vidioc_s_register = soc_camera_s_register; | ||
913 | #endif | ||
914 | 918 | ||
915 | icd->current_fmt = &icd->formats[0]; | 919 | icd->current_fmt = &icd->formats[0]; |
916 | 920 | ||