diff options
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r-- | drivers/media/video/cx18/cx18-controls.c | 16 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-ioctl.c | 87 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-streams.c | 4 |
3 files changed, 12 insertions, 95 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), |
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index cfda54d022e0..7231f60a180b 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c | |||
@@ -165,8 +165,6 @@ static int cx18_g_fmt_vbi_cap(struct file *file, void *fh, | |||
165 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 165 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
166 | struct v4l2_vbi_format *vbifmt = &fmt->fmt.vbi; | 166 | struct v4l2_vbi_format *vbifmt = &fmt->fmt.vbi; |
167 | 167 | ||
168 | CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n"); | ||
169 | |||
170 | vbifmt->sampling_rate = 27000000; | 168 | vbifmt->sampling_rate = 27000000; |
171 | vbifmt->offset = 248; | 169 | vbifmt->offset = 248; |
172 | vbifmt->samples_per_line = cx->vbi.raw_decoder_line_size - 4; | 170 | vbifmt->samples_per_line = cx->vbi.raw_decoder_line_size - 4; |
@@ -195,8 +193,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh, | |||
195 | int w = fmt->fmt.pix.width; | 193 | int w = fmt->fmt.pix.width; |
196 | int h = fmt->fmt.pix.height; | 194 | int h = fmt->fmt.pix.height; |
197 | 195 | ||
198 | CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n"); | ||
199 | |||
200 | w = min(w, 720); | 196 | w = min(w, 720); |
201 | w = max(w, 1); | 197 | w = max(w, 1); |
202 | h = min(h, cx->is_50hz ? 576 : 480); | 198 | h = min(h, cx->is_50hz ? 576 : 480); |
@@ -210,10 +206,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh, | |||
210 | static int cx18_try_fmt_vbi_cap(struct file *file, void *fh, | 206 | static int cx18_try_fmt_vbi_cap(struct file *file, void *fh, |
211 | struct v4l2_format *fmt) | 207 | struct v4l2_format *fmt) |
212 | { | 208 | { |
213 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | ||
214 | |||
215 | CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n"); | ||
216 | |||
217 | return cx18_g_fmt_vbi_cap(file, fh, fmt); | 209 | return cx18_g_fmt_vbi_cap(file, fh, fmt); |
218 | } | 210 | } |
219 | 211 | ||
@@ -236,8 +228,6 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, | |||
236 | if (ret) | 228 | if (ret) |
237 | return ret; | 229 | return ret; |
238 | 230 | ||
239 | CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n"); | ||
240 | |||
241 | ret = cx18_try_fmt_vid_cap(file, fh, fmt); | 231 | ret = cx18_try_fmt_vid_cap(file, fh, fmt); |
242 | if (ret) | 232 | if (ret) |
243 | return ret; | 233 | return ret; |
@@ -265,8 +255,6 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh, | |||
265 | if (ret) | 255 | if (ret) |
266 | return ret; | 256 | return ret; |
267 | 257 | ||
268 | CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n"); | ||
269 | |||
270 | if (id->type == CX18_ENC_STREAM_TYPE_VBI && | 258 | if (id->type == CX18_ENC_STREAM_TYPE_VBI && |
271 | cx->vbi.sliced_in->service_set && | 259 | cx->vbi.sliced_in->service_set && |
272 | atomic_read(&cx->ana_capturing) > 0) | 260 | atomic_read(&cx->ana_capturing) > 0) |
@@ -288,8 +276,6 @@ static int cx18_g_chip_ident(struct file *file, void *fh, | |||
288 | { | 276 | { |
289 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 277 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
290 | 278 | ||
291 | CX18_DEBUG_IOCTL("VIDIOC_G_CHIP_IDENT\n"); | ||
292 | |||
293 | chip->ident = V4L2_IDENT_NONE; | 279 | chip->ident = V4L2_IDENT_NONE; |
294 | chip->revision = 0; | 280 | chip->revision = 0; |
295 | if (chip->match_type == V4L2_CHIP_MATCH_HOST) { | 281 | if (chip->match_type == V4L2_CHIP_MATCH_HOST) { |
@@ -311,8 +297,6 @@ static int cx18_g_register(struct file *file, void *fh, | |||
311 | { | 297 | { |
312 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 298 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
313 | 299 | ||
314 | CX18_DEBUG_IOCTL("VIDIOC_DBG_G_REGISTER\n"); | ||
315 | |||
316 | if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) | 300 | if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
317 | return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg); | 301 | return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg); |
318 | if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) | 302 | if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) |
@@ -327,8 +311,6 @@ static int cx18_s_register(struct file *file, void *fh, | |||
327 | { | 311 | { |
328 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 312 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
329 | 313 | ||
330 | CX18_DEBUG_IOCTL("VIDIOC_DBG_S_REGISTER\n"); | ||
331 | |||
332 | if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) | 314 | if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
333 | return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg); | 315 | return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg); |
334 | if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) | 316 | if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) |
@@ -342,8 +324,6 @@ static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p) | |||
342 | { | 324 | { |
343 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 325 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
344 | 326 | ||
345 | CX18_DEBUG_IOCTL("VIDIOC_G_PRIORITY\n"); | ||
346 | |||
347 | *p = v4l2_prio_max(&cx->prio); | 327 | *p = v4l2_prio_max(&cx->prio); |
348 | return 0; | 328 | return 0; |
349 | } | 329 | } |
@@ -353,8 +333,6 @@ static int cx18_s_priority(struct file *file, void *fh, enum v4l2_priority prio) | |||
353 | struct cx18_open_id *id = fh; | 333 | struct cx18_open_id *id = fh; |
354 | struct cx18 *cx = id->cx; | 334 | struct cx18 *cx = id->cx; |
355 | 335 | ||
356 | CX18_DEBUG_IOCTL("VIDIOC_S_PRIORITY\n"); | ||
357 | |||
358 | return v4l2_prio_change(&cx->prio, &id->prio, prio); | 336 | return v4l2_prio_change(&cx->prio, &id->prio, prio); |
359 | } | 337 | } |
360 | 338 | ||
@@ -363,8 +341,6 @@ static int cx18_querycap(struct file *file, void *fh, | |||
363 | { | 341 | { |
364 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 342 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
365 | 343 | ||
366 | CX18_DEBUG_IOCTL("VIDIOC_QUERYCAP\n"); | ||
367 | |||
368 | strlcpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver)); | 344 | strlcpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver)); |
369 | strlcpy(vcap->card, cx->card_name, sizeof(vcap->card)); | 345 | strlcpy(vcap->card, cx->card_name, sizeof(vcap->card)); |
370 | strlcpy(vcap->bus_info, pci_name(cx->dev), sizeof(vcap->bus_info)); | 346 | strlcpy(vcap->bus_info, pci_name(cx->dev), sizeof(vcap->bus_info)); |
@@ -377,8 +353,6 @@ static int cx18_enumaudio(struct file *file, void *fh, struct v4l2_audio *vin) | |||
377 | { | 353 | { |
378 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 354 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
379 | 355 | ||
380 | CX18_DEBUG_IOCTL("VIDIOC_ENUMAUDIO\n"); | ||
381 | |||
382 | return cx18_get_audio_input(cx, vin->index, vin); | 356 | return cx18_get_audio_input(cx, vin->index, vin); |
383 | } | 357 | } |
384 | 358 | ||
@@ -386,8 +360,6 @@ static int cx18_g_audio(struct file *file, void *fh, struct v4l2_audio *vin) | |||
386 | { | 360 | { |
387 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 361 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
388 | 362 | ||
389 | CX18_DEBUG_IOCTL("VIDIOC_G_AUDIO\n"); | ||
390 | |||
391 | vin->index = cx->audio_input; | 363 | vin->index = cx->audio_input; |
392 | return cx18_get_audio_input(cx, vin->index, vin); | 364 | return cx18_get_audio_input(cx, vin->index, vin); |
393 | } | 365 | } |
@@ -396,8 +368,6 @@ static int cx18_s_audio(struct file *file, void *fh, struct v4l2_audio *vout) | |||
396 | { | 368 | { |
397 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 369 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
398 | 370 | ||
399 | CX18_DEBUG_IOCTL("VIDIOC_S_AUDIO\n"); | ||
400 | |||
401 | if (vout->index >= cx->nof_audio_inputs) | 371 | if (vout->index >= cx->nof_audio_inputs) |
402 | return -EINVAL; | 372 | return -EINVAL; |
403 | cx->audio_input = vout->index; | 373 | cx->audio_input = vout->index; |
@@ -409,8 +379,6 @@ static int cx18_enum_input(struct file *file, void *fh, struct v4l2_input *vin) | |||
409 | { | 379 | { |
410 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 380 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
411 | 381 | ||
412 | CX18_DEBUG_IOCTL("VIDIOC_ENUMINPUT\n"); | ||
413 | |||
414 | /* set it to defaults from our table */ | 382 | /* set it to defaults from our table */ |
415 | return cx18_get_input(cx, vin->index, vin); | 383 | return cx18_get_input(cx, vin->index, vin); |
416 | } | 384 | } |
@@ -420,8 +388,6 @@ static int cx18_cropcap(struct file *file, void *fh, | |||
420 | { | 388 | { |
421 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 389 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
422 | 390 | ||
423 | CX18_DEBUG_IOCTL("VIDIOC_CROPCAP\n"); | ||
424 | |||
425 | if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 391 | if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
426 | return -EINVAL; | 392 | return -EINVAL; |
427 | cropcap->bounds.top = cropcap->bounds.left = 0; | 393 | cropcap->bounds.top = cropcap->bounds.left = 0; |
@@ -443,8 +409,6 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop) | |||
443 | if (ret) | 409 | if (ret) |
444 | return ret; | 410 | return ret; |
445 | 411 | ||
446 | CX18_DEBUG_IOCTL("VIDIOC_S_CROP\n"); | ||
447 | |||
448 | if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 412 | if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
449 | return -EINVAL; | 413 | return -EINVAL; |
450 | return cx18_av_cmd(cx, VIDIOC_S_CROP, crop); | 414 | return cx18_av_cmd(cx, VIDIOC_S_CROP, crop); |
@@ -454,8 +418,6 @@ static int cx18_g_crop(struct file *file, void *fh, struct v4l2_crop *crop) | |||
454 | { | 418 | { |
455 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 419 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
456 | 420 | ||
457 | CX18_DEBUG_IOCTL("VIDIOC_G_CROP\n"); | ||
458 | |||
459 | if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 421 | if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
460 | return -EINVAL; | 422 | return -EINVAL; |
461 | return cx18_av_cmd(cx, VIDIOC_G_CROP, crop); | 423 | return cx18_av_cmd(cx, VIDIOC_G_CROP, crop); |
@@ -473,10 +435,6 @@ static int cx18_enum_fmt_vid_cap(struct file *file, void *fh, | |||
473 | } | 435 | } |
474 | }; | 436 | }; |
475 | 437 | ||
476 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | ||
477 | |||
478 | CX18_DEBUG_IOCTL("VIDIOC_ENUM_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n"); | ||
479 | |||
480 | if (fmt->index > 1) | 438 | if (fmt->index > 1) |
481 | return -EINVAL; | 439 | return -EINVAL; |
482 | *fmt = formats[fmt->index]; | 440 | *fmt = formats[fmt->index]; |
@@ -487,8 +445,6 @@ static int cx18_g_input(struct file *file, void *fh, unsigned int *i) | |||
487 | { | 445 | { |
488 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 446 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
489 | 447 | ||
490 | CX18_DEBUG_IOCTL("VIDIOC_G_INPUT\n"); | ||
491 | |||
492 | *i = cx->active_input; | 448 | *i = cx->active_input; |
493 | return 0; | 449 | return 0; |
494 | } | 450 | } |
@@ -503,8 +459,6 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp) | |||
503 | if (ret) | 459 | if (ret) |
504 | return ret; | 460 | return ret; |
505 | 461 | ||
506 | CX18_DEBUG_IOCTL("VIDIOC_S_INPUT\n"); | ||
507 | |||
508 | if (inp < 0 || inp >= cx->nof_inputs) | 462 | if (inp < 0 || inp >= cx->nof_inputs) |
509 | return -EINVAL; | 463 | return -EINVAL; |
510 | 464 | ||
@@ -534,8 +488,6 @@ static int cx18_g_frequency(struct file *file, void *fh, | |||
534 | { | 488 | { |
535 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 489 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
536 | 490 | ||
537 | CX18_DEBUG_IOCTL("VIDIOC_G_FREQUENCY\n"); | ||
538 | |||
539 | if (vf->tuner != 0) | 491 | if (vf->tuner != 0) |
540 | return -EINVAL; | 492 | return -EINVAL; |
541 | 493 | ||
@@ -553,8 +505,6 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf) | |||
553 | if (ret) | 505 | if (ret) |
554 | return ret; | 506 | return ret; |
555 | 507 | ||
556 | CX18_DEBUG_IOCTL("VIDIOC_S_FREQUENCY\n"); | ||
557 | |||
558 | if (vf->tuner != 0) | 508 | if (vf->tuner != 0) |
559 | return -EINVAL; | 509 | return -EINVAL; |
560 | 510 | ||
@@ -569,8 +519,6 @@ static int cx18_g_std(struct file *file, void *fh, v4l2_std_id *std) | |||
569 | { | 519 | { |
570 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 520 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
571 | 521 | ||
572 | CX18_DEBUG_IOCTL("VIDIOC_G_STD\n"); | ||
573 | |||
574 | *std = cx->std; | 522 | *std = cx->std; |
575 | return 0; | 523 | return 0; |
576 | } | 524 | } |
@@ -585,8 +533,6 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std) | |||
585 | if (ret) | 533 | if (ret) |
586 | return ret; | 534 | return ret; |
587 | 535 | ||
588 | CX18_DEBUG_IOCTL("VIDIOC_S_STD\n"); | ||
589 | |||
590 | if ((*std & V4L2_STD_ALL) == 0) | 536 | if ((*std & V4L2_STD_ALL) == 0) |
591 | return -EINVAL; | 537 | return -EINVAL; |
592 | 538 | ||
@@ -628,8 +574,6 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) | |||
628 | if (ret) | 574 | if (ret) |
629 | return ret; | 575 | return ret; |
630 | 576 | ||
631 | CX18_DEBUG_IOCTL("VIDIOC_S_TUNER\n"); | ||
632 | |||
633 | if (vt->index != 0) | 577 | if (vt->index != 0) |
634 | return -EINVAL; | 578 | return -EINVAL; |
635 | 579 | ||
@@ -643,8 +587,6 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) | |||
643 | { | 587 | { |
644 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 588 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
645 | 589 | ||
646 | CX18_DEBUG_IOCTL("VIDIOC_G_TUNER\n"); | ||
647 | |||
648 | if (vt->index != 0) | 590 | if (vt->index != 0) |
649 | return -EINVAL; | 591 | return -EINVAL; |
650 | 592 | ||
@@ -679,8 +621,6 @@ static int cx18_encoder_cmd(struct file *file, void *fh, | |||
679 | struct cx18_open_id *id = fh; | 621 | struct cx18_open_id *id = fh; |
680 | struct cx18 *cx = id->cx; | 622 | struct cx18 *cx = id->cx; |
681 | 623 | ||
682 | CX18_DEBUG_IOCTL("VIDIOC_ENCODER_CMD:\n"); | ||
683 | |||
684 | switch (enc->cmd) { | 624 | switch (enc->cmd) { |
685 | case V4L2_ENC_CMD_START: | 625 | case V4L2_ENC_CMD_START: |
686 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); | 626 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); |
@@ -728,8 +668,6 @@ static int cx18_try_encoder_cmd(struct file *file, void *fh, | |||
728 | { | 668 | { |
729 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | 669 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; |
730 | 670 | ||
731 | CX18_DEBUG_IOCTL("VIDIOC_TRY_ENCDOER_CMD:\n"); | ||
732 | |||
733 | switch (enc->cmd) { | 671 | switch (enc->cmd) { |
734 | case V4L2_ENC_CMD_START: | 672 | case V4L2_ENC_CMD_START: |
735 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); | 673 | CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n"); |
@@ -765,7 +703,6 @@ static int cx18_log_status(struct file *file, void *fh) | |||
765 | struct v4l2_audio audin; | 703 | struct v4l2_audio audin; |
766 | int i; | 704 | int i; |
767 | 705 | ||
768 | CX18_DEBUG_IOCTL("VIDIOC_LOG_STATUS\n"); | ||
769 | CX18_INFO("================= START STATUS CARD #%d =================\n", cx->num); | 706 | CX18_INFO("================= START STATUS CARD #%d =================\n", cx->num); |
770 | if (cx->hw_flags & CX18_HW_TVEEPROM) { | 707 | if (cx->hw_flags & CX18_HW_TVEEPROM) { |
771 | struct tveeprom tv; | 708 | struct tveeprom tv; |
@@ -807,26 +744,13 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg) | |||
807 | switch (cmd) { | 744 | switch (cmd) { |
808 | case VIDIOC_INT_S_AUDIO_ROUTING: { | 745 | case VIDIOC_INT_S_AUDIO_ROUTING: { |
809 | struct v4l2_routing *route = arg; | 746 | struct v4l2_routing *route = arg; |
810 | CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING (%d, %d)\n", | 747 | |
811 | route->input, route->output); | 748 | CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING(%d, %d)\n", |
749 | route->input, route->output); | ||
812 | cx18_audio_set_route(cx, route); | 750 | cx18_audio_set_route(cx, route); |
813 | break; | 751 | break; |
814 | } | 752 | } |
815 | case VIDIOC_INT_RESET: { | ||
816 | u32 val = *(u32 *)arg; | ||
817 | CX18_DEBUG_IOCTL("VIDIOC_INT_RESET (%#10x)\n", val); | ||
818 | /* No op right now */ | ||
819 | /* cx18_av_cmd(cx, cmd, arg) */ | ||
820 | /* cx18_call_i2c_clients(cx, cmd, arg) */ | ||
821 | break; | ||
822 | } | ||
823 | default: | 753 | default: |
824 | if (cx18_debug & CX18_DBGFLG_IOCTL) { | ||
825 | printk(KERN_INFO "cx18%d ioctl: unsupported cmd: ", | ||
826 | cx->num); | ||
827 | v4l_printk_ioctl(cmd); | ||
828 | printk("\n"); | ||
829 | } | ||
830 | return -EINVAL; | 754 | return -EINVAL; |
831 | } | 755 | } |
832 | return 0; | 756 | return 0; |
@@ -835,12 +759,17 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg) | |||
835 | int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 759 | int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, |
836 | unsigned long arg) | 760 | unsigned long arg) |
837 | { | 761 | { |
762 | struct video_device *vfd = video_devdata(filp); | ||
838 | struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data; | 763 | struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data; |
839 | struct cx18 *cx = id->cx; | 764 | struct cx18 *cx = id->cx; |
840 | int res; | 765 | int res; |
841 | 766 | ||
842 | mutex_lock(&cx->serialize_lock); | 767 | mutex_lock(&cx->serialize_lock); |
768 | |||
769 | if (cx18_debug & CX18_DBGFLG_IOCTL) | ||
770 | vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; | ||
843 | res = video_ioctl2(inode, filp, cmd, arg); | 771 | res = video_ioctl2(inode, filp, cmd, arg); |
772 | vfd->debug = 0; | ||
844 | mutex_unlock(&cx->serialize_lock); | 773 | mutex_unlock(&cx->serialize_lock); |
845 | return res; | 774 | return res; |
846 | } | 775 | } |
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c index 805847370cba..f3d20509a8bd 100644 --- a/drivers/media/video/cx18/cx18-streams.c +++ b/drivers/media/video/cx18/cx18-streams.c | |||
@@ -190,8 +190,8 @@ static int cx18_prep_dev(struct cx18 *cx, int type) | |||
190 | s->v4l2dev->type = | 190 | s->v4l2dev->type = |
191 | VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT | | 191 | VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT | |
192 | VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER; | 192 | VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER; |
193 | snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18%d %s", | 193 | snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18-%d", |
194 | cx->num, s->name); | 194 | cx->num); |
195 | 195 | ||
196 | s->v4l2dev->minor = minor; | 196 | s->v4l2dev->minor = minor; |
197 | s->v4l2dev->dev = &cx->dev->dev; | 197 | s->v4l2dev->dev = &cx->dev->dev; |