summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r--linux/drivers/media/video/cx18/cx18-ioctl.c97
1 files changed, 8 insertions, 89 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-ioctl.c b/linux/drivers/media/video/cx18/cx18-ioctl.c
index 90712f4cd..078f3cd7d 100644
--- a/linux/drivers/media/video/cx18/cx18-ioctl.c
+++ b/linux/drivers/media/video/cx18/cx18-ioctl.c
@@ -180,8 +180,6 @@ static int cx18_g_fmt_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_vbi_format *vbifmt = &fmt->fmt.vbi;
- CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
vbifmt->sampling_rate = 27000000;
vbifmt->offset = 248;
vbifmt->samples_per_line = cx->vbi.raw_decoder_line_size - 4;
@@ -203,8 +201,6 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
- CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_SLICED_VBI_CAPTURE\n");
-
vbifmt->reserved[0] = 0;
vbifmt->reserved[1] = 0;
vbifmt->io_size = sizeof(struct v4l2_sliced_vbi_data) * 36;
@@ -227,8 +223,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh,
int w = fmt->fmt.pix.width;
int h = fmt->fmt.pix.height;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
w = min(w, 720);
w = max(w, 1);
h = min(h, cx->is_50hz ? 576 : 480);
@@ -242,10 +236,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh,
static int cx18_try_fmt_vbi_cap(struct file *file, void *fh,
struct v4l2_format *fmt)
{
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
-
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
return cx18_g_fmt_vbi_cap(file, fh, fmt);
}
@@ -257,8 +247,6 @@ static int cx18_try_fmt_sliced_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_SLICED_VBI_CAPTURE\n");
-
vbifmt->io_size = sizeof(struct v4l2_sliced_vbi_data) * 36;
vbifmt->reserved[0] = 0;
vbifmt->reserved[1] = 0;
@@ -286,8 +274,6 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
ret = cx18_try_fmt_vid_cap(file, fh, fmt);
if (ret)
return ret;
@@ -315,8 +301,6 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
if (id->type == CX18_ENC_STREAM_TYPE_VBI &&
cx->vbi.sliced_in->service_set &&
atomic_read(&cx->ana_capturing) > 0)
@@ -341,8 +325,6 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_SLICED_VBI_CAPTURE\n");
-
ret = cx18_try_fmt_sliced_vbi_cap(file, fh, fmt);
if (ret)
return ret;
@@ -366,8 +348,6 @@ static int cx18_g_chip_ident(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CHIP_IDENT\n");
-
chip->ident = V4L2_IDENT_NONE;
chip->revision = 0;
if (chip->match_type == V4L2_CHIP_MATCH_HOST) {
@@ -389,8 +369,6 @@ static int cx18_g_register(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_DBG_G_REGISTER\n");
-
if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg);
if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
@@ -405,8 +383,6 @@ static int cx18_s_register(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_DBG_S_REGISTER\n");
-
if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg);
if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
@@ -420,8 +396,6 @@ static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_PRIORITY\n");
-
*p = v4l2_prio_max(&cx->prio);
return 0;
}
@@ -431,8 +405,6 @@ static int cx18_s_priority(struct file *file, void *fh, enum v4l2_priority prio)
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
- CX18_DEBUG_IOCTL("VIDIOC_S_PRIORITY\n");
-
return v4l2_prio_change(&cx->prio, &id->prio, prio);
}
@@ -441,8 +413,6 @@ static int cx18_querycap(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_QUERYCAP\n");
-
strlcpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver));
strlcpy(vcap->card, cx->card_name, sizeof(vcap->card));
strlcpy(vcap->bus_info, pci_name(cx->dev), sizeof(vcap->bus_info));
@@ -455,8 +425,6 @@ static int cx18_enumaudio(struct file *file, void *fh, struct v4l2_audio *vin)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENUMAUDIO\n");
-
return cx18_get_audio_input(cx, vin->index, vin);
}
@@ -464,8 +432,6 @@ static int cx18_g_audio(struct file *file, void *fh, struct v4l2_audio *vin)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_AUDIO\n");
-
vin->index = cx->audio_input;
return cx18_get_audio_input(cx, vin->index, vin);
}
@@ -474,8 +440,6 @@ static int cx18_s_audio(struct file *file, void *fh, struct v4l2_audio *vout)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_S_AUDIO\n");
-
if (vout->index >= cx->nof_audio_inputs)
return -EINVAL;
cx->audio_input = vout->index;
@@ -487,8 +451,6 @@ static int cx18_enum_input(struct file *file, void *fh, struct v4l2_input *vin)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENUMINPUT\n");
-
/* set it to defaults from our table */
return cx18_get_input(cx, vin->index, vin);
}
@@ -498,8 +460,6 @@ static int cx18_cropcap(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_CROPCAP\n");
-
if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
cropcap->bounds.top = cropcap->bounds.left = 0;
@@ -521,8 +481,6 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_CROP\n");
-
if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
return cx18_av_cmd(cx, VIDIOC_S_CROP, crop);
@@ -532,8 +490,6 @@ static int cx18_g_crop(struct file *file, void *fh, struct v4l2_crop *crop)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CROP\n");
-
if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
return cx18_av_cmd(cx, VIDIOC_G_CROP, crop);
@@ -551,10 +507,6 @@ static int cx18_enum_fmt_vid_cap(struct file *file, void *fh,
}
};
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
-
- CX18_DEBUG_IOCTL("VIDIOC_ENUM_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
if (fmt->index > 1)
return -EINVAL;
*fmt = formats[fmt->index];
@@ -565,8 +517,6 @@ static int cx18_g_input(struct file *file, void *fh, unsigned int *i)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_INPUT\n");
-
*i = cx->active_input;
return 0;
}
@@ -581,8 +531,6 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_INPUT\n");
-
if (inp < 0 || inp >= cx->nof_inputs)
return -EINVAL;
@@ -612,8 +560,6 @@ static int cx18_g_frequency(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_FREQUENCY\n");
-
if (vf->tuner != 0)
return -EINVAL;
@@ -631,8 +577,6 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FREQUENCY\n");
-
if (vf->tuner != 0)
return -EINVAL;
@@ -647,8 +591,6 @@ static int cx18_g_std(struct file *file, void *fh, v4l2_std_id *std)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_STD\n");
-
*std = cx->std;
return 0;
}
@@ -663,8 +605,6 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_STD\n");
-
if ((*std & V4L2_STD_ALL) == 0)
return -EINVAL;
@@ -706,8 +646,6 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_TUNER\n");
-
if (vt->index != 0)
return -EINVAL;
@@ -721,8 +659,6 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_TUNER\n");
-
if (vt->index != 0)
return -EINVAL;
@@ -748,8 +684,6 @@ static int cx18_g_sliced_vbi_cap(struct file *file, void *fh,
int set = cx->is_50hz ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525;
int f, l;
- CX18_DEBUG_IOCTL("VIDIOC_G_SLICED_VBI_CAP\n");
-
if (cap->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) {
for (f = 0; f < 2; f++) {
for (l = 0; l < 24; l++) {
@@ -771,8 +705,6 @@ static int cx18_g_enc_index(struct file *file, void *fh,
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
int i;
- CX18_DEBUG_IOCTL("VIDIOC_G_ENC_INDEX\n");
-
idx->entries = (cx->pgm_info_write_idx + CX18_MAX_PGM_INDEX
- cx->pgm_info_read_idx) % CX18_MAX_PGM_INDEX;
if (idx->entries > V4L2_ENC_IDX_ENTRIES)
@@ -794,8 +726,6 @@ static int cx18_encoder_cmd(struct file *file, void *fh,
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENCODER_CMD:\n");
-
switch (enc->cmd) {
case V4L2_ENC_CMD_START:
CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n");
@@ -843,8 +773,6 @@ static int cx18_try_encoder_cmd(struct file *file, void *fh,
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_ENCDOER_CMD:\n");
-
switch (enc->cmd) {
case V4L2_ENC_CMD_START:
CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n");
@@ -880,7 +808,6 @@ static int cx18_log_status(struct file *file, void *fh)
struct v4l2_audio audin;
int i;
- CX18_DEBUG_IOCTL("VIDIOC_LOG_STATUS\n");
CX18_INFO("================= START STATUS CARD #%d =================\n", cx->num);
if (cx->hw_flags & CX18_HW_TVEEPROM) {
struct tveeprom tv;
@@ -922,26 +849,13 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
switch (cmd) {
case VIDIOC_INT_S_AUDIO_ROUTING: {
struct v4l2_routing *route = arg;
- CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING (%d, %d)\n",
- route->input, route->output);
+
+ CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING(%d, %d)\n",
+ route->input, route->output);
cx18_audio_set_route(cx, route);
break;
}
- case VIDIOC_INT_RESET: {
- u32 val = *(u32 *)arg;
- CX18_DEBUG_IOCTL("VIDIOC_INT_RESET (%#10x)\n", val);
- /* No op right now */
- /* cx18_av_cmd(cx, cmd, arg) */
- /* cx18_call_i2c_clients(cx, cmd, arg) */
- break;
- }
default:
- if (cx18_debug & CX18_DBGFLG_IOCTL) {
- printk(KERN_INFO "cx18%d ioctl: unsupported cmd: ",
- cx->num);
- v4l_printk_ioctl(cmd);
- printk("\n");
- }
return -EINVAL;
}
return 0;
@@ -950,12 +864,17 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
+ struct video_device *vfd = video_devdata(filp);
struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data;
struct cx18 *cx = id->cx;
int res;
mutex_lock(&cx->serialize_lock);
+
+ if (cx18_debug & CX18_DBGFLG_IOCTL)
+ vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
res = video_ioctl2(inode, filp, cmd, arg);
+ vfd->debug = 0;
mutex_unlock(&cx->serialize_lock);
return res;
}