summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2004-03-19 17:13:54 +0000
committerJohannes Stezenbach <devnull@localhost>2004-03-19 17:13:54 +0000
commit7d9a2810f1565116411b198b0e6087f3b1e6090f (patch)
tree7d4c733d653a095bb1502918b4ff3bb2f4c33d73 /linux/drivers/media/dvb/ttpci
parent5e5a147d453e63c0592b18c3ab4bc6e39bcc8e5f (diff)
downloadmediapointer-dvb-s2-7d9a2810f1565116411b198b0e6087f3b1e6090f.tar.gz
mediapointer-dvb-s2-7d9a2810f1565116411b198b0e6087f3b1e6090f.tar.bz2
patch by Kenneth Aafløy to add support for Typhoon DVB-S budget card
Diffstat (limited to 'linux/drivers/media/dvb/ttpci')
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-av.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c
index e51daed59..53a5e88a4 100644
--- a/linux/drivers/media/dvb/ttpci/budget-av.c
+++ b/linux/drivers/media/dvb/ttpci/budget-av.c
@@ -39,6 +39,7 @@ struct budget_av {
struct budget budget;
struct video_device vd;
int cur_input;
+ int has_saa7113;
};
/****************************************************************************
@@ -149,6 +150,9 @@ static int saa7113_setinput (struct budget_av *budget_av, int input)
{
struct budget *budget = &budget_av->budget;
+ if ( 1 != budget_av->has_saa7113 )
+ return -ENODEV;
+
if (input == 1) {
i2c_writereg(budget->i2c_bus, 0x4a, 0x02, 0xc7);
i2c_writereg(budget->i2c_bus, 0x4a, 0x09, 0x80);
@@ -170,11 +174,13 @@ static int budget_av_detach (struct saa7146_dev *dev)
DEB_EE(("dev: %p\n",dev));
- saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
+ if ( 1 == budget_av->has_saa7113 ) {
+ saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
- dvb_delay(200);
+ dvb_delay(200);
- saa7146_unregister_device (&budget_av->vd, dev);
+ saa7146_unregister_device (&budget_av->vd, dev);
+ }
err = ttpci_budget_deinit (&budget_av->budget);
@@ -221,39 +227,34 @@ static int budget_av_attach (struct saa7146_dev* dev,
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI);
dvb_delay(500);
- if ((err = saa7113_init (budget_av))) {
- /* fixme: proper cleanup here */
- ERR(("cannot init saa7113.\n"));
- return err;
- }
-
- if ( 0 != saa7146_vv_init(dev,&vv_data)) {
- /* fixme: proper cleanup here */
- ERR(("cannot init vv subsystem.\n"));
- return err;
- }
-
- if ((err = saa7146_register_device(&budget_av->vd, dev, "knc1",
- VFL_TYPE_GRABBER)))
- {
- /* fixme: proper cleanup here */
- ERR(("cannot register capture v4l2 device.\n"));
- return err;
+ if ( 0 == saa7113_init(budget_av) ) {
+ budget_av->has_saa7113 = 1;
+
+ if ( 0 != saa7146_vv_init(dev,&vv_data)) {
+ /* fixme: proper cleanup here */
+ ERR(("cannot init vv subsystem.\n"));
+ return err;
+ }
+
+ if ((err = saa7146_register_device(&budget_av->vd, dev, "knc1",
+ VFL_TYPE_GRABBER)))
+ {
+ /* fixme: proper cleanup here */
+ ERR(("cannot register capture v4l2 device.\n"));
+ return err;
+ }
+
+ /* beware: this modifies dev->vv ... */
+ saa7146_set_hps_source_and_sync(dev, SAA7146_HPS_SOURCE_PORT_A,
+ SAA7146_HPS_SYNC_PORT_A);
+
+ saa7113_setinput (budget_av, 0);
+ } else {
+ budget_av->has_saa7113 = 0;
+
+ saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
}
- /* beware: this modifies dev->vv ... */
- saa7146_set_hps_source_and_sync(dev, SAA7146_HPS_SOURCE_PORT_A,
- SAA7146_HPS_SYNC_PORT_A);
-
- saa7113_setinput (budget_av, 0);
-
- /* what is this? since we don't support open()/close()
- notifications, we simply put this into the release handler... */
-/*
- saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (20);
-*/
/* fixme: find some sane values here... */
saa7146_write(dev, PCI_BT_V1, 0x1c00101f);