aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/hexium_gemini.c12
-rw-r--r--drivers/media/video/hexium_orion.c6
-rw-r--r--drivers/media/video/mxb.c41
3 files changed, 37 insertions, 22 deletions
diff --git a/drivers/media/video/hexium_gemini.c b/drivers/media/video/hexium_gemini.c
index a62322d5c0d8..22650322d0a9 100644
--- a/drivers/media/video/hexium_gemini.c
+++ b/drivers/media/video/hexium_gemini.c
@@ -399,12 +399,12 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
399 hexium->cur_input = 0; 399 hexium->cur_input = 0;
400 400
401 saa7146_vv_init(dev, &vv_data); 401 saa7146_vv_init(dev, &vv_data);
402 vv_data.ops.vidioc_queryctrl = vidioc_queryctrl; 402 vv_data.vid_ops.vidioc_queryctrl = vidioc_queryctrl;
403 vv_data.ops.vidioc_g_ctrl = vidioc_g_ctrl; 403 vv_data.vid_ops.vidioc_g_ctrl = vidioc_g_ctrl;
404 vv_data.ops.vidioc_s_ctrl = vidioc_s_ctrl; 404 vv_data.vid_ops.vidioc_s_ctrl = vidioc_s_ctrl;
405 vv_data.ops.vidioc_enum_input = vidioc_enum_input; 405 vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input;
406 vv_data.ops.vidioc_g_input = vidioc_g_input; 406 vv_data.vid_ops.vidioc_g_input = vidioc_g_input;
407 vv_data.ops.vidioc_s_input = vidioc_s_input; 407 vv_data.vid_ops.vidioc_s_input = vidioc_s_input;
408 ret = saa7146_register_device(&hexium->video_dev, dev, "hexium gemini", VFL_TYPE_GRABBER); 408 ret = saa7146_register_device(&hexium->video_dev, dev, "hexium gemini", VFL_TYPE_GRABBER);
409 if (ret < 0) { 409 if (ret < 0) {
410 pr_err("cannot register capture v4l2 device. skipping.\n"); 410 pr_err("cannot register capture v4l2 device. skipping.\n");
diff --git a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c
index 23debc967d94..e549339f32d6 100644
--- a/drivers/media/video/hexium_orion.c
+++ b/drivers/media/video/hexium_orion.c
@@ -371,9 +371,9 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
371 DEB_EE("\n"); 371 DEB_EE("\n");
372 372
373 saa7146_vv_init(dev, &vv_data); 373 saa7146_vv_init(dev, &vv_data);
374 vv_data.ops.vidioc_enum_input = vidioc_enum_input; 374 vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input;
375 vv_data.ops.vidioc_g_input = vidioc_g_input; 375 vv_data.vid_ops.vidioc_g_input = vidioc_g_input;
376 vv_data.ops.vidioc_s_input = vidioc_s_input; 376 vv_data.vid_ops.vidioc_s_input = vidioc_s_input;
377 if (0 != saa7146_register_device(&hexium->video_dev, dev, "hexium orion", VFL_TYPE_GRABBER)) { 377 if (0 != saa7146_register_device(&hexium->video_dev, dev, "hexium orion", VFL_TYPE_GRABBER)) {
378 pr_err("cannot register capture v4l2 device. skipping.\n"); 378 pr_err("cannot register capture v4l2 device. skipping.\n");
379 return -1; 379 return -1;
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index db0c5ddec87f..d2d261291158 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -662,13 +662,28 @@ static int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_regist
662{ 662{
663 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; 663 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
664 664
665 return call_all(dev, core, g_register, reg); 665 if (!capable(CAP_SYS_ADMIN))
666 return -EPERM;
667 if (v4l2_chip_match_host(&reg->match)) {
668 reg->val = saa7146_read(dev, reg->reg);
669 reg->size = 4;
670 return 0;
671 }
672 call_all(dev, core, g_register, reg);
673 return 0;
666} 674}
667 675
668static int vidioc_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg) 676static int vidioc_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
669{ 677{
670 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; 678 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
671 679
680 if (!capable(CAP_SYS_ADMIN))
681 return -EPERM;
682 if (v4l2_chip_match_host(&reg->match)) {
683 saa7146_write(dev, reg->reg, reg->val);
684 reg->size = 4;
685 return 0;
686 }
672 return call_all(dev, core, s_register, reg); 687 return call_all(dev, core, s_register, reg);
673} 688}
674#endif 689#endif
@@ -689,19 +704,19 @@ static int mxb_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data
689 } 704 }
690 mxb = (struct mxb *)dev->ext_priv; 705 mxb = (struct mxb *)dev->ext_priv;
691 706
692 vv_data.ops.vidioc_enum_input = vidioc_enum_input; 707 vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input;
693 vv_data.ops.vidioc_g_input = vidioc_g_input; 708 vv_data.vid_ops.vidioc_g_input = vidioc_g_input;
694 vv_data.ops.vidioc_s_input = vidioc_s_input; 709 vv_data.vid_ops.vidioc_s_input = vidioc_s_input;
695 vv_data.ops.vidioc_g_tuner = vidioc_g_tuner; 710 vv_data.vid_ops.vidioc_g_tuner = vidioc_g_tuner;
696 vv_data.ops.vidioc_s_tuner = vidioc_s_tuner; 711 vv_data.vid_ops.vidioc_s_tuner = vidioc_s_tuner;
697 vv_data.ops.vidioc_g_frequency = vidioc_g_frequency; 712 vv_data.vid_ops.vidioc_g_frequency = vidioc_g_frequency;
698 vv_data.ops.vidioc_s_frequency = vidioc_s_frequency; 713 vv_data.vid_ops.vidioc_s_frequency = vidioc_s_frequency;
699 vv_data.ops.vidioc_enumaudio = vidioc_enumaudio; 714 vv_data.vid_ops.vidioc_enumaudio = vidioc_enumaudio;
700 vv_data.ops.vidioc_g_audio = vidioc_g_audio; 715 vv_data.vid_ops.vidioc_g_audio = vidioc_g_audio;
701 vv_data.ops.vidioc_s_audio = vidioc_s_audio; 716 vv_data.vid_ops.vidioc_s_audio = vidioc_s_audio;
702#ifdef CONFIG_VIDEO_ADV_DEBUG 717#ifdef CONFIG_VIDEO_ADV_DEBUG
703 vv_data.ops.vidioc_g_register = vidioc_g_register; 718 vv_data.vid_ops.vidioc_g_register = vidioc_g_register;
704 vv_data.ops.vidioc_s_register = vidioc_s_register; 719 vv_data.vid_ops.vidioc_s_register = vidioc_s_register;
705#endif 720#endif
706 if (saa7146_register_device(&mxb->video_dev, dev, "mxb", VFL_TYPE_GRABBER)) { 721 if (saa7146_register_device(&mxb->video_dev, dev, "mxb", VFL_TYPE_GRABBER)) {
707 ERR("cannot register capture v4l2 device. skipping.\n"); 722 ERR("cannot register capture v4l2 device. skipping.\n");