aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-03-30 05:55:27 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:49 -0400
commitbccfa449ae5bd4cc5b52160d25fbdb1fe8a27932 (patch)
tree09ca059a87351bb1e68843557173bb2f13da8505 /drivers/media/video
parent41c129a87014bb83efb3e0224bb44cfc54659f8f (diff)
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 <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/ks0127.c23
-rw-r--r--drivers/media/video/saa7115.c4
-rw-r--r--drivers/media/video/tuner-core.c17
-rw-r--r--drivers/media/video/tvp5150.c8
-rw-r--r--drivers/media/video/vpx3220.c8
5 files changed, 29 insertions, 31 deletions
diff --git a/drivers/media/video/ks0127.c b/drivers/media/video/ks0127.c
index 4b3a116f2f5..841024b6bcd 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
421 case KS_INPUT_COMPOSITE_5: 421 case KS_INPUT_COMPOSITE_5:
422 case KS_INPUT_COMPOSITE_6: 422 case KS_INPUT_COMPOSITE_6:
423 v4l2_dbg(1, debug, sd, 423 v4l2_dbg(1, debug, sd,
424 "VIDIOC_S_INPUT %d: Composite\n", route->input); 424 "s_routing %d: Composite\n", route->input);
425 /* autodetect 50/60 Hz */ 425 /* autodetect 50/60 Hz */
426 ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00); 426 ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00);
427 /* VSE=0 */ 427 /* VSE=0 */
@@ -455,7 +455,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
455 case KS_INPUT_SVIDEO_2: 455 case KS_INPUT_SVIDEO_2:
456 case KS_INPUT_SVIDEO_3: 456 case KS_INPUT_SVIDEO_3:
457 v4l2_dbg(1, debug, sd, 457 v4l2_dbg(1, debug, sd,
458 "VIDIOC_S_INPUT %d: S-Video\n", route->input); 458 "s_routing %d: S-Video\n", route->input);
459 /* autodetect 50/60 Hz */ 459 /* autodetect 50/60 Hz */
460 ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00); 460 ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00);
461 /* VSE=0 */ 461 /* VSE=0 */
@@ -486,7 +486,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
486 break; 486 break;
487 487
488 case KS_INPUT_YUV656: 488 case KS_INPUT_YUV656:
489 v4l2_dbg(1, debug, sd, "VIDIOC_S_INPUT 15: YUV656\n"); 489 v4l2_dbg(1, debug, sd, "s_routing 15: YUV656\n");
490 if (ks->norm & V4L2_STD_525_60) 490 if (ks->norm & V4L2_STD_525_60)
491 /* force 60 Hz */ 491 /* force 60 Hz */
492 ks0127_and_or(sd, KS_CMDA, 0xfc, 0x03); 492 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
531 531
532 default: 532 default:
533 v4l2_dbg(1, debug, sd, 533 v4l2_dbg(1, debug, sd,
534 "VIDIOC_INT_S_VIDEO_ROUTING: Unknown input %d\n", route->input); 534 "s_routing: Unknown input %d\n", route->input);
535 break; 535 break;
536 } 536 }
537 537
@@ -551,23 +551,23 @@ static int ks0127_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
551 ks->norm = std; 551 ks->norm = std;
552 if (std & V4L2_STD_NTSC) { 552 if (std & V4L2_STD_NTSC) {
553 v4l2_dbg(1, debug, sd, 553 v4l2_dbg(1, debug, sd,
554 "VIDIOC_S_STD: NTSC_M\n"); 554 "s_std: NTSC_M\n");
555 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20); 555 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20);
556 } else if (std & V4L2_STD_PAL_N) { 556 } else if (std & V4L2_STD_PAL_N) {
557 v4l2_dbg(1, debug, sd, 557 v4l2_dbg(1, debug, sd,
558 "KS0127_SET_NORM: NTSC_N (fixme)\n"); 558 "s_std: NTSC_N (fixme)\n");
559 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40); 559 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40);
560 } else if (std & V4L2_STD_PAL) { 560 } else if (std & V4L2_STD_PAL) {
561 v4l2_dbg(1, debug, sd, 561 v4l2_dbg(1, debug, sd,
562 "VIDIOC_S_STD: PAL_N\n"); 562 "s_std: PAL_N\n");
563 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20); 563 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20);
564 } else if (std & V4L2_STD_PAL_M) { 564 } else if (std & V4L2_STD_PAL_M) {
565 v4l2_dbg(1, debug, sd, 565 v4l2_dbg(1, debug, sd,
566 "KS0127_SET_NORM: PAL_M (fixme)\n"); 566 "s_std: PAL_M (fixme)\n");
567 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40); 567 ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40);
568 } else if (std & V4L2_STD_SECAM) { 568 } else if (std & V4L2_STD_SECAM) {
569 v4l2_dbg(1, debug, sd, 569 v4l2_dbg(1, debug, sd,
570 "KS0127_SET_NORM: SECAM\n"); 570 "s_std: SECAM\n");
571 571
572 /* set to secam autodetection */ 572 /* set to secam autodetection */
573 ks0127_and_or(sd, KS_CHROMA, 0xdf, 0x20); 573 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)
579 /* force to secam mode */ 579 /* force to secam mode */
580 ks0127_and_or(sd, KS_DEMOD, 0xf0, 0x0f); 580 ks0127_and_or(sd, KS_DEMOD, 0xf0, 0x0f);
581 } else { 581 } else {
582 v4l2_dbg(1, debug, sd, "VIDIOC_S_STD: Unknown norm %llx\n", 582 v4l2_dbg(1, debug, sd, "s_std: Unknown norm %llx\n",
583 (unsigned long long)std); 583 (unsigned long long)std);
584 } 584 }
585 return 0; 585 return 0;
@@ -608,7 +608,6 @@ static int ks0127_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd
608 u8 status; 608 u8 status;
609 v4l2_std_id std = V4L2_STD_ALL; 609 v4l2_std_id std = V4L2_STD_ALL;
610 610
611 v4l2_dbg(1, debug, sd, "VIDIOC_QUERYSTD/VIDIOC_INT_G_INPUT_STATUS\n");
612 status = ks0127_read(sd, KS_STAT); 611 status = ks0127_read(sd, KS_STAT);
613 if (!(status & 0x20)) /* NOVID not set */ 612 if (!(status & 0x20)) /* NOVID not set */
614 stat = 0; 613 stat = 0;
@@ -627,11 +626,13 @@ static int ks0127_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd
627 626
628static int ks0127_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) 627static int ks0127_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
629{ 628{
629 v4l2_dbg(1, debug, sd, "querystd\n");
630 return ks0127_status(sd, NULL, std); 630 return ks0127_status(sd, NULL, std);
631} 631}
632 632
633static int ks0127_g_input_status(struct v4l2_subdev *sd, u32 *status) 633static int ks0127_g_input_status(struct v4l2_subdev *sd, u32 *status)
634{ 634{
635 v4l2_dbg(1, debug, sd, "g_input_status\n");
635 return ks0127_status(sd, status, NULL); 636 return ks0127_status(sd, status, NULL);
636} 637}
637 638
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 591f7f98aa3..cebf159f52c 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)
931 /* Prevent unnecessary standard changes. During a standard 931 /* Prevent unnecessary standard changes. During a standard
932 change the I-Port is temporarily disabled. Any devices 932 change the I-Port is temporarily disabled. Any devices
933 reading from that port can get confused. 933 reading from that port can get confused.
934 Note that VIDIOC_S_STD is also used to switch from 934 Note that s_std is also used to switch from
935 radio to TV mode, so if a VIDIOC_S_STD is broadcast to 935 radio to TV mode, so if a s_std is broadcast to
936 all I2C devices then you do not want to have an unwanted 936 all I2C devices then you do not want to have an unwanted
937 side-effect here. */ 937 side-effect here. */
938 if (std == state->std) 938 if (std == state->std)
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 421475e0ea5..bbf1f488a16 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)
778 struct tuner *t = to_tuner(sd); 778 struct tuner *t = to_tuner(sd);
779 struct i2c_client *client = v4l2_get_subdevdata(sd); 779 struct i2c_client *client = v4l2_get_subdevdata(sd);
780 780
781 if (set_mode(client, t, V4L2_TUNER_RADIO, "AUDC_SET_RADIO") 781 if (set_mode(client, t, V4L2_TUNER_RADIO, "s_radio") == -EINVAL)
782 == -EINVAL)
783 return 0; 782 return 0;
784 if (t->radio_freq) 783 if (t->radio_freq)
785 set_freq(client, t->radio_freq); 784 set_freq(client, t->radio_freq);
@@ -793,7 +792,7 @@ static int tuner_s_standby(struct v4l2_subdev *sd, u32 standby)
793 792
794 tuner_dbg("Putting tuner to sleep\n"); 793 tuner_dbg("Putting tuner to sleep\n");
795 794
796 if (check_mode(t, "TUNER_SET_STANDBY") == -EINVAL) 795 if (check_mode(t, "s_standby") == -EINVAL)
797 return 0; 796 return 0;
798 t->mode = T_STANDBY; 797 t->mode = T_STANDBY;
799 if (analog_ops->standby) 798 if (analog_ops->standby)
@@ -952,8 +951,7 @@ static int tuner_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
952 struct tuner *t = to_tuner(sd); 951 struct tuner *t = to_tuner(sd);
953 struct i2c_client *client = v4l2_get_subdevdata(sd); 952 struct i2c_client *client = v4l2_get_subdevdata(sd);
954 953
955 if (set_mode(client, t, V4L2_TUNER_ANALOG_TV, "VIDIOC_S_STD") 954 if (set_mode(client, t, V4L2_TUNER_ANALOG_TV, "s_std") == -EINVAL)
956 == -EINVAL)
957 return 0; 955 return 0;
958 956
959 switch_v4l2(); 957 switch_v4l2();
@@ -970,8 +968,7 @@ static int tuner_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
970 struct tuner *t = to_tuner(sd); 968 struct tuner *t = to_tuner(sd);
971 struct i2c_client *client = v4l2_get_subdevdata(sd); 969 struct i2c_client *client = v4l2_get_subdevdata(sd);
972 970
973 if (set_mode(client, t, f->type, "VIDIOC_S_FREQUENCY") 971 if (set_mode(client, t, f->type, "s_frequency") == -EINVAL)
974 == -EINVAL)
975 return 0; 972 return 0;
976 switch_v4l2(); 973 switch_v4l2();
977 set_freq(client, f->frequency); 974 set_freq(client, f->frequency);
@@ -984,7 +981,7 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
984 struct tuner *t = to_tuner(sd); 981 struct tuner *t = to_tuner(sd);
985 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; 982 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
986 983
987 if (check_mode(t, "VIDIOC_G_FREQUENCY") == -EINVAL) 984 if (check_mode(t, "g_frequency") == -EINVAL)
988 return 0; 985 return 0;
989 switch_v4l2(); 986 switch_v4l2();
990 f->type = t->mode; 987 f->type = t->mode;
@@ -1008,7 +1005,7 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
1008 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; 1005 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1009 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; 1006 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
1010 1007
1011 if (check_mode(t, "VIDIOC_G_TUNER") == -EINVAL) 1008 if (check_mode(t, "g_tuner") == -EINVAL)
1012 return 0; 1009 return 0;
1013 switch_v4l2(); 1010 switch_v4l2();
1014 1011
@@ -1057,7 +1054,7 @@ static int tuner_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
1057 struct tuner *t = to_tuner(sd); 1054 struct tuner *t = to_tuner(sd);
1058 struct i2c_client *client = v4l2_get_subdevdata(sd); 1055 struct i2c_client *client = v4l2_get_subdevdata(sd);
1059 1056
1060 if (check_mode(t, "VIDIOC_S_TUNER") == -EINVAL) 1057 if (check_mode(t, "s_tuner") == -EINVAL)
1061 return 0; 1058 return 0;
1062 1059
1063 switch_v4l2(); 1060 switch_v4l2();
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index 9ee55f26c4f..3a5a95f134b 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,
631 const struct i2c_vbi_ram_value *regs = vbi_ram_default; 631 const struct i2c_vbi_ram_value *regs = vbi_ram_default;
632 int line; 632 int line;
633 633
634 v4l2_dbg(1, debug, sd, "VIDIOC_G_SLICED_VBI_CAP\n"); 634 v4l2_dbg(1, debug, sd, "g_sliced_vbi_cap\n");
635 memset(cap, 0, sizeof *cap); 635 memset(cap, 0, sizeof *cap);
636 636
637 while (regs->reg != (u16)-1 ) { 637 while (regs->reg != (u16)-1 ) {
@@ -830,7 +830,7 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
830 830
831static int tvp5150_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 831static int tvp5150_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
832{ 832{
833 v4l2_dbg(1, debug, sd, "VIDIOC_G_CTRL called\n"); 833 v4l2_dbg(1, debug, sd, "g_ctrl called\n");
834 834
835 switch (ctrl->id) { 835 switch (ctrl->id) {
836 case V4L2_CID_BRIGHTNESS: 836 case V4L2_CID_BRIGHTNESS:
@@ -860,7 +860,7 @@ static int tvp5150_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
860 if (ctrl->value < tvp5150_qctrl[i].minimum || 860 if (ctrl->value < tvp5150_qctrl[i].minimum ||
861 ctrl->value > tvp5150_qctrl[i].maximum) 861 ctrl->value > tvp5150_qctrl[i].maximum)
862 return -ERANGE; 862 return -ERANGE;
863 v4l2_dbg(1, debug, sd, "VIDIOC_S_CTRL: id=%d, value=%d\n", 863 v4l2_dbg(1, debug, sd, "s_ctrl: id=%d, value=%d\n",
864 ctrl->id, ctrl->value); 864 ctrl->id, ctrl->value);
865 break; 865 break;
866 } 866 }
@@ -1014,7 +1014,7 @@ static int tvp5150_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
1014{ 1014{
1015 int i; 1015 int i;
1016 1016
1017 v4l2_dbg(1, debug, sd, "VIDIOC_QUERYCTRL called\n"); 1017 v4l2_dbg(1, debug, sd, "queryctrl called\n");
1018 1018
1019 for (i = 0; i < ARRAY_SIZE(tvp5150_qctrl); i++) 1019 for (i = 0; i < ARRAY_SIZE(tvp5150_qctrl); i++)
1020 if (qc->id && qc->id == tvp5150_qctrl[i].id) { 1020 if (qc->id && qc->id == tvp5150_qctrl[i].id) {
diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c
index 0cc23539f74..2fa7e8bb574 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
296 int res = V4L2_IN_ST_NO_SIGNAL, status; 296 int res = V4L2_IN_ST_NO_SIGNAL, status;
297 v4l2_std_id std = 0; 297 v4l2_std_id std = 0;
298 298
299 v4l2_dbg(1, debug, sd, "VIDIOC_QUERYSTD/VIDIOC_INT_G_INPUT_STATUS\n");
300
301 status = vpx3220_fp_read(sd, 0x0f3); 299 status = vpx3220_fp_read(sd, 0x0f3);
302 300
303 v4l2_dbg(1, debug, sd, "status: 0x%04x\n", status); 301 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
336 334
337static int vpx3220_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) 335static int vpx3220_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
338{ 336{
337 v4l2_dbg(1, debug, sd, "querystd\n");
339 return vpx3220_status(sd, NULL, std); 338 return vpx3220_status(sd, NULL, std);
340} 339}
341 340
342static int vpx3220_g_input_status(struct v4l2_subdev *sd, u32 *status) 341static int vpx3220_g_input_status(struct v4l2_subdev *sd, u32 *status)
343{ 342{
343 v4l2_dbg(1, debug, sd, "g_input_status\n");
344 return vpx3220_status(sd, status, NULL); 344 return vpx3220_status(sd, status, NULL);
345} 345}
346 346
@@ -354,7 +354,7 @@ static int vpx3220_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
354 choosen video norm */ 354 choosen video norm */
355 temp_input = vpx3220_fp_read(sd, 0xf2); 355 temp_input = vpx3220_fp_read(sd, 0xf2);
356 356
357 v4l2_dbg(1, debug, sd, "VIDIOC_S_STD %llx\n", (unsigned long long)std); 357 v4l2_dbg(1, debug, sd, "s_std %llx\n", (unsigned long long)std);
358 if (std & V4L2_STD_NTSC) { 358 if (std & V4L2_STD_NTSC) {
359 vpx3220_write_fp_block(sd, init_ntsc, sizeof(init_ntsc) >> 1); 359 vpx3220_write_fp_block(sd, init_ntsc, sizeof(init_ntsc) >> 1);
360 v4l2_dbg(1, debug, sd, "norm switched to NTSC\n"); 360 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 *
410 410
411static int vpx3220_s_stream(struct v4l2_subdev *sd, int enable) 411static int vpx3220_s_stream(struct v4l2_subdev *sd, int enable)
412{ 412{
413 v4l2_dbg(1, debug, sd, "VIDIOC_STREAM%s\n", enable ? "ON" : "OFF"); 413 v4l2_dbg(1, debug, sd, "s_stream %s\n", enable ? "on" : "off");
414 414
415 vpx3220_write(sd, 0xf2, (enable ? 0x1b : 0x00)); 415 vpx3220_write(sd, 0xf2, (enable ? 0x1b : 0x00));
416 return 0; 416 return 0;