aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/ttpci')
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c72
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c6
2 files changed, 55 insertions, 23 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index ee8ee1d481fa..1b2d15140a1d 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -107,7 +107,7 @@ static struct v4l2_input inputs[4] = {
107 .index = 1, 107 .index = 1,
108 .name = "Television", 108 .name = "Television",
109 .type = V4L2_INPUT_TYPE_TUNER, 109 .type = V4L2_INPUT_TYPE_TUNER,
110 .audioset = 2, 110 .audioset = 1,
111 .tuner = 0, 111 .tuner = 0,
112 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 112 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
113 .status = 0, 113 .status = 0,
@@ -494,7 +494,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input)
494 dprintk(2, "VIDIOC_S_INPUT: %d\n", input); 494 dprintk(2, "VIDIOC_S_INPUT: %d\n", input);
495 495
496 if (!av7110->analog_tuner_flags) 496 if (!av7110->analog_tuner_flags)
497 return 0; 497 return input ? -EINVAL : 0;
498 498
499 if (input >= 4) 499 if (input >= 4)
500 return -EINVAL; 500 return -EINVAL;
@@ -503,19 +503,38 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input)
503 return av7110_dvb_c_switch(fh); 503 return av7110_dvb_c_switch(fh);
504} 504}
505 505
506static int vidioc_enumaudio(struct file *file, void *fh, struct v4l2_audio *a)
507{
508 dprintk(2, "VIDIOC_G_AUDIO: %d\n", a->index);
509 if (a->index != 0)
510 return -EINVAL;
511 *a = msp3400_v4l2_audio;
512 return 0;
513}
514
506static int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *a) 515static int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *a)
507{ 516{
517 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
518 struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
519
508 dprintk(2, "VIDIOC_G_AUDIO: %d\n", a->index); 520 dprintk(2, "VIDIOC_G_AUDIO: %d\n", a->index);
509 if (a->index != 0) 521 if (a->index != 0)
510 return -EINVAL; 522 return -EINVAL;
511 memcpy(a, &msp3400_v4l2_audio, sizeof(struct v4l2_audio)); 523 if (av7110->current_input >= 2)
524 return -EINVAL;
525 *a = msp3400_v4l2_audio;
512 return 0; 526 return 0;
513} 527}
514 528
515static int vidioc_s_audio(struct file *file, void *fh, struct v4l2_audio *a) 529static int vidioc_s_audio(struct file *file, void *fh, struct v4l2_audio *a)
516{ 530{
531 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
532 struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
533
517 dprintk(2, "VIDIOC_S_AUDIO: %d\n", a->index); 534 dprintk(2, "VIDIOC_S_AUDIO: %d\n", a->index);
518 return 0; 535 if (av7110->current_input >= 2)
536 return -EINVAL;
537 return a->index ? -EINVAL : 0;
519} 538}
520 539
521static int vidioc_g_sliced_vbi_cap(struct file *file, void *fh, 540static int vidioc_g_sliced_vbi_cap(struct file *file, void *fh,
@@ -802,26 +821,39 @@ int av7110_init_v4l(struct av7110 *av7110)
802 ERR("cannot init capture device. skipping\n"); 821 ERR("cannot init capture device. skipping\n");
803 return -ENODEV; 822 return -ENODEV;
804 } 823 }
805 vv_data->ops.vidioc_enum_input = vidioc_enum_input; 824 vv_data->vid_ops.vidioc_enum_input = vidioc_enum_input;
806 vv_data->ops.vidioc_g_input = vidioc_g_input; 825 vv_data->vid_ops.vidioc_g_input = vidioc_g_input;
807 vv_data->ops.vidioc_s_input = vidioc_s_input; 826 vv_data->vid_ops.vidioc_s_input = vidioc_s_input;
808 vv_data->ops.vidioc_g_tuner = vidioc_g_tuner; 827 vv_data->vid_ops.vidioc_g_tuner = vidioc_g_tuner;
809 vv_data->ops.vidioc_s_tuner = vidioc_s_tuner; 828 vv_data->vid_ops.vidioc_s_tuner = vidioc_s_tuner;
810 vv_data->ops.vidioc_g_frequency = vidioc_g_frequency; 829 vv_data->vid_ops.vidioc_g_frequency = vidioc_g_frequency;
811 vv_data->ops.vidioc_s_frequency = vidioc_s_frequency; 830 vv_data->vid_ops.vidioc_s_frequency = vidioc_s_frequency;
812 vv_data->ops.vidioc_g_audio = vidioc_g_audio; 831 vv_data->vid_ops.vidioc_enumaudio = vidioc_enumaudio;
813 vv_data->ops.vidioc_s_audio = vidioc_s_audio; 832 vv_data->vid_ops.vidioc_g_audio = vidioc_g_audio;
814 vv_data->ops.vidioc_g_sliced_vbi_cap = vidioc_g_sliced_vbi_cap; 833 vv_data->vid_ops.vidioc_s_audio = vidioc_s_audio;
815 vv_data->ops.vidioc_g_fmt_sliced_vbi_out = vidioc_g_fmt_sliced_vbi_out; 834 vv_data->vid_ops.vidioc_g_fmt_vbi_cap = NULL;
816 vv_data->ops.vidioc_s_fmt_sliced_vbi_out = vidioc_s_fmt_sliced_vbi_out; 835
836 vv_data->vbi_ops.vidioc_g_tuner = vidioc_g_tuner;
837 vv_data->vbi_ops.vidioc_s_tuner = vidioc_s_tuner;
838 vv_data->vbi_ops.vidioc_g_frequency = vidioc_g_frequency;
839 vv_data->vbi_ops.vidioc_s_frequency = vidioc_s_frequency;
840 vv_data->vbi_ops.vidioc_g_fmt_vbi_cap = NULL;
841 vv_data->vbi_ops.vidioc_g_sliced_vbi_cap = vidioc_g_sliced_vbi_cap;
842 vv_data->vbi_ops.vidioc_g_fmt_sliced_vbi_out = vidioc_g_fmt_sliced_vbi_out;
843 vv_data->vbi_ops.vidioc_s_fmt_sliced_vbi_out = vidioc_s_fmt_sliced_vbi_out;
844
845 if (FW_VERSION(av7110->arm_app) < 0x2623)
846 vv_data->capabilities &= ~V4L2_CAP_SLICED_VBI_OUTPUT;
817 847
818 if (saa7146_register_device(&av7110->v4l_dev, dev, "av7110", VFL_TYPE_GRABBER)) { 848 if (saa7146_register_device(&av7110->v4l_dev, dev, "av7110", VFL_TYPE_GRABBER)) {
819 ERR("cannot register capture device. skipping\n"); 849 ERR("cannot register capture device. skipping\n");
820 saa7146_vv_release(dev); 850 saa7146_vv_release(dev);
821 return -ENODEV; 851 return -ENODEV;
822 } 852 }
823 if (saa7146_register_device(&av7110->vbi_dev, dev, "av7110", VFL_TYPE_VBI)) 853 if (FW_VERSION(av7110->arm_app) >= 0x2623) {
824 ERR("cannot register vbi v4l2 device. skipping\n"); 854 if (saa7146_register_device(&av7110->vbi_dev, dev, "av7110", VFL_TYPE_VBI))
855 ERR("cannot register vbi v4l2 device. skipping\n");
856 }
825 return 0; 857 return 0;
826} 858}
827 859
@@ -905,7 +937,7 @@ static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
905static struct saa7146_ext_vv av7110_vv_data_st = { 937static struct saa7146_ext_vv av7110_vv_data_st = {
906 .inputs = 1, 938 .inputs = 1,
907 .audios = 1, 939 .audios = 1,
908 .capabilities = V4L2_CAP_SLICED_VBI_OUTPUT, 940 .capabilities = V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_AUDIO,
909 .flags = 0, 941 .flags = 0,
910 942
911 .stds = &standard[0], 943 .stds = &standard[0],
@@ -920,7 +952,7 @@ static struct saa7146_ext_vv av7110_vv_data_st = {
920static struct saa7146_ext_vv av7110_vv_data_c = { 952static struct saa7146_ext_vv av7110_vv_data_c = {
921 .inputs = 1, 953 .inputs = 1,
922 .audios = 1, 954 .audios = 1,
923 .capabilities = V4L2_CAP_TUNER | V4L2_CAP_SLICED_VBI_OUTPUT, 955 .capabilities = V4L2_CAP_TUNER | V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_AUDIO,
924 .flags = SAA7146_USE_PORT_B_FOR_VBI, 956 .flags = SAA7146_USE_PORT_B_FOR_VBI,
925 957
926 .stds = &standard[0], 958 .stds = &standard[0],
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 8b32e282bf5d..12ddb53c58dc 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -1483,9 +1483,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1483 ERR("cannot init vv subsystem\n"); 1483 ERR("cannot init vv subsystem\n");
1484 return err; 1484 return err;
1485 } 1485 }
1486 vv_data.ops.vidioc_enum_input = vidioc_enum_input; 1486 vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input;
1487 vv_data.ops.vidioc_g_input = vidioc_g_input; 1487 vv_data.vid_ops.vidioc_g_input = vidioc_g_input;
1488 vv_data.ops.vidioc_s_input = vidioc_s_input; 1488 vv_data.vid_ops.vidioc_s_input = vidioc_s_input;
1489 1489
1490 if ((err = saa7146_register_device(&budget_av->vd, dev, "knc1", VFL_TYPE_GRABBER))) { 1490 if ((err = saa7146_register_device(&budget_av->vd, dev, "knc1", VFL_TYPE_GRABBER))) {
1491 /* fixme: proper cleanup here */ 1491 /* fixme: proper cleanup here */