From bccfa449ae5bd4cc5b52160d25fbdb1fe8a27932 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 30 Mar 2009 06:55:27 -0300 Subject: V4L/DVB (11311): v4l: replace 'ioctl' references in v4l i2c drivers Replace 'VIDIOC_' references in v4l i2c drivers by their new v4l2_subdev callback names. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ks0127.c | 23 ++++++++++++----------- drivers/media/video/saa7115.c | 4 ++-- drivers/media/video/tuner-core.c | 17 +++++++---------- drivers/media/video/tvp5150.c | 8 ++++---- drivers/media/video/vpx3220.c | 8 ++++---- 5 files changed, 29 insertions(+), 31 deletions(-) (limited to 'drivers') diff --git a/drivers/media/video/ks0127.c b/drivers/media/video/ks0127.c index 4b3a116f2f59..841024b6bcdf 100644 --- a/drivers/media/video/ks0127.c +++ b/drivers/media/video/ks0127.c @@ -421,7 +421,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r case KS_INPUT_COMPOSITE_5: case KS_INPUT_COMPOSITE_6: v4l2_dbg(1, debug, sd, - "VIDIOC_S_INPUT %d: Composite\n", route->input); + "s_routing %d: Composite\n", route->input); /* autodetect 50/60 Hz */ ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00); /* VSE=0 */ @@ -455,7 +455,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r case KS_INPUT_SVIDEO_2: case KS_INPUT_SVIDEO_3: v4l2_dbg(1, debug, sd, - "VIDIOC_S_INPUT %d: S-Video\n", route->input); + "s_routing %d: S-Video\n", route->input); /* autodetect 50/60 Hz */ ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00); /* VSE=0 */ @@ -486,7 +486,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r break; case KS_INPUT_YUV656: - v4l2_dbg(1, debug, sd, "VIDIOC_S_INPUT 15: YUV656\n"); + v4l2_dbg(1, debug, sd, "s_routing 15: YUV656\n"); if (ks->norm & V4L2_STD_525_60) /* force 60 Hz */ ks0127_and_or(sd, KS_CMDA, 0xfc, 0x03); @@ -531,7 +531,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r default: v4l2_dbg(1, debug, sd, - "VIDIOC_INT_S_VIDEO_ROUTING: Unknown input %d\n", route->input); + "s_routing: Unknown input %d\n", route->input); break; } @@ -551,23 +551,23 @@ static int ks0127_s_std(struct v4l2_subdev *sd, v4l2_std_id std) ks->norm = std; if (std & V4L2_STD_NTSC) { v4l2_dbg(1, debug, sd, - "VIDIOC_S_STD: NTSC_M\n"); + "s_std: NTSC_M\n"); ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20); } else if (std & V4L2_STD_PAL_N) { v4l2_dbg(1, debug, sd, - "KS0127_SET_NORM: NTSC_N (fixme)\n"); + "s_std: NTSC_N (fixme)\n"); ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40); } else if (std & V4L2_STD_PAL) { v4l2_dbg(1, debug, sd, - "VIDIOC_S_STD: PAL_N\n"); + "s_std: PAL_N\n"); ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20); } else if (std & V4L2_STD_PAL_M) { v4l2_dbg(1, debug, sd, - "KS0127_SET_NORM: PAL_M (fixme)\n"); + "s_std: PAL_M (fixme)\n"); ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40); } else if (std & V4L2_STD_SECAM) { v4l2_dbg(1, debug, sd, - "KS0127_SET_NORM: SECAM\n"); + "s_std: SECAM\n"); /* set to secam autodetection */ ks0127_and_or(sd, KS_CHROMA, 0xdf, 0x20); @@ -579,7 +579,7 @@ static int ks0127_s_std(struct v4l2_subdev *sd, v4l2_std_id std) /* force to secam mode */ ks0127_and_or(sd, KS_DEMOD, 0xf0, 0x0f); } else { - v4l2_dbg(1, debug, sd, "VIDIOC_S_STD: Unknown norm %llx\n", + v4l2_dbg(1, debug, sd, "s_std: Unknown norm %llx\n", (unsigned long long)std); } return 0; @@ -608,7 +608,6 @@ static int ks0127_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd u8 status; v4l2_std_id std = V4L2_STD_ALL; - v4l2_dbg(1, debug, sd, "VIDIOC_QUERYSTD/VIDIOC_INT_G_INPUT_STATUS\n"); status = ks0127_read(sd, KS_STAT); if (!(status & 0x20)) /* NOVID not set */ stat = 0; @@ -627,11 +626,13 @@ static int ks0127_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd static int ks0127_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) { + v4l2_dbg(1, debug, sd, "querystd\n"); return ks0127_status(sd, NULL, std); } static int ks0127_g_input_status(struct v4l2_subdev *sd, u32 *status) { + v4l2_dbg(1, debug, sd, "g_input_status\n"); return ks0127_status(sd, status, NULL); } diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 591f7f98aa33..cebf159f52cf 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -931,8 +931,8 @@ static void saa711x_set_v4lstd(struct v4l2_subdev *sd, v4l2_std_id std) /* Prevent unnecessary standard changes. During a standard change the I-Port is temporarily disabled. Any devices reading from that port can get confused. - Note that VIDIOC_S_STD is also used to switch from - radio to TV mode, so if a VIDIOC_S_STD is broadcast to + Note that s_std is also used to switch from + radio to TV mode, so if a s_std is broadcast to all I2C devices then you do not want to have an unwanted side-effect here. */ if (std == state->std) diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 421475e0ea59..bbf1f488a164 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -778,8 +778,7 @@ static int tuner_s_radio(struct v4l2_subdev *sd) struct tuner *t = to_tuner(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - if (set_mode(client, t, V4L2_TUNER_RADIO, "AUDC_SET_RADIO") - == -EINVAL) + if (set_mode(client, t, V4L2_TUNER_RADIO, "s_radio") == -EINVAL) return 0; if (t->radio_freq) set_freq(client, t->radio_freq); @@ -793,7 +792,7 @@ static int tuner_s_standby(struct v4l2_subdev *sd, u32 standby) tuner_dbg("Putting tuner to sleep\n"); - if (check_mode(t, "TUNER_SET_STANDBY") == -EINVAL) + if (check_mode(t, "s_standby") == -EINVAL) return 0; t->mode = T_STANDBY; if (analog_ops->standby) @@ -952,8 +951,7 @@ static int tuner_s_std(struct v4l2_subdev *sd, v4l2_std_id std) struct tuner *t = to_tuner(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - if (set_mode(client, t, V4L2_TUNER_ANALOG_TV, "VIDIOC_S_STD") - == -EINVAL) + if (set_mode(client, t, V4L2_TUNER_ANALOG_TV, "s_std") == -EINVAL) return 0; switch_v4l2(); @@ -970,8 +968,7 @@ static int tuner_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) struct tuner *t = to_tuner(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - if (set_mode(client, t, f->type, "VIDIOC_S_FREQUENCY") - == -EINVAL) + if (set_mode(client, t, f->type, "s_frequency") == -EINVAL) return 0; switch_v4l2(); set_freq(client, f->frequency); @@ -984,7 +981,7 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) struct tuner *t = to_tuner(sd); struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; - if (check_mode(t, "VIDIOC_G_FREQUENCY") == -EINVAL) + if (check_mode(t, "g_frequency") == -EINVAL) return 0; switch_v4l2(); f->type = t->mode; @@ -1008,7 +1005,7 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; - if (check_mode(t, "VIDIOC_G_TUNER") == -EINVAL) + if (check_mode(t, "g_tuner") == -EINVAL) return 0; switch_v4l2(); @@ -1057,7 +1054,7 @@ static int tuner_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) struct tuner *t = to_tuner(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - if (check_mode(t, "VIDIOC_S_TUNER") == -EINVAL) + if (check_mode(t, "s_tuner") == -EINVAL) return 0; switch_v4l2(); diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 9ee55f26c4f9..3a5a95f134b4 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -631,7 +631,7 @@ static int tvp5150_g_sliced_vbi_cap(struct v4l2_subdev *sd, const struct i2c_vbi_ram_value *regs = vbi_ram_default; int line; - v4l2_dbg(1, debug, sd, "VIDIOC_G_SLICED_VBI_CAP\n"); + v4l2_dbg(1, debug, sd, "g_sliced_vbi_cap\n"); memset(cap, 0, sizeof *cap); while (regs->reg != (u16)-1 ) { @@ -830,7 +830,7 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val) static int tvp5150_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) { - v4l2_dbg(1, debug, sd, "VIDIOC_G_CTRL called\n"); + v4l2_dbg(1, debug, sd, "g_ctrl called\n"); switch (ctrl->id) { case V4L2_CID_BRIGHTNESS: @@ -860,7 +860,7 @@ static int tvp5150_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) if (ctrl->value < tvp5150_qctrl[i].minimum || ctrl->value > tvp5150_qctrl[i].maximum) return -ERANGE; - v4l2_dbg(1, debug, sd, "VIDIOC_S_CTRL: id=%d, value=%d\n", + v4l2_dbg(1, debug, sd, "s_ctrl: id=%d, value=%d\n", ctrl->id, ctrl->value); break; } @@ -1014,7 +1014,7 @@ static int tvp5150_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc) { int i; - v4l2_dbg(1, debug, sd, "VIDIOC_QUERYCTRL called\n"); + v4l2_dbg(1, debug, sd, "queryctrl called\n"); for (i = 0; i < ARRAY_SIZE(tvp5150_qctrl); i++) if (qc->id && qc->id == tvp5150_qctrl[i].id) { diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c index 0cc23539f74d..2fa7e8bb5746 100644 --- a/drivers/media/video/vpx3220.c +++ b/drivers/media/video/vpx3220.c @@ -296,8 +296,6 @@ static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pst int res = V4L2_IN_ST_NO_SIGNAL, status; v4l2_std_id std = 0; - v4l2_dbg(1, debug, sd, "VIDIOC_QUERYSTD/VIDIOC_INT_G_INPUT_STATUS\n"); - status = vpx3220_fp_read(sd, 0x0f3); v4l2_dbg(1, debug, sd, "status: 0x%04x\n", status); @@ -336,11 +334,13 @@ static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pst static int vpx3220_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) { + v4l2_dbg(1, debug, sd, "querystd\n"); return vpx3220_status(sd, NULL, std); } static int vpx3220_g_input_status(struct v4l2_subdev *sd, u32 *status) { + v4l2_dbg(1, debug, sd, "g_input_status\n"); return vpx3220_status(sd, status, NULL); } @@ -354,7 +354,7 @@ static int vpx3220_s_std(struct v4l2_subdev *sd, v4l2_std_id std) choosen video norm */ temp_input = vpx3220_fp_read(sd, 0xf2); - v4l2_dbg(1, debug, sd, "VIDIOC_S_STD %llx\n", (unsigned long long)std); + v4l2_dbg(1, debug, sd, "s_std %llx\n", (unsigned long long)std); if (std & V4L2_STD_NTSC) { vpx3220_write_fp_block(sd, init_ntsc, sizeof(init_ntsc) >> 1); v4l2_dbg(1, debug, sd, "norm switched to NTSC\n"); @@ -410,7 +410,7 @@ static int vpx3220_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing * static int vpx3220_s_stream(struct v4l2_subdev *sd, int enable) { - v4l2_dbg(1, debug, sd, "VIDIOC_STREAM%s\n", enable ? "ON" : "OFF"); + v4l2_dbg(1, debug, sd, "s_stream %s\n", enable ? "on" : "off"); vpx3220_write(sd, 0xf2, (enable ? 0x1b : 0x00)); return 0; -- cgit v1.2.3-59-g8ed1b