summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2006-09-25 12:43:45 -0300
committerSteven Toth <stoth@hauppauge.com>2006-09-25 12:43:45 -0300
commitb887c4748e26f436ab35da8d0cb12baa4c0d2426 (patch)
treeabc4b860417011a1a6f58941794c9c1c37c50cc2 /linux/drivers/media/video/cx88
parent9092a672ca84b9625c2f7ed1ec5479505baffdb0 (diff)
downloadmediapointer-dvb-s2-b887c4748e26f436ab35da8d0cb12baa4c0d2426.tar.gz
mediapointer-dvb-s2-b887c4748e26f436ab35da8d0cb12baa4c0d2426.tar.bz2
Changed cx88_board .dvb and .register to an enum.
From: Steven Toth <stoth@hauppauge.com> Some basic cleanup in preperation for a future patch where the cx88-mpeg functions have to deal with the port being used by multiple frontends in (mpeg2 hw encoder and dvb demod). Signed-off-by: Steven Toth <stoth@hauppauge.com>
Diffstat (limited to 'linux/drivers/media/video/cx88')
-rw-r--r--linux/drivers/media/video/cx88/cx88-blackbird.c2
-rw-r--r--linux/drivers/media/video/cx88/cx88-cards.c72
-rw-r--r--linux/drivers/media/video/cx88/cx88-dvb.c2
-rw-r--r--linux/drivers/media/video/cx88/cx88-i2c.c2
-rw-r--r--linux/drivers/media/video/cx88/cx88-mpeg.c13
-rw-r--r--linux/drivers/media/video/cx88/cx88-tvaudio.c4
-rw-r--r--linux/drivers/media/video/cx88/cx88.h9
7 files changed, 59 insertions, 45 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c
index 87abc4873..ccf36f17e 100644
--- a/linux/drivers/media/video/cx88/cx88-blackbird.c
+++ b/linux/drivers/media/video/cx88/cx88-blackbird.c
@@ -1123,7 +1123,7 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev,
return -EINVAL;
err = -ENODEV;
- if (!cx88_boards[core->board].blackbird)
+ if (!(cx88_boards[core->board].mpeg & CX88_BOARD_BLACKBIRD))
goto fail_core;
err = -ENOMEM;
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c
index f15233766..028be78a2 100644
--- a/linux/drivers/media/video/cx88/cx88-cards.c
+++ b/linux/drivers/media/video/cx88/cx88-cards.c
@@ -295,7 +295,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_RADIO,
.gpio0 = 0x0000bd62,
},
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_IODATA_GVVCP3PCI] = {
.name = "IODATA GV-VCP3/PCI",
@@ -359,7 +359,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_RADIO,
.gpio0 = 0x0000fde2,
},
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_MSI_TVANYWHERE] = {
.name = "MSI TV-@nywhere",
@@ -402,7 +402,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x0700,
.gpio2 = 0x0101,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
.name = "DViCO FusionHDTV DVB-T1",
@@ -419,7 +419,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x000027df,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_KWORLD_LTV883] = {
.name = "KWorld LTV883RF",
@@ -489,7 +489,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x0f00,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_HAUPPAUGE_DVB_T1] = {
.name = "Hauppauge Nova-T DVB-T",
@@ -501,7 +501,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_DVB,
.vmux = 0,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_CONEXANT_DVB_T1] = {
.name = "Conexant DVB-T reference design",
@@ -513,7 +513,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_DVB,
.vmux = 0,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_PROVIDEO_PV259] = {
.name = "Provideo PV259",
@@ -525,7 +525,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
}},
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
.name = "DViCO FusionHDTV DVB-T Plus",
@@ -542,7 +542,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x000027df,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_DNTV_LIVE_DVB_T] = {
.name = "digitalnow DNTV Live! DVB-T",
@@ -561,7 +561,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x00000700,
.gpio2 = 0x00000101,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_PCHDTV_HD3000] = {
.name = "pcHDTV HD3000 HDTV",
@@ -600,7 +600,7 @@ struct cx88_board cx88_boards[] = {
.gpio2 = 0x00000000,
.gpio3 = 0x00000000,
},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_HAUPPAUGE_ROSLYN] = {
// entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
@@ -634,7 +634,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0xed96,
.gpio2 = 0x00ff,
},
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_DIGITALLOGIC_MEC] = {
.name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
@@ -660,7 +660,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_RADIO,
.gpio0 = 0x00009d00,
},
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_IODATA_GVBCTV7E] = {
.name = "IODATA GV/BCTV7E",
@@ -728,7 +728,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x97e9,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_ADSTECH_DVB_T_PCI] = {
.name = "ADS Tech Instant TV DVB-T PCI",
@@ -747,7 +747,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x0700,
.gpio2 = 0x0101,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
.name = "TerraTec Cinergy 1400 DVB-T",
@@ -756,7 +756,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_DVB,
.vmux = 0,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = {
.name = "DViCO FusionHDTV 5 Gold",
@@ -778,7 +778,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x87f9,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = {
.name = "AverMedia UltraTV Media Center PCI 550",
@@ -787,7 +787,7 @@ struct cx88_board cx88_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.tda9887_conf = TDA9887_PRESENT,
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
.input = {{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 0,
@@ -855,7 +855,7 @@ struct cx88_board cx88_boards[] = {
.gpio2 = 0x00000001,
.gpio3 = 0x00000000,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_WINFAST_DTV1000] = {
.name = "WinFast DTV1000-T",
@@ -867,7 +867,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_DVB,
.vmux = 0,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_AVERTV_303] = {
.name = "AVerTV 303 (M126)",
@@ -915,7 +915,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_HAUPPAUGE_NOVASE2_S1] = {
.name = "Hauppauge Nova-SE2 DVB-S",
@@ -927,7 +927,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_DVB,
.vmux = 0,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_KWORLD_DVBS_100] = {
.name = "KWorld DVB-S 100",
@@ -945,7 +945,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_HAUPPAUGE_HVR1100] = {
.name = "Hauppauge WinTV-HVR1100 DVB-T/Hybrid",
@@ -965,7 +965,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
}},
/* fixme: Add radio support */
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_HAUPPAUGE_HVR1100LP] = {
.name = "Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile)",
@@ -982,7 +982,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 1,
}},
/* fixme: Add radio support */
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_DNTV_LIVE_DVB_T_PRO] = {
.name = "digitalnow DNTV Live! DVB-T Pro",
@@ -1009,7 +1009,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_RADIO,
.gpio0 = 0xf80808,
},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_KWORLD_DVB_T_CX22702] = {
/* Kworld V-stream Xpert DVB-T with Thomson tuner */
@@ -1031,7 +1031,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x0700,
.gpio2 = 0x0101,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL] = {
.name = "DViCO FusionHDTV DVB-T Dual Digital",
@@ -1048,7 +1048,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x000067df,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT] = {
/* FIXME: Audio not working for s-video / composite inputs. */
@@ -1076,7 +1076,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x3de6,
.gpio2 = 0x00ff,
},
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID] = {
.name = "DViCO FusionHDTV DVB-T Hybrid",
@@ -1097,7 +1097,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x0000a75b,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_PCHDTV_HD5500] = {
.name = "pcHDTV HD5500 HDTV",
@@ -1119,7 +1119,7 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x87f9,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_KWORLD_MCE200_DELUXE] = {
/* FIXME: tested TV input only, disabled composite,
@@ -1151,7 +1151,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_RADIO,
},
#endif
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_PIXELVIEW_PLAYTV_P7000] = {
/* FIXME: SVideo, Composite and FM inputs are untested */
@@ -1183,7 +1183,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x5da3,
},
#endif
- .blackbird = 1,
+ .mpeg = CX88_BOARD_BLACKBIRD,
},
[CX88_BOARD_NPGTECH_REALTV_TOP10FM] = {
.name = "NPG Tech Real TV FM Top 10",
@@ -1225,7 +1225,7 @@ struct cx88_board cx88_boards[] = {
.gpio2 = 0x00017304,
.gpio3 = 0x02000000,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_GENIATECH_DVBS] = {
.name = "Geniatech DVB-S",
@@ -1240,7 +1240,7 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
}},
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
[CX88_BOARD_HAUPPAUGE_HVR3000] = {
/* FIXME: Add dvb & radio support */
@@ -1335,7 +1335,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0xe780,
}},
/* fixme: Add radio support */
- .dvb = 1,
+ .mpeg = CX88_BOARD_DVB,
},
};
const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c
index 8dbcc95ca..268643a04 100644
--- a/linux/drivers/media/video/cx88/cx88-dvb.c
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -803,7 +803,7 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev,
return -EINVAL;
err = -ENODEV;
- if (!cx88_boards[core->board].dvb)
+ if (!(cx88_boards[core->board].mpeg & CX88_BOARD_DVB))
goto fail_core;
err = -ENOMEM;
diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c
index 02564deb9..74768adbc 100644
--- a/linux/drivers/media/video/cx88/cx88-i2c.c
+++ b/linux/drivers/media/video/cx88/cx88-i2c.c
@@ -237,7 +237,7 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
core->i2c_adap.class |= I2C_CLASS_TV_ANALOG;
#endif
#ifdef I2C_CLASS_TV_DIGITAL
- if (cx88_boards[core->board].dvb)
+ if (cx88_boards[core->board].mpeg & CX88_BOARD_DVB)
core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL;
#endif
diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c
index b5f12bd13..1ade6a56f 100644
--- a/linux/drivers/media/video/cx88/cx88-mpeg.c
+++ b/linux/drivers/media/video/cx88/cx88-mpeg.c
@@ -75,8 +75,17 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
/* FIXME: this needs a review.
* also: move to cx88-blackbird + cx88-dvb source files? */
+ if (cx88_boards[core->board].mpeg == (CX88_BOARD_DVB | CX88_BOARD_BLACKBIRD) ) {
+ /* Report a warning until the mini driver patch is applied,
+ * else the following conditions will set the dma registers incorrectly.
+ * This will be removed in the next major patch and changes to the conditions
+ * will be made.
+ */
+ printk(KERN_INFO "%s() board->(CX88_BOARD_DVB | CX88_BOARD_BLACKBIRD) is invalid\n", __FUNCTION__);
+ return -EINVAL;
+ }
- if (cx88_boards[core->board].dvb) {
+ if (cx88_boards[core->board].mpeg & CX88_BOARD_DVB) {
/* negedge driven & software reset */
cx_write(TS_GEN_CNTRL, 0x0040 | dev->ts_gen_cntrl);
udelay(100);
@@ -102,7 +111,7 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
udelay(100);
}
- if (cx88_boards[core->board].blackbird) {
+ if (cx88_boards[core->board].mpeg & CX88_BOARD_BLACKBIRD) {
cx_write(MO_PINMUX_IO, 0x88); /* enable MPEG parallel IO */
#if 0
diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c
index bb14a3598..b2272a1c6 100644
--- a/linux/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c
@@ -145,7 +145,7 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
cx_write(AUD_RATE_THRES_DMD, 0x000000C0);
cx88_start_audio_dma(core);
- if (cx88_boards[core->board].blackbird) {
+ if (cx88_boards[core->board].mpeg & CX88_BOARD_BLACKBIRD) {
/* sets sound input from external adc */
switch (core->board) {
case CX88_BOARD_HAUPPAUGE_ROSLYN:
@@ -167,7 +167,7 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
cx_write(AUD_I2SCNTL, 0);
/* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
}
- if ((always_analog) || (!cx88_boards[core->board].blackbird)) {
+ if ((always_analog) || (!(cx88_boards[core->board].mpeg & CX88_BOARD_BLACKBIRD))) {
ctl |= EN_DAC_ENABLE;
cx_write(AUD_CTL, ctl);
}
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index f46721123..a257adc90 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -79,6 +79,12 @@ enum cx88_deemph_type {
FM_DEEMPH_75
};
+enum cx88_board_type {
+ CX88_BOARD_NONE = 0,
+ CX88_BOARD_DVB,
+ CX88_BOARD_BLACKBIRD
+};
+
/* ----------------------------------------------------------- */
/* tv norms */
@@ -239,8 +245,7 @@ struct cx88_board {
int tda9887_conf;
struct cx88_input input[MAX_CX88_INPUT];
struct cx88_input radio;
- unsigned int blackbird:1;
- unsigned int dvb:1;
+ enum cx88_board_type mpeg;
enum audiochip audio_chip;
};