aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/Makefile2
-rw-r--r--drivers/media/video/v4l2-subdev.c128
2 files changed, 1 insertions, 129 deletions
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 7c0bd6e78312..3f1a0350a569 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -10,7 +10,7 @@ stkwebcam-objs := stk-webcam.o stk-sensor.o
10 10
11omap2cam-objs := omap24xxcam.o omap24xxcam-dma.o 11omap2cam-objs := omap24xxcam.o omap24xxcam-dma.o
12 12
13videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-subdev.o 13videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o
14 14
15obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-int-device.o 15obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-int-device.o
16ifeq ($(CONFIG_COMPAT),y) 16ifeq ($(CONFIG_COMPAT),y)
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c
deleted file mode 100644
index dc881671d536..000000000000
--- a/drivers/media/video/v4l2-subdev.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 V4L2 sub-device support.
3
4 Copyright (C) 2008 Hans Verkuil <hverkuil@xs4all.nl>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/types.h>
22#include <linux/ioctl.h>
23#include <linux/i2c.h>
24#include <linux/videodev2.h>
25#include <media/v4l2-subdev.h>
26
27int v4l2_subdev_command(struct v4l2_subdev *sd, unsigned cmd, void *arg)
28{
29 switch (cmd) {
30 case VIDIOC_QUERYCTRL:
31 return v4l2_subdev_call(sd, core, queryctrl, arg);
32 case VIDIOC_G_CTRL:
33 return v4l2_subdev_call(sd, core, g_ctrl, arg);
34 case VIDIOC_S_CTRL:
35 return v4l2_subdev_call(sd, core, s_ctrl, arg);
36 case VIDIOC_G_EXT_CTRLS:
37 return v4l2_subdev_call(sd, core, g_ext_ctrls, arg);
38 case VIDIOC_S_EXT_CTRLS:
39 return v4l2_subdev_call(sd, core, s_ext_ctrls, arg);
40 case VIDIOC_TRY_EXT_CTRLS:
41 return v4l2_subdev_call(sd, core, try_ext_ctrls, arg);
42 case VIDIOC_QUERYMENU:
43 return v4l2_subdev_call(sd, core, querymenu, arg);
44 case VIDIOC_LOG_STATUS:
45 return v4l2_subdev_call(sd, core, log_status);
46 case VIDIOC_DBG_G_CHIP_IDENT:
47 return v4l2_subdev_call(sd, core, g_chip_ident, arg);
48 case VIDIOC_INT_S_STANDBY:
49 return v4l2_subdev_call(sd, core, s_standby, arg ? (*(u32 *)arg) : 0);
50 case VIDIOC_INT_RESET:
51 return v4l2_subdev_call(sd, core, reset, arg ? (*(u32 *)arg) : 0);
52 case VIDIOC_INT_S_GPIO:
53 return v4l2_subdev_call(sd, core, s_gpio, arg ? (*(u32 *)arg) : 0);
54 case VIDIOC_INT_INIT:
55 return v4l2_subdev_call(sd, core, init, arg ? (*(u32 *)arg) : 0);
56#ifdef CONFIG_VIDEO_ADV_DEBUG
57 case VIDIOC_DBG_G_REGISTER:
58 return v4l2_subdev_call(sd, core, g_register, arg);
59 case VIDIOC_DBG_S_REGISTER:
60 return v4l2_subdev_call(sd, core, s_register, arg);
61#endif
62
63 case VIDIOC_INT_S_TUNER_MODE:
64 return v4l2_subdev_call(sd, tuner, s_mode, *(enum v4l2_tuner_type *)arg);
65 case AUDC_SET_RADIO:
66 return v4l2_subdev_call(sd, tuner, s_radio);
67 case VIDIOC_S_TUNER:
68 return v4l2_subdev_call(sd, tuner, s_tuner, arg);
69 case VIDIOC_G_TUNER:
70 return v4l2_subdev_call(sd, tuner, g_tuner, arg);
71 case VIDIOC_S_STD:
72 return v4l2_subdev_call(sd, tuner, s_std, *(v4l2_std_id *)arg);
73 case VIDIOC_S_FREQUENCY:
74 return v4l2_subdev_call(sd, tuner, s_frequency, arg);
75 case VIDIOC_G_FREQUENCY:
76 return v4l2_subdev_call(sd, tuner, g_frequency, arg);
77 case TUNER_SET_TYPE_ADDR:
78 return v4l2_subdev_call(sd, tuner, s_type_addr, arg);
79 case TUNER_SET_CONFIG:
80 return v4l2_subdev_call(sd, tuner, s_config, arg);
81
82 case VIDIOC_INT_AUDIO_CLOCK_FREQ:
83 return v4l2_subdev_call(sd, audio, s_clock_freq, *(u32 *)arg);
84 case VIDIOC_INT_S_AUDIO_ROUTING:
85 return v4l2_subdev_call(sd, audio, s_routing, arg);
86 case VIDIOC_INT_I2S_CLOCK_FREQ:
87 return v4l2_subdev_call(sd, audio, s_i2s_clock_freq, *(u32 *)arg);
88
89 case VIDIOC_INT_S_VIDEO_ROUTING:
90 return v4l2_subdev_call(sd, video, s_routing, arg);
91 case VIDIOC_INT_S_CRYSTAL_FREQ:
92 return v4l2_subdev_call(sd, video, s_crystal_freq, arg);
93 case VIDIOC_INT_DECODE_VBI_LINE:
94 return v4l2_subdev_call(sd, video, decode_vbi_line, arg);
95 case VIDIOC_INT_S_VBI_DATA:
96 return v4l2_subdev_call(sd, video, s_vbi_data, arg);
97 case VIDIOC_INT_G_VBI_DATA:
98 return v4l2_subdev_call(sd, video, g_vbi_data, arg);
99 case VIDIOC_G_SLICED_VBI_CAP:
100 return v4l2_subdev_call(sd, video, g_sliced_vbi_cap, arg);
101 case VIDIOC_ENUM_FMT:
102 return v4l2_subdev_call(sd, video, enum_fmt, arg);
103 case VIDIOC_TRY_FMT:
104 return v4l2_subdev_call(sd, video, try_fmt, arg);
105 case VIDIOC_S_FMT:
106 return v4l2_subdev_call(sd, video, s_fmt, arg);
107 case VIDIOC_G_FMT:
108 return v4l2_subdev_call(sd, video, g_fmt, arg);
109 case VIDIOC_INT_S_STD_OUTPUT:
110 return v4l2_subdev_call(sd, video, s_std_output, *(v4l2_std_id *)arg);
111 case VIDIOC_QUERYSTD:
112 return v4l2_subdev_call(sd, video, querystd, arg);
113 case VIDIOC_INT_G_INPUT_STATUS:
114 return v4l2_subdev_call(sd, video, g_input_status, arg);
115 case VIDIOC_STREAMON:
116 return v4l2_subdev_call(sd, video, s_stream, 1);
117 case VIDIOC_STREAMOFF:
118 return v4l2_subdev_call(sd, video, s_stream, 0);
119 case VIDIOC_S_PARM:
120 return v4l2_subdev_call(sd, video, s_parm, arg);
121 case VIDIOC_G_PARM:
122 return v4l2_subdev_call(sd, video, g_parm, arg);
123
124 default:
125 return v4l2_subdev_call(sd, core, ioctl, cmd, arg);
126 }
127}
128EXPORT_SYMBOL_GPL(v4l2_subdev_command);