summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Endriss <devnull@localhost>2004-02-26 20:27:22 +0000
committerOliver Endriss <devnull@localhost>2004-02-26 20:27:22 +0000
commit374bdafbd3985cf6606b5449cb2ca37a53b38a23 (patch)
treee165dd0225094772b2ac532f2b6ecfddfde0c4a1
parentc6a1ef178f8e95f64d3422076a9561750aa467f3 (diff)
downloadmediapointer-dvb-s2-374bdafbd3985cf6606b5449cb2ca37a53b38a23.tar.gz
mediapointer-dvb-s2-374bdafbd3985cf6606b5449cb2ca37a53b38a23.tar.bz2
Added support for Fujitsu-Siemens Activy Card (Grundig tuner)
by Michael Dreher <michael@5dot1.de>, Oliver Endriss <o.endriss@gmx.de> and Andreas 'randy' Weinberger
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c78
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.c61
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.h1
3 files changed, 131 insertions, 9 deletions
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
index df1df95b4..52974ebe5 100644
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -1,3 +1,39 @@
+/*
+ * budget-core.c: driver for the SAA7146 based Budget DVB cards
+ *
+ * Compiled from various sources by Michael Hunold <michael@mihu.de>
+ *
+ * Copyright (C) 2002 Ralph Metzler <rjkm@metzlerbros.de>
+ *
+ * Copyright (C) 1999-2002 Ralph Metzler
+ * & Marcus Metzler for convergence integrated media GmbH
+ *
+ * 26feb2004 Support for FS Activy Card (Grundig tuner) by
+ * Michael Dreher <michael@5dot1.de>,
+ * Oliver Endriss <o.endriss@gmx.de>,
+ * Andreas 'randy' Weinberger
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ *
+ *
+ * the project's page is at http://www.linuxtv.org/dvb/
+ */
+
#include "budget.h"
#include "ttpci-eeprom.h"
@@ -38,10 +74,27 @@ static int start_ts_capture (struct budget *budget)
budget->tsf=0xff;
budget->ttbp=0;
- saa7146_write(dev, DD1_INIT, 0x02000600);
- saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
- saa7146_write(dev, BRS_CTRL, 0x60000000);
+ /*
+ * Signal path on the Activy:
+ *
+ * tuner -> SAA7146 port A -> SAA7146 BRS -> SAA7146 DMA3 -> memory
+ *
+ * Since the tuner feeds 204 bytes packets into the SAA7146,
+ * DMA3 is configured to strip the trailing 16 FEC bytes:
+ * Pitch: 188, NumBytes3: 188, NumLines3: 1024
+ */
+
+ if (budget->card->type == BUDGET_FS_ACTIVY) {
+ saa7146_write(dev, DD1_INIT, 0x04000000);
+ saa7146_write(dev, MC2, (MASK_09 | MASK_25));
+ saa7146_write(dev, BRS_CTRL, 0x00000000);
+ } else {
+ saa7146_write(dev, DD1_INIT, 0x02000600);
+ saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
+ saa7146_write(dev, BRS_CTRL, 0x60000000);
+ }
+
saa7146_write(dev, MC2, (MASK_08 | MASK_24));
mdelay(10);
@@ -49,9 +102,15 @@ static int start_ts_capture (struct budget *budget)
saa7146_write(dev, BASE_EVEN3, 0);
saa7146_write(dev, PROT_ADDR3, TS_WIDTH*TS_HEIGHT);
saa7146_write(dev, BASE_PAGE3, budget->pt.dma |ME1|0x90);
- saa7146_write(dev, PITCH3, TS_WIDTH);
- saa7146_write(dev, NUM_LINE_BYTE3, (TS_HEIGHT<<16)|TS_WIDTH);
+ if (budget->card->type == BUDGET_FS_ACTIVY) {
+ saa7146_write(dev, PITCH3, TS_WIDTH/2);
+ saa7146_write(dev, NUM_LINE_BYTE3, ((TS_HEIGHT*2)<<16)|(TS_WIDTH/2));
+ } else {
+ saa7146_write(dev, PITCH3, TS_WIDTH);
+ saa7146_write(dev, NUM_LINE_BYTE3, (TS_HEIGHT<<16)|TS_WIDTH);
+ }
+
saa7146_write(dev, MC2, (MASK_04 | MASK_20));
saa7146_write(dev, MC1, (MASK_04 | MASK_20)); // DMA3 on
@@ -217,7 +276,8 @@ int ttpci_budget_init (struct budget *budget,
/* the Siemens DVB needs this if you want to have the i2c chips
get recognized before the main driver is loaded */
- saa7146_write(dev, GPIO_CTRL, 0x500000);
+ if (bi->type != BUDGET_FS_ACTIVY)
+ saa7146_write(dev, GPIO_CTRL, 0x500000); /* GPIO 3 = 1 */
saa7146_i2c_adapter_prepare(dev, NULL, SAA7146_I2C_BUS_BIT_RATE_120);
@@ -242,7 +302,11 @@ int ttpci_budget_init (struct budget *budget,
tasklet_init (&budget->vpe_tasklet, vpeirq, (unsigned long) budget);
- saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI); /* frontend power on */
+ /* frontend power on */
+ if (bi->type == BUDGET_FS_ACTIVY)
+ saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI);
+ else
+ saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI);
if (budget_register(budget) == 0) {
return 0;
diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c
index 0041d94ae..d3d12822e 100644
--- a/linux/drivers/media/dvb/ttpci/budget.c
+++ b/linux/drivers/media/dvb/ttpci/budget.c
@@ -8,6 +8,11 @@
* Copyright (C) 1999-2002 Ralph Metzler
* & Marcus Metzler for convergence integrated media GmbH
*
+ * 26feb2004 Support for FS Activy Card (Grundig tuner) by
+ * Michael Dreher <michael@5dot1.de>,
+ * Oliver Endriss <o.endriss@gmx.de> and
+ * Andreas 'randy' Weinberger
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -142,6 +147,48 @@ int budget_diseqc_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
}
+/*
+ * Routines for the Fujitsu Siemens Activy budget card
+ * 22 kHz tone and DiSEqC are handled by the frontend.
+ * Voltage must be set here.
+ */
+static int SetVoltage_Activy (struct budget *budget, fe_sec_voltage_t voltage)
+{
+ struct saa7146_dev *dev=budget->dev;
+ DEB_EE(("budget: %p\n",budget));
+
+ switch (voltage) {
+ case SEC_VOLTAGE_13:
+ saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTLO);
+ break;
+ case SEC_VOLTAGE_18:
+ saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI);
+ break;
+ default:
+ return -EINVAL;
+ };
+
+ return 0;
+}
+
+
+static int budget_ioctl_activy (struct dvb_frontend *fe, unsigned int cmd, void *arg)
+{
+ struct budget *budget = fe->before_after_data;
+
+ DEB_EE(("budget: %p\n",budget));
+
+ switch (cmd) {
+ case FE_SET_VOLTAGE:
+ return SetVoltage_Activy (budget, (fe_sec_voltage_t) arg);
+ default:
+ return -EOPNOTSUPP;
+ };
+
+ return 0;
+}
+
+
static int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)
{
struct budget *budget = NULL;
@@ -160,7 +207,11 @@ static int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_
return err;
}
- dvb_add_frontend_ioctls (budget->dvb_adapter,
+ if (budget->card->type == BUDGET_FS_ACTIVY)
+ dvb_add_frontend_ioctls (budget->dvb_adapter,
+ budget_ioctl_activy, NULL, budget);
+ else
+ dvb_add_frontend_ioctls (budget->dvb_adapter,
budget_diseqc_ioctl, NULL, budget);
dev->ext_priv = budget;
@@ -174,7 +225,11 @@ static int budget_detach (struct saa7146_dev* dev)
struct budget *budget = (struct budget*) dev->ext_priv;
int err;
- dvb_remove_frontend_ioctls (budget->dvb_adapter,
+ if (budget->card->type == BUDGET_FS_ACTIVY)
+ dvb_remove_frontend_ioctls (budget->dvb_adapter,
+ budget_ioctl_activy, NULL);
+ else
+ dvb_remove_frontend_ioctls (budget->dvb_adapter,
budget_diseqc_ioctl, NULL);
err = ttpci_budget_deinit (budget);
@@ -193,6 +248,7 @@ 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(satel, "SATELCO Multimedia PCI", BUDGET_TT_HW_DISEQC);
+MAKE_BUDGET_INFO(fsacs, "Fujitsu Siemens Activy Budget-S PCI", BUDGET_FS_ACTIVY);
/* Uncomment for Budget Patch */
/*MAKE_BUDGET_INFO(fs_1_3,"Siemens/Technotrend/Hauppauge PCI rev1.3+Budget_Patch", BUDGET_PATCH);*/
@@ -203,6 +259,7 @@ static struct pci_device_id pci_tbl[] = {
MAKE_EXTENSION_PCI(ttbc, 0x13c2, 0x1004),
MAKE_EXTENSION_PCI(ttbt, 0x13c2, 0x1005),
MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013),
+ MAKE_EXTENSION_PCI(fsacs, 0x1131, 0x4f61),
{
.vendor = 0,
}
diff --git a/linux/drivers/media/dvb/ttpci/budget.h b/linux/drivers/media/dvb/ttpci/budget.h
index 0af6725c1..3c730423d 100644
--- a/linux/drivers/media/dvb/ttpci/budget.h
+++ b/linux/drivers/media/dvb/ttpci/budget.h
@@ -73,6 +73,7 @@ static struct saa7146_pci_extension_data x_var = { \
#define BUDGET_TT_HW_DISEQC 1
#define BUDGET_KNC1 2
#define BUDGET_PATCH 3
+#define BUDGET_FS_ACTIVY 4
extern int ttpci_budget_init (struct budget *budget,