aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-controls.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-22 10:57:31 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:11:51 -0400
commit37f89f9542c3945bddf46efc15a1b1e349af3f88 (patch)
tree5020c56d1b73c13e8e1a7425f55c703745cf12ca /drivers/media/video/ivtv/ivtv-controls.c
parent21575c13125f2ef790e192e2c70e446c6cfe0d7d (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/ivtv/ivtv-controls.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-controls.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/media/video/ivtv/ivtv-controls.c b/drivers/media/video/ivtv/ivtv-controls.c
index 06723bac99c5..2df9b0668f1f 100644
--- a/drivers/media/video/ivtv/ivtv-controls.c
+++ b/drivers/media/video/ivtv/ivtv-controls.c
@@ -53,8 +53,6 @@ int ivtv_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl)
53 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 53 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
54 const char *name; 54 const char *name;
55 55
56 IVTV_DEBUG_IOCTL("VIDIOC_QUERYCTRL(%08x)\n", qctrl->id);
57
58 qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); 56 qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
59 if (qctrl->id == 0) 57 if (qctrl->id == 0)
60 return -EINVAL; 58 return -EINVAL;
@@ -91,10 +89,8 @@ int ivtv_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl)
91 89
92int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) 90int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu)
93{ 91{
94 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
95 struct v4l2_queryctrl qctrl; 92 struct v4l2_queryctrl qctrl;
96 93
97 IVTV_DEBUG_IOCTL("VIDIOC_QUERYMENU\n");
98 qctrl.id = qmenu->id; 94 qctrl.id = qmenu->id;
99 ivtv_queryctrl(file, fh, &qctrl); 95 ivtv_queryctrl(file, fh, &qctrl);
100 return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); 96 return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id));
@@ -103,9 +99,6 @@ int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu)
103int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) 99int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
104{ 100{
105 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 101 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
106 s32 v = vctrl->value;
107
108 IVTV_DEBUG_IOCTL("VIDIOC_S_CTRL(%08x, %x)\n", vctrl->id, v);
109 102
110 switch (vctrl->id) { 103 switch (vctrl->id) {
111 /* Standard V4L2 controls */ 104 /* Standard V4L2 controls */
@@ -124,7 +117,7 @@ int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
124 return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl); 117 return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl);
125 118
126 default: 119 default:
127 IVTV_DEBUG_IOCTL("invalid control %x\n", vctrl->id); 120 IVTV_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
128 return -EINVAL; 121 return -EINVAL;
129 } 122 }
130 return 0; 123 return 0;
@@ -134,8 +127,6 @@ int ivtv_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
134{ 127{
135 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 128 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
136 129
137 IVTV_DEBUG_IOCTL("VIDIOC_G_CTRL(%08x)\n", vctrl->id);
138
139 switch (vctrl->id) { 130 switch (vctrl->id) {
140 /* Standard V4L2 controls */ 131 /* Standard V4L2 controls */
141 case V4L2_CID_BRIGHTNESS: 132 case V4L2_CID_BRIGHTNESS:
@@ -152,7 +143,7 @@ int ivtv_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
152 case V4L2_CID_AUDIO_LOUDNESS: 143 case V4L2_CID_AUDIO_LOUDNESS:
153 return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl); 144 return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl);
154 default: 145 default:
155 IVTV_DEBUG_IOCTL("invalid control %x\n", vctrl->id); 146 IVTV_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
156 return -EINVAL; 147 return -EINVAL;
157 } 148 }
158 return 0; 149 return 0;
@@ -219,7 +210,6 @@ int ivtv_g_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
219 } 210 }
220 return err; 211 return err;
221 } 212 }
222 IVTV_DEBUG_IOCTL("VIDIOC_G_EXT_CTRLS\n");
223 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) 213 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
224 return cx2341x_ext_ctrls(&itv->params, 0, c, VIDIOC_G_EXT_CTRLS); 214 return cx2341x_ext_ctrls(&itv->params, 0, c, VIDIOC_G_EXT_CTRLS);
225 return -EINVAL; 215 return -EINVAL;
@@ -246,7 +236,6 @@ int ivtv_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
246 } 236 }
247 return err; 237 return err;
248 } 238 }
249 IVTV_DEBUG_IOCTL("VIDIOC_S_EXT_CTRLS\n");
250 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) { 239 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) {
251 static u32 freqs[3] = { 44100, 48000, 32000 }; 240 static u32 freqs[3] = { 44100, 48000, 32000 };
252 struct cx2341x_mpeg_params p = itv->params; 241 struct cx2341x_mpeg_params p = itv->params;
@@ -286,7 +275,6 @@ int ivtv_try_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
286{ 275{
287 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 276 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
288 277
289 IVTV_DEBUG_IOCTL("VIDIOC_TRY_EXT_CTRLS\n");
290 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) 278 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
291 return cx2341x_ext_ctrls(&itv->params, atomic_read(&itv->capturing), c, VIDIOC_TRY_EXT_CTRLS); 279 return cx2341x_ext_ctrls(&itv->params, atomic_read(&itv->capturing), c, VIDIOC_TRY_EXT_CTRLS);
292 return -EINVAL; 280 return -EINVAL;