summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/ttpci-budget/budget-av.c27
-rw-r--r--linux/drivers/media/dvb/ttpci-budget/budget-core.c8
-rw-r--r--linux/drivers/media/dvb/ttpci-budget/budget.c97
-rw-r--r--linux/drivers/media/dvb/ttpci-budget/budget.h23
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c1
5 files changed, 41 insertions, 115 deletions
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget-av.c b/linux/drivers/media/dvb/ttpci-budget/budget-av.c
index ea5f16615..39886ff4f 100644
--- a/linux/drivers/media/dvb/ttpci-budget/budget-av.c
+++ b/linux/drivers/media/dvb/ttpci-budget/budget-av.c
@@ -39,28 +39,11 @@
static struct saa7146_extension budget_extension;
-struct budget_info knc1_info = {
- .name = "KNC1 DVB-S",
- .type = DVB_CARD_KNC1,
-};
-
-static
-struct saa7146_pci_extension_data knc1 = {
- .ext_priv = &knc1_info,
- .ext = &budget_extension,
-};
+MAKE_BUDGET_INFO(knc1, "KNC1 DVB-S", BUDGET_KNC1);
static
struct pci_device_id devices[] = {
- {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x1131,
- .subdevice = 0x4f56,
- .driver_data = (unsigned long)&knc1,
- }, {
- .vendor = 0,
- }
+ MAKE_BUDGET_PCI(knc1, 0x1131, 0x4f56),
};
struct budget_av_data
@@ -201,7 +184,7 @@ int av_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)
struct budget_info *bi = info->ext_priv;
DEB_EE(("dev: %p\n",dev));
- if (bi->type != DVB_CARD_KNC1) {
+ if (bi->type != BUDGET_KNC1) {
return -1;
}
@@ -289,7 +272,7 @@ static int av_ioctl(struct saa7146_dev *dev, unsigned int cmd, void *arg)
if( i->index < 0 || i->index >= KNC1_INPUTS) {
return -EINVAL;
}
- if( DVB_CARD_KNC1 == budget->card->type ) {
+ if( BUDGET_KNC1 == budget->card->type ) {
memcpy(i, &knc1_inputs[i->index], sizeof(struct v4l2_input));
} else {
return -EINVAL;
@@ -315,7 +298,7 @@ static int av_ioctl(struct saa7146_dev *dev, unsigned int cmd, void *arg)
return -EINVAL;
}
- if( DVB_CARD_KNC1 == budget->card->type ) {
+ if( BUDGET_KNC1 == budget->card->type ) {
knc1_setinput(budget, input);
} else {
return -EINVAL;
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget-core.c b/linux/drivers/media/dvb/ttpci-budget/budget-core.c
index b3d19c072..e657885da 100644
--- a/linux/drivers/media/dvb/ttpci-budget/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci-budget/budget-core.c
@@ -308,8 +308,9 @@ int budget_register(struct budget_s *budget)
budget->registered=1;
- /* init DiSEqC stuff */
- dvb_add_frontend_ioctls (budget->dvb_adapter, budget_diseqc_ioctl, NULL, budget);
+ /* init DiSEqC stuff if necessary */
+ if(budget->card->type == BUDGET_TT)
+ dvb_add_frontend_ioctls (budget->dvb_adapter, budget_diseqc_ioctl, NULL, budget);
memcpy(budget->demux_id, "demux0_0", 9);
budget->demux_id[7]=budget->dvb_adapter->num+0x30;
@@ -385,7 +386,8 @@ dvb_unregister(struct budget_s *budget)
dvb_dmxdev_release(&budget->dmxdev);
dvb_dmx_release(&budget->demux);
- dvb_remove_frontend_ioctls (budget->dvb_adapter, budget_diseqc_ioctl, NULL);
+ if(budget->card->type == BUDGET_TT)
+ dvb_remove_frontend_ioctls (budget->dvb_adapter, budget_diseqc_ioctl, NULL);
}
static
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget.c b/linux/drivers/media/dvb/ttpci-budget/budget.c
index 550936044..ad5ef61c5 100644
--- a/linux/drivers/media/dvb/ttpci-budget/budget.c
+++ b/linux/drivers/media/dvb/ttpci-budget/budget.c
@@ -36,95 +36,20 @@
static struct saa7146_extension budget_extension;
-struct budget_info ttbs_info = {
- .name = "TT-Budget/WinTV-NOVA-S PCI",
- .type = DVB_CARD_TT_BUDGET,
-};
-struct budget_info ttbc_info = {
- .name = "TT-Budget/WinTV-NOVA-C PCI",
- .type = DVB_CARD_TT_BUDGET,
-};
-struct budget_info ttbt_info = {
- .name = "TT-Budget/WinTV-NOVA-T PCI",
- .type = DVB_CARD_TT_BUDGET,
-};
-struct budget_info ttbci_info = {
- .name = "TT-Budget/WinTV-NOVA-CI PCI",
- .type = DVB_CARD_TT_BUDGET,
-};
-struct budget_info satel_info = {
- .name = "SATELCO Multimedia PCI",
- .type = DVB_CARD_TT_BUDGET_CI,
-};
-
-static
-struct saa7146_pci_extension_data ttbs = {
- .ext_priv = &ttbs_info,
- .ext = &budget_extension,
-};
-static
-struct saa7146_pci_extension_data ttbc = {
- .ext_priv = &ttbc_info,
- .ext = &budget_extension,
-};
-static
-struct saa7146_pci_extension_data ttbt = {
- .ext_priv = &ttbt_info,
- .ext = &budget_extension,
-};
-static
-struct saa7146_pci_extension_data ttbci = {
- .ext_priv = &ttbci_info,
- .ext = &budget_extension,
-};
-static
-struct saa7146_pci_extension_data satel = {
- .ext_priv = &satel_info,
- .ext = &budget_extension,
-};
+MAKE_BUDGET_INFO(ttbs, "TT-Budget/WinTV-NOVA-S PCI", BUDGET_TT);
+MAKE_BUDGET_INFO(ttbc, "TT-Budget/WinTV-NOVA-C PCI", BUDGET_TT);
+MAKE_BUDGET_INFO(ttbt, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT);
+MAKE_BUDGET_INFO(ttbci, "TT-Budget/WinTV-NOVA-CI PCI", BUDGET_TT_HW_DISEQC);
+MAKE_BUDGET_INFO(satel, "SATELCO Multimedia PCI", BUDGET_TT_HW_DISEQC);
static
struct pci_device_id pci_tbl[] = {
- {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x13c2,
- .subdevice = 0x1003,
- .driver_data = (unsigned long)&ttbs,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x13c2,
- .subdevice = 0x1004,
- .driver_data = (unsigned long)&ttbc,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x13c2,
- .subdevice = 0x1005,
- .driver_data = (unsigned long)&ttbt,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- /* TT_BUDGET_CI without CI (connector not soldered in) */
- .subvendor = 0x13c2,
- .subdevice = 0x100f,
- .driver_data = (unsigned long)&ttbci,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x13c2,
- .subdevice = 0x100c,
- .driver_data = (unsigned long)&ttbci,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x13c2,
- .subdevice = 0x1013,
- .driver_data = (unsigned long)&satel,
- }, {
- .vendor = 0,
- }
+ MAKE_BUDGET_PCI(ttbs, 0x13c2, 0x1003),
+ MAKE_BUDGET_PCI(ttbc, 0x13c2, 0x1004),
+ MAKE_BUDGET_PCI(ttbt, 0x13c2, 0x1005),
+ MAKE_BUDGET_PCI(ttbci, 0x13c2, 0x100f), /* TT_BUDGET_CI without CI (connector not soldered in) */
+ MAKE_BUDGET_PCI(ttbci, 0x13c2, 0x100c),
+ MAKE_BUDGET_PCI(satel, 0x13c2, 0x1013),
};
static
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget.h b/linux/drivers/media/dvb/ttpci-budget/budget.h
index d22f9391c..ea66eeb47 100644
--- a/linux/drivers/media/dvb/ttpci-budget/budget.h
+++ b/linux/drivers/media/dvb/ttpci-budget/budget.h
@@ -66,13 +66,30 @@ struct budget_s {
void *priv;
};
+#define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
+static struct budget_info x_var ## _info = { \
+ .name=x_name, \
+ .type=x_type }; \
+static struct saa7146_pci_extension_data x_var = { \
+ .ext_priv = &x_var ## _info, \
+ .ext = &budget_extension };
+
+#define MAKE_BUDGET_PCI(x_var, x_vendor, x_device) \
+ { \
+ .vendor = PCI_VENDOR_ID_PHILIPS, \
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7146, \
+ .subvendor = x_vendor, \
+ .subdevice = x_device, \
+ .driver_data = (unsigned long)& x_var, \
+ }
+
#define TS_WIDTH (4*188)
#define TS_HEIGHT (1024/4)
#define TS_BUFLEN (TS_WIDTH*TS_HEIGHT)
-#define DVB_CARD_TT_BUDGET 0
-#define DVB_CARD_TT_BUDGET_CI 1
-#define DVB_CARD_KNC1 2
+#define BUDGET_TT 0
+#define BUDGET_TT_HW_DISEQC 1
+#define BUDGET_KNC1 2
int budget_probe(struct saa7146_dev *, unsigned int subvendor, unsigned int subdevice);
void budget_irq(struct saa7146_dev *, u32 *isr);
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 7773cd91b..aad57df96 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -4490,7 +4490,6 @@ struct pci_device_id pci_tbl[] = {
static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
{
av7110_t *av7110 = (av7110_t*)dev->ext_priv;
- printk("std_callback\n");
if (std->id == V4L2_STD_PAL) {
av7110->vidmode = VIDEO_MODE_PAL;
SetMode(av7110, av7110->vidmode);