aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/ivtv/ivtv-cards.c81
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c27
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h14
-rw-r--r--drivers/media/video/ivtv/ivtv-gpio.c24
-rw-r--r--drivers/media/video/ivtv/ivtv-gpio.h2
5 files changed, 86 insertions, 62 deletions
diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c
index e51d7cc35b1c..b6a8be622d3c 100644
--- a/drivers/media/video/ivtv/ivtv-cards.c
+++ b/drivers/media/video/ivtv/ivtv-cards.c
@@ -823,9 +823,7 @@ static const struct ivtv_card ivtv_card_dctmvtvp1 = {
823 823
824/* ------------------------------------------------------------------------- */ 824/* ------------------------------------------------------------------------- */
825 825
826#ifdef HAVE_XC3028 826/* Yuan PG600-2/GotView PCI DVD Lite cards */
827
828/* Yuan PG600-2/GotView PCI DVD Lite/Club3D ZAP-TV1x01 cards */
829 827
830static const struct ivtv_card_pci_info ivtv_pci_pg600v2[] = { 828static const struct ivtv_card_pci_info ivtv_pci_pg600v2[] = {
831 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN3, 0x0600 }, 829 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN3, 0x0600 },
@@ -835,30 +833,87 @@ static const struct ivtv_card_pci_info ivtv_pci_pg600v2[] = {
835 833
836static const struct ivtv_card ivtv_card_pg600v2 = { 834static const struct ivtv_card ivtv_card_pg600v2 = {
837 .type = IVTV_CARD_PG600V2, 835 .type = IVTV_CARD_PG600V2,
838 .name = "Yuan PG600-2, GotView PCI DVD Lite, Club3D ZAP-TV1x01", 836 .name = "Yuan PG600-2, GotView PCI DVD Lite",
839 .v4l2_capabilities = IVTV_CAP_ENCODER, 837 .v4l2_capabilities = IVTV_CAP_ENCODER,
840 .hw_video = IVTV_HW_CX25840, 838 .hw_video = IVTV_HW_CX25840,
841 .hw_audio = IVTV_HW_CX25840, 839 .hw_audio = IVTV_HW_CX25840,
842 .hw_audio_ctrl = IVTV_HW_CX25840, 840 .hw_audio_ctrl = IVTV_HW_CX25840,
843 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER, 841 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER,
844 .video_inputs = { 842 .video_inputs = {
845 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE2 }, 843 { IVTV_CARD_INPUT_SVIDEO1, 0,
846 { IVTV_CARD_INPUT_SVIDEO1, 1,
847 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 }, 844 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
848 { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 }, 845 { IVTV_CARD_INPUT_COMPOSITE1, 0, CX25840_COMPOSITE1 },
849 }, 846 },
850 .audio_inputs = { 847 .audio_inputs = {
851 { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 },
852 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL }, 848 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL },
853 }, 849 },
854 .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 },
855 .tuners = { 850 .tuners = {
856 { .std = V4L2_STD_ALL, .tuner = TUNER_XCEIVE_XC3028 }, 851 { .std = V4L2_STD_ALL, .tuner = TUNER_XCEIVE_XC3028 },
857 }, 852 },
858 .gpio_init = { .direction = 0x1000, .initial_value = 0x1000 }, /* tuner reset */
859 .pci_list = ivtv_pci_pg600v2, 853 .pci_list = ivtv_pci_pg600v2,
860}; 854};
861#endif 855
856/* ------------------------------------------------------------------------- */
857
858/* Club3D ZAP-TV1x01 cards */
859
860static const struct ivtv_card_pci_info ivtv_pci_club3d[] = {
861 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN3, 0x0600 },
862 { 0, 0, 0 }
863};
864
865static const struct ivtv_card ivtv_card_club3d = {
866 .type = IVTV_CARD_CLUB3D,
867 .name = "Club3D ZAP-TV1x01",
868 .v4l2_capabilities = IVTV_CAP_ENCODER,
869 .hw_video = IVTV_HW_CX25840,
870 .hw_audio = IVTV_HW_CX25840,
871 .hw_audio_ctrl = IVTV_HW_CX25840,
872 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER,
873 .video_inputs = {
874 { IVTV_CARD_INPUT_SVIDEO1, 0,
875 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
876 { IVTV_CARD_INPUT_COMPOSITE1, 0, CX25840_COMPOSITE3 },
877 },
878 .audio_inputs = {
879 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL },
880 },
881 .tuners = {
882 { .std = V4L2_STD_ALL, .tuner = TUNER_XCEIVE_XC3028 },
883 },
884 .pci_list = ivtv_pci_club3d,
885};
886
887/* ------------------------------------------------------------------------- */
888
889/* AVerTV MCE 116 Plus (M116) card */
890
891static const struct ivtv_card_pci_info ivtv_pci_avertv_mce116[] = {
892 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xc439 },
893 { 0, 0, 0 }
894};
895
896static const struct ivtv_card ivtv_card_avertv_mce116 = {
897 .type = IVTV_CARD_AVERTV_MCE116,
898 .name = "AVerTV MCE 116 Plus",
899 .v4l2_capabilities = IVTV_CAP_ENCODER,
900 .hw_video = IVTV_HW_CX25840,
901 .hw_audio = IVTV_HW_CX25840,
902 .hw_audio_ctrl = IVTV_HW_CX25840,
903 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER | IVTV_HW_WM8739,
904 .video_inputs = {
905 { IVTV_CARD_INPUT_SVIDEO1, 0, CX25840_SVIDEO3 },
906 { IVTV_CARD_INPUT_COMPOSITE1, 0, CX25840_COMPOSITE1 },
907 },
908 .audio_inputs = {
909 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL, 1 },
910 },
911 .gpio_init = { .direction = 0xe000, .initial_value = 0x4000 }, /* enable line-in */
912 .tuners = {
913 { .std = V4L2_STD_ALL, .tuner = TUNER_XCEIVE_XC3028 },
914 },
915 .pci_list = ivtv_pci_avertv_mce116,
916};
862 917
863static const struct ivtv_card *ivtv_card_list[] = { 918static const struct ivtv_card *ivtv_card_list[] = {
864 &ivtv_card_pvr250, 919 &ivtv_card_pvr250,
@@ -879,9 +934,9 @@ static const struct ivtv_card *ivtv_card_list[] = {
879 &ivtv_card_gotview_pci_dvd2, 934 &ivtv_card_gotview_pci_dvd2,
880 &ivtv_card_yuan_mpc622, 935 &ivtv_card_yuan_mpc622,
881 &ivtv_card_dctmvtvp1, 936 &ivtv_card_dctmvtvp1,
882#ifdef HAVE_XC3028
883 &ivtv_card_pg600v2, 937 &ivtv_card_pg600v2,
884#endif 938 &ivtv_card_club3d,
939 &ivtv_card_avertv_mce116,
885 940
886 /* Variations of standard cards but with the same PCI IDs. 941 /* Variations of standard cards but with the same PCI IDs.
887 These cards must come last in this list. */ 942 These cards must come last in this list. */
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index f8ef267e56b2..198e443e8a5e 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -177,9 +177,9 @@ MODULE_PARM_DESC(cardtype,
177 "\t\t\t16 = GOTVIEW PCI DVD2 Deluxe\n" 177 "\t\t\t16 = GOTVIEW PCI DVD2 Deluxe\n"
178 "\t\t\t17 = Yuan MPC622\n" 178 "\t\t\t17 = Yuan MPC622\n"
179 "\t\t\t18 = Digital Cowboy DCT-MTVP1\n" 179 "\t\t\t18 = Digital Cowboy DCT-MTVP1\n"
180#ifdef HAVE_XC3028 180 "\t\t\t19 = Yuan PG600V2/GotView PCI DVD Lite\n"
181 "\t\t\t19 = Yuan PG600V2/GotView PCI DVD Lite/Club3D ZAP-TV1x01\n" 181 "\t\t\t20 = Club3D ZAP-TV1x01\n"
182#endif 182 "\t\t\t21 = AverTV MCE 116 Plus\n"
183 "\t\t\t 0 = Autodetect (default)\n" 183 "\t\t\t 0 = Autodetect (default)\n"
184 "\t\t\t-1 = Ignore this card\n\t\t"); 184 "\t\t\t-1 = Ignore this card\n\t\t");
185MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); 185MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60");
@@ -821,11 +821,13 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
821 /* load modules */ 821 /* load modules */
822#ifndef CONFIG_VIDEO_TUNER 822#ifndef CONFIG_VIDEO_TUNER
823 if (hw & IVTV_HW_TUNER) { 823 if (hw & IVTV_HW_TUNER) {
824 ivtv_request_module(itv, "tuner"); 824 if (itv->options.tuner == TUNER_XCEIVE_XC3028) {
825#ifdef HAVE_XC3028 825 IVTV_INFO("Xceive tuner not yet supported, only composite and S-Video inputs will be available\n");
826 if (itv->options.tuner == TUNER_XCEIVE_XC3028) 826 itv->tunerid = 1;
827 ivtv_request_module(itv, "xc3028-tuner"); 827 }
828#endif 828 else {
829 ivtv_request_module(itv, "tuner");
830 }
829 } 831 }
830#endif 832#endif
831#ifndef CONFIG_VIDEO_CX25840 833#ifndef CONFIG_VIDEO_CX25840
@@ -1130,19 +1132,12 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
1130 if (itv->options.radio > 0) 1132 if (itv->options.radio > 0)
1131 itv->v4l2_cap |= V4L2_CAP_RADIO; 1133 itv->v4l2_cap |= V4L2_CAP_RADIO;
1132 1134
1133 if (itv->options.tuner > -1) { 1135 if (itv->options.tuner > -1 && itv->tunerid == 0) {
1134 struct tuner_setup setup; 1136 struct tuner_setup setup;
1135 1137
1136 setup.addr = ADDR_UNSET; 1138 setup.addr = ADDR_UNSET;
1137 setup.type = itv->options.tuner; 1139 setup.type = itv->options.tuner;
1138 setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */ 1140 setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */
1139#ifdef HAVE_XC3028
1140 setup.initmode = V4L2_TUNER_ANALOG_TV;
1141 if (itv->options.tuner == TUNER_XCEIVE_XC3028) {
1142 setup.gpio_write = ivtv_reset_tuner_gpio;
1143 setup.gpio_priv = itv;
1144 }
1145#endif
1146 ivtv_call_i2c_clients(itv, TUNER_SET_TYPE_ADDR, &setup); 1141 ivtv_call_i2c_clients(itv, TUNER_SET_TYPE_ADDR, &setup);
1147 } 1142 }
1148 1143
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index 6c7c9a57a1ab..4a7b23b9f22a 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -63,10 +63,9 @@
63#include <media/tuner.h> 63#include <media/tuner.h>
64#include <media/cx2341x.h> 64#include <media/cx2341x.h>
65 65
66/* #define HAVE_XC3028 1 */
67
68#include <media/ivtv.h> 66#include <media/ivtv.h>
69 67
68
70#define IVTV_ENCODER_OFFSET 0x00000000 69#define IVTV_ENCODER_OFFSET 0x00000000
71#define IVTV_ENCODER_SIZE 0x00800000 /* Last half isn't needed 0x01000000 */ 70#define IVTV_ENCODER_SIZE 0x00800000 /* Last half isn't needed 0x01000000 */
72 71
@@ -114,12 +113,10 @@ extern const u32 yuv_offset[4];
114#define IVTV_CARD_GOTVIEW_PCI_DVD2 15 /* GotView PCI DVD2 */ 113#define IVTV_CARD_GOTVIEW_PCI_DVD2 15 /* GotView PCI DVD2 */
115#define IVTV_CARD_YUAN_MPC622 16 /* Yuan MPC622 miniPCI */ 114#define IVTV_CARD_YUAN_MPC622 16 /* Yuan MPC622 miniPCI */
116#define IVTV_CARD_DCTMTVP1 17 /* DIGITAL COWBOY DCT-MTVP1 */ 115#define IVTV_CARD_DCTMTVP1 17 /* DIGITAL COWBOY DCT-MTVP1 */
117#ifdef HAVE_XC3028 116#define IVTV_CARD_PG600V2 18 /* Yuan PG600V2/GotView PCI DVD Lite */
118#define IVTV_CARD_PG600V2 18 /* Yuan PG600V2/GotView PCI DVD Lite/Club3D ZAP-TV1x01 */ 117#define IVTV_CARD_CLUB3D 19 /* Club3D ZAP-TV1x01 */
119#define IVTV_CARD_LAST 18 118#define IVTV_CARD_AVERTV_MCE116 20 /* AVerTV MCE 116 Plus */
120#else 119#define IVTV_CARD_LAST 20
121#define IVTV_CARD_LAST 17
122#endif
123 120
124/* Variants of existing cards but with the same PCI IDs. The driver 121/* Variants of existing cards but with the same PCI IDs. The driver
125 detects these based on other device information. 122 detects these based on other device information.
@@ -705,6 +702,7 @@ struct ivtv {
705 u8 nof_audio_inputs; /* number of audio inputs */ 702 u8 nof_audio_inputs; /* number of audio inputs */
706 u32 v4l2_cap; /* V4L2 capabilities of card */ 703 u32 v4l2_cap; /* V4L2 capabilities of card */
707 u32 hw_flags; /* Hardware description of the board */ 704 u32 hw_flags; /* Hardware description of the board */
705 int tunerid; /* Userspace tuner ID for experimental Xceive tuner support */
708 706
709 /* controlling Video decoder function */ 707 /* controlling Video decoder function */
710 int (*video_dec_func)(struct ivtv *, unsigned int, void *); 708 int (*video_dec_func)(struct ivtv *, unsigned int, void *);
diff --git a/drivers/media/video/ivtv/ivtv-gpio.c b/drivers/media/video/ivtv/ivtv-gpio.c
index 6a5a7aa66976..132fb5f71366 100644
--- a/drivers/media/video/ivtv/ivtv-gpio.c
+++ b/drivers/media/video/ivtv/ivtv-gpio.c
@@ -122,30 +122,6 @@ void ivtv_reset_ir_gpio(struct ivtv *itv)
122 write_reg(curdir, IVTV_REG_GPIO_DIR); 122 write_reg(curdir, IVTV_REG_GPIO_DIR);
123} 123}
124 124
125#ifdef HAVE_XC3028
126int ivtv_reset_tuner_gpio(enum v4l2_tuner_type mode, void *priv, int ptr)
127{
128 int curdir, curout;
129 struct ivtv *itv = (struct ivtv *) priv;
130
131 if (itv->card->type != IVTV_CARD_PG600V2 || itv->options.tuner != TUNER_XCEIVE_XC3028)
132 return -EINVAL;
133 IVTV_INFO("Resetting tuner\n");
134 curout = read_reg(IVTV_REG_GPIO_OUT);
135 curdir = read_reg(IVTV_REG_GPIO_DIR);
136 curdir |= (1 << 12); /* GPIO bit 12 */
137
138 curout &= ~(1 << 12);
139 write_reg(curout, IVTV_REG_GPIO_OUT);
140 schedule_timeout_interruptible(msecs_to_jiffies(1));
141
142 curout |= (1 << 12);
143 write_reg(curout, IVTV_REG_GPIO_OUT);
144 schedule_timeout_interruptible(msecs_to_jiffies(1));
145
146 return 0;
147}
148#endif
149 125
150void ivtv_gpio_init(struct ivtv *itv) 126void ivtv_gpio_init(struct ivtv *itv)
151{ 127{
diff --git a/drivers/media/video/ivtv/ivtv-gpio.h b/drivers/media/video/ivtv/ivtv-gpio.h
index c301d2a39346..b31c679bbd8e 100644
--- a/drivers/media/video/ivtv/ivtv-gpio.h
+++ b/drivers/media/video/ivtv/ivtv-gpio.h
@@ -21,5 +21,5 @@
21/* GPIO stuff */ 21/* GPIO stuff */
22void ivtv_gpio_init(struct ivtv *itv); 22void ivtv_gpio_init(struct ivtv *itv);
23void ivtv_reset_ir_gpio(struct ivtv *itv); 23void ivtv_reset_ir_gpio(struct ivtv *itv);
24int ivtv_reset_tuner_gpio(enum v4l2_tuner_type mode, void *priv, int ptr); 24int ivtv_reset_tuner_gpio(void *dev, int cmd, int value);
25int ivtv_gpio(struct ivtv *itv, unsigned int command, void *arg); 25int ivtv_gpio(struct ivtv *itv, unsigned int command, void *arg);