diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-06-22 10:57:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:11:51 -0400 |
commit | 37f89f9542c3945bddf46efc15a1b1e349af3f88 (patch) | |
tree | 5020c56d1b73c13e8e1a7425f55c703745cf12ca /drivers/media/video/cx18/cx18-controls.c | |
parent | 21575c13125f2ef790e192e2c70e446c6cfe0d7d (diff) |
V4L/DVB (8104): cx18/ivtv: ioctl debugging improvements
Completely rely on the video_ioctl2 debugging facilities rather than
doing it ourselves.
Fill in some missing fields in ivtv with VIDIOC_G_FBUF.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx18/cx18-controls.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-controls.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c index 6eae75f4ee7c..01ba9ca37d09 100644 --- a/drivers/media/video/cx18/cx18-controls.c +++ b/drivers/media/video/cx18/cx18-controls.c | |||
@@ -56,8 +56,6 @@ int cx18_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl) | |||
56 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 56 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
57 | const char *name; | 57 | const char *name; |
58 | 58 | ||
59 | CX18_DEBUG_IOCTL("VIDIOC_QUERYCTRL(%08x)\n", qctrl->id); | ||
60 | |||
61 | qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); | 59 | qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); |
62 | if (qctrl->id == 0) | 60 | if (qctrl->id == 0) |
63 | return -EINVAL; | 61 | return -EINVAL; |
@@ -94,10 +92,8 @@ int cx18_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl) | |||
94 | 92 | ||
95 | int cx18_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) | 93 | int cx18_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) |
96 | { | 94 | { |
97 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | ||
98 | struct v4l2_queryctrl qctrl; | 95 | struct v4l2_queryctrl qctrl; |
99 | 96 | ||
100 | CX18_DEBUG_IOCTL("VIDIOC_QUERYMENU\n"); | ||
101 | qctrl.id = qmenu->id; | 97 | qctrl.id = qmenu->id; |
102 | cx18_queryctrl(file, fh, &qctrl); | 98 | cx18_queryctrl(file, fh, &qctrl); |
103 | return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); | 99 | return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); |
@@ -108,14 +104,11 @@ int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) | |||
108 | struct cx18_open_id *id = fh; | 104 | struct cx18_open_id *id = fh; |
109 | struct cx18 *cx = id->cx; | 105 | struct cx18 *cx = id->cx; |
110 | int ret; | 106 | int ret; |
111 | s32 v = vctrl->value; | ||
112 | 107 | ||
113 | ret = v4l2_prio_check(&cx->prio, &id->prio); | 108 | ret = v4l2_prio_check(&cx->prio, &id->prio); |
114 | if (ret) | 109 | if (ret) |
115 | return ret; | 110 | return ret; |
116 | 111 | ||
117 | CX18_DEBUG_IOCTL("VIDIOC_S_CTRL(%08x, %x)\n", vctrl->id, v); | ||
118 | |||
119 | switch (vctrl->id) { | 112 | switch (vctrl->id) { |
120 | /* Standard V4L2 controls */ | 113 | /* Standard V4L2 controls */ |
121 | case V4L2_CID_BRIGHTNESS: | 114 | case V4L2_CID_BRIGHTNESS: |
@@ -133,7 +126,7 @@ int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) | |||
133 | return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl); | 126 | return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl); |
134 | 127 | ||
135 | default: | 128 | default: |
136 | CX18_DEBUG_IOCTL("invalid control %x\n", vctrl->id); | 129 | CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id); |
137 | return -EINVAL; | 130 | return -EINVAL; |
138 | } | 131 | } |
139 | return 0; | 132 | return 0; |
@@ -143,8 +136,6 @@ int cx18_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) | |||
143 | { | 136 | { |
144 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 137 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
145 | 138 | ||
146 | CX18_DEBUG_IOCTL("VIDIOC_G_CTRL(%08x)\n", vctrl->id); | ||
147 | |||
148 | switch (vctrl->id) { | 139 | switch (vctrl->id) { |
149 | /* Standard V4L2 controls */ | 140 | /* Standard V4L2 controls */ |
150 | case V4L2_CID_BRIGHTNESS: | 141 | case V4L2_CID_BRIGHTNESS: |
@@ -161,7 +152,7 @@ int cx18_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) | |||
161 | case V4L2_CID_AUDIO_LOUDNESS: | 152 | case V4L2_CID_AUDIO_LOUDNESS: |
162 | return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl); | 153 | return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl); |
163 | default: | 154 | default: |
164 | CX18_DEBUG_IOCTL("invalid control %x\n", vctrl->id); | 155 | CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id); |
165 | return -EINVAL; | 156 | return -EINVAL; |
166 | } | 157 | } |
167 | return 0; | 158 | return 0; |
@@ -227,7 +218,6 @@ int cx18_g_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c) | |||
227 | } | 218 | } |
228 | return err; | 219 | return err; |
229 | } | 220 | } |
230 | CX18_DEBUG_IOCTL("VIDIOC_G_EXT_CTRLS\n"); | ||
231 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) | 221 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) |
232 | return cx2341x_ext_ctrls(&cx->params, 0, c, VIDIOC_G_EXT_CTRLS); | 222 | return cx2341x_ext_ctrls(&cx->params, 0, c, VIDIOC_G_EXT_CTRLS); |
233 | return -EINVAL; | 223 | return -EINVAL; |
@@ -260,7 +250,6 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c) | |||
260 | } | 250 | } |
261 | return err; | 251 | return err; |
262 | } | 252 | } |
263 | CX18_DEBUG_IOCTL("VIDIOC_S_EXT_CTRLS\n"); | ||
264 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) { | 253 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) { |
265 | struct cx2341x_mpeg_params p = cx->params; | 254 | struct cx2341x_mpeg_params p = cx->params; |
266 | int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing), | 255 | int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing), |
@@ -296,7 +285,6 @@ int cx18_try_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c) | |||
296 | { | 285 | { |
297 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 286 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
298 | 287 | ||
299 | CX18_DEBUG_IOCTL("VIDIOC_TRY_EXT_CTRLS\n"); | ||
300 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) | 288 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) |
301 | return cx2341x_ext_ctrls(&cx->params, | 289 | return cx2341x_ext_ctrls(&cx->params, |
302 | atomic_read(&cx->ana_capturing), | 290 | atomic_read(&cx->ana_capturing), |