summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-11-03 09:04:50 +0000
committerGerd Knorr <devnull@localhost>2004-11-03 09:04:50 +0000
commit5c11d159f1e04623e962b2338c05e7e7986da8a7 (patch)
tree6a49c1862fc0aea2716e8b5d8e62c4bee04079c5
parentb8c933a4132a513316cf1a0dcaa898af0aa27640 (diff)
downloadmediapointer-dvb-s2-5c11d159f1e04623e962b2338c05e7e7986da8a7.tar.gz
mediapointer-dvb-s2-5c11d159f1e04623e962b2338c05e7e7986da8a7.tar.bz2
- cx88: fix/add dvb cards by Christopher Pascoe
- saa7134: new card - misc minor fixes.
-rw-r--r--linux/drivers/media/video/bttv-driver.c3
-rw-r--r--linux/drivers/media/video/bttv-gpio.c5
-rw-r--r--linux/drivers/media/video/cx88/cx88-cards.c24
-rw-r--r--linux/drivers/media/video/cx88/cx88-dvb.c113
-rw-r--r--linux/drivers/media/video/cx88/cx88.h3
-rw-r--r--linux/drivers/media/video/ir-kbd-i2c.c12
-rw-r--r--linux/drivers/media/video/msp3400-driver.c4
-rw-r--r--linux/drivers/media/video/msp3400.c4
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c33
-rw-r--r--linux/drivers/media/video/saa7134/saa7134.h3
10 files changed, 167 insertions, 37 deletions
diff --git a/linux/drivers/media/video/bttv-driver.c b/linux/drivers/media/video/bttv-driver.c
index d2fe84447..64c7719a6 100644
--- a/linux/drivers/media/video/bttv-driver.c
+++ b/linux/drivers/media/video/bttv-driver.c
@@ -1,6 +1,5 @@
-
/*
- $Id: bttv-driver.c,v 1.24 2004/10/25 11:26:36 kraxel Exp $
+ $Id: bttv-driver.c,v 1.25 2004/11/03 09:04:50 kraxel Exp $
bttv - Bt848 frame grabber driver
diff --git a/linux/drivers/media/video/bttv-gpio.c b/linux/drivers/media/video/bttv-gpio.c
index 1f1a66daf..ef6744232 100644
--- a/linux/drivers/media/video/bttv-gpio.c
+++ b/linux/drivers/media/video/bttv-gpio.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-gpio.c,v 1.5 2004/10/27 18:34:55 kraxel Exp $
+ $Id: bttv-gpio.c,v 1.6 2004/11/03 09:04:50 kraxel Exp $
bttv-gpio.c -- gpio sub drivers
@@ -134,8 +134,7 @@ int bttv_sub_register(struct bttv_sub_driver *sub, char *wanted)
{
sub->drv.bus = &bttv_sub_bus_type;
snprintf(sub->wanted,sizeof(sub->wanted),"%s",wanted);
- driver_register(&sub->drv);
- return 0;
+ return driver_register(&sub->drv);
}
EXPORT_SYMBOL(bttv_sub_register);
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c
index 8478d28b2..01413b045 100644
--- a/linux/drivers/media/video/cx88/cx88-cards.c
+++ b/linux/drivers/media/video/cx88/cx88-cards.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-cards.c,v 1.46 2004/10/19 16:02:04 kraxel Exp $
+ * $Id: cx88-cards.c,v 1.47 2004/11/03 09:04:50 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* card-specific stuff.
@@ -336,11 +336,11 @@ struct cx88_board cx88_boards[] = {
.tuner_type = TUNER_ABSENT, /* No analog tuner */
.input = {{
.type = CX88_VMUX_COMPOSITE1,
- .vmux = 0,
+ .vmux = 1,
.gpio0 = 0x000027df,
},{
.type = CX88_VMUX_SVIDEO,
- .vmux = 1,
+ .vmux = 2,
.gpio0 = 0x000027df,
}},
.dvb = 1,
@@ -438,6 +438,20 @@ struct cx88_board cx88_boards[] = {
}},
.blackbird = 1,
},
+ [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
+ .name = "DVICO FusionHDTV DVB-T Plus",
+ .tuner_type = TUNER_ABSENT, /* No analog tuner */
+ .input = {{
+ .type = CX88_VMUX_COMPOSITE1,
+ .vmux = 1,
+ .gpio0 = 0x000027df,
+ },{
+ .type = CX88_VMUX_SVIDEO,
+ .vmux = 2,
+ .gpio0 = 0x000027df,
+ }},
+ .dvb = 1,
+ },
};
const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
@@ -525,6 +539,10 @@ struct cx88_subid cx88_subids[] = {
.subvendor = 0x1540,
.subdevice = 0x2580,
.card = CX88_BOARD_PROVIDEO_PV259,
+ },{
+ .subvendor = 0x18AC,
+ .subdevice = 0xDB10,
+ .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
}
};
const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c
index 87c800399..6a85830f3 100644
--- a/linux/drivers/media/video/cx88/cx88-dvb.c
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-dvb.c,v 1.15 2004/10/20 17:44:24 kraxel Exp $
+ * $Id: cx88-dvb.c,v 1.16 2004/11/03 09:04:51 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* MPEG Transport Stream (DVB) routines
@@ -33,6 +33,7 @@
#include "cx88.h"
#include "cx22702.h"
#include "mt352.h"
+#include "mt352_priv.h" /* FIXME */
MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
@@ -88,24 +89,93 @@ struct videobuf_queue_ops dvb_qops = {
/* ------------------------------------------------------------------ */
-static int dvico_fusionhdtv_init(struct dvb_frontend* fe)
+static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
{
- printk("FIXME: %s\n",__FUNCTION__);
+ static u8 mt352_clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
+ static u8 mt352_reset [] = { RESET, 0x80 };
+ static u8 mt352_adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
+ static u8 mt352_agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
+ static u8 mt352_gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
+ static u8 mt352_capt_range_cfg[] = { CAPT_RANGE, 0x32 };
+
+ mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config));
+ udelay(200);
+ mt352_write(fe, mt352_reset, sizeof(mt352_reset));
+ mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
+
+ mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg));
+ mt352_write(fe, mt352_gpp_ctl_cfg, sizeof(mt352_gpp_ctl_cfg));
+ mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
+
+ return 0;
+}
+
+static int lg_z201_pll_set(struct dvb_frontend* fe,
+ struct dvb_frontend_parameters* params, u8* pllbuf)
+{
+ u32 div;
+ unsigned char cp = 0;
+ unsigned char bs = 0;
+
+ #define IF_FREQUENCYx6 217 /* 6 * 36.16666666667MHz */
+ div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
+
+ if (params->frequency < 542000000) cp = 0xbc;
+ else if (params->frequency < 830000000) cp = 0xf4;
+ else cp = 0xfc;
+
+ if (params->frequency == 0) bs = 0x03;
+ else if (params->frequency < 157500000) bs = 0x01;
+ else if (params->frequency < 443250000) bs = 0x02;
+ else bs = 0x04;
+
+ pllbuf[0] = 0xC2; /* Note: non-linux standard PLL I2C address */
+ pllbuf[1] = div >> 8;
+ pllbuf[2] = div & 0xff;
+ pllbuf[3] = cp;
+ pllbuf[4] = bs;
+
return 0;
}
-static int dvico_fusionhdtv_pll_set(struct dvb_frontend* fe,
- struct dvb_frontend_parameters* params,
- u8* pllbuf)
+static int thomson_dtt7579_pll_set(struct dvb_frontend* fe,
+ struct dvb_frontend_parameters* params,
+ u8* pllbuf)
{
- printk("FIXME: %s\n",__FUNCTION__);
+ u32 div;
+ unsigned char cp = 0;
+ unsigned char bs = 0;
+
+ #define IF_FREQUENCYx6 217 /* 6 * 36.16666666667MHz */
+ div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
+
+ if (params->frequency < 542000000) cp = 0xb4;
+ else if (params->frequency < 771000000) cp = 0xbc;
+ else cp = 0xf4;
+
+ if (params->frequency == 0) bs = 0x03;
+ else if (params->frequency < 443250000) bs = 0x02;
+ else bs = 0x08;
+
+ pllbuf[0] = 0xc0; // Note: non-linux standard PLL i2c address
+ pllbuf[1] = div >> 8;
+ pllbuf[2] = div & 0xff;
+ pllbuf[3] = cp;
+ pllbuf[4] = bs;
+
return 0;
}
-struct mt352_config dvico_fusionhdtv = {
- .demod_address = 42,
- .demod_init = dvico_fusionhdtv_init,
- .pll_set = dvico_fusionhdtv_pll_set,
+struct mt352_config dvico_fusionhdtv_dvbt1 = {
+ .demod_address = 0x0F,
+ .demod_init = dvico_fusionhdtv_demod_init,
+ .pll_set = lg_z201_pll_set,
+};
+
+struct mt352_config dvico_fusionhdtv_dvbt_plus = {
+ .demod_address = 0x0F,
+ .demod_init = dvico_fusionhdtv_demod_init,
+ .pll_set = thomson_dtt7579_pll_set,
};
static int dvb_register(struct cx8802_dev *dev)
@@ -124,17 +194,34 @@ static int dvb_register(struct cx8802_dev *dev)
dev->core->demod_addr);
break;
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
- dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv,
+ dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv_dvbt1,
+ &dev->core->i2c_adap);
+ if (dev->dvb.frontend) {
+ dev->dvb.frontend->ops->info.frequency_min = 174000000;
+ dev->dvb.frontend->ops->info.frequency_max = 862000000;
+ }
+ break;
+ case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
+ dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv_dvbt_plus,
&dev->core->i2c_adap);
+ if (dev->dvb.frontend) {
+ dev->dvb.frontend->ops->info.frequency_min = 174000000;
+ dev->dvb.frontend->ops->info.frequency_max = 862000000;
+ }
break;
default:
- printk("%s: FIXME: frontend handing not here yet ...\n",
+ printk("%s: FIXME: frontend handling not here yet ...\n",
dev->core->name);
break;
}
if (NULL == dev->dvb.frontend)
return -1;
+ /* Copy the board name into the DVB structure */
+ strlcpy(dev->dvb.frontend->ops->info.name,
+ cx88_boards[dev->core->board].name,
+ sizeof(dev->dvb.frontend->ops->info.name));
+
/* register everything */
return videobuf_dvb_register(&dev->dvb);
}
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index 8dcb768c8..8100f5d4d 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -1,5 +1,5 @@
/*
- * $Id: cx88.h,v 1.39 2004/10/25 11:26:36 kraxel Exp $
+ * $Id: cx88.h,v 1.40 2004/11/03 09:04:51 kraxel Exp $
*
* v4l2 device driver for cx2388x based TV cards
*
@@ -156,6 +156,7 @@ extern struct sram_channel cx88_sram_channels[];
#define CX88_BOARD_HAUPPAUGE_DVB_T1 18
#define CX88_BOARD_CONEXANT_DVB_T1 19
#define CX88_BOARD_PROVIDEO_PV259 20
+#define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS 21
enum cx88_itype {
CX88_VMUX_COMPOSITE1 = 1,
diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c
index 849686426..ada90d489 100644
--- a/linux/drivers/media/video/ir-kbd-i2c.c
+++ b/linux/drivers/media/video/ir-kbd-i2c.c
@@ -1,5 +1,5 @@
/*
- * $Id: ir-kbd-i2c.c,v 1.8 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: ir-kbd-i2c.c,v 1.9 2004/11/03 09:04:51 kraxel Exp $
*
* keyboard input driver for i2c IR remote controls
*
@@ -155,16 +155,6 @@ module_param(debug, int, 0644); /* debug level (0,1,2) */
/* ----------------------------------------------------------------------- */
-static inline int reverse(int data, int bits)
-{
- int i,c;
-
- for (c=0,i=0; i<bits; i++) {
- c |= (((data & (1<<i)) ? 1:0)) << (bits-1-i);
- }
- return c;
-}
-
static int get_key_haup(struct IR *ir, u32 *ir_key, u32 *ir_raw)
{
unsigned char buf[3];
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index 819906100..aeb101cf5 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -1427,6 +1427,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);
static int msp_suspend(struct device * dev, u32 state, u32 level);
static int msp_resume(struct device * dev, u32 level);
+static void msp_wake_thread(struct i2c_client *client);
+
static struct i2c_driver driver = {
.owner = THIS_MODULE,
.name = "i2c msp3400 driver",
@@ -1551,7 +1553,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
msp->kthread = kthread_run(thread_func, c, "msp34xx");
if (NULL == msp->kthread)
printk(KERN_WARNING "msp34xx: kernel_thread() failed\n");
- wake_up_interruptible(&msp->wq);
+ msp_wake_thread(c);
}
/* done */
diff --git a/linux/drivers/media/video/msp3400.c b/linux/drivers/media/video/msp3400.c
index 819906100..aeb101cf5 100644
--- a/linux/drivers/media/video/msp3400.c
+++ b/linux/drivers/media/video/msp3400.c
@@ -1427,6 +1427,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);
static int msp_suspend(struct device * dev, u32 state, u32 level);
static int msp_resume(struct device * dev, u32 level);
+static void msp_wake_thread(struct i2c_client *client);
+
static struct i2c_driver driver = {
.owner = THIS_MODULE,
.name = "i2c msp3400 driver",
@@ -1551,7 +1553,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
msp->kthread = kthread_run(thread_func, c, "msp34xx");
if (NULL == msp->kthread)
printk(KERN_WARNING "msp34xx: kernel_thread() failed\n");
- wake_up_interruptible(&msp->wq);
+ msp_wake_thread(c);
}
/* done */
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index b4edb34a1..da0cfb590 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-cards.c,v 1.31 2004/10/25 11:26:36 kraxel Exp $
+ * $Id: saa7134-cards.c,v 1.32 2004/11/03 09:04:51 kraxel Exp $
*
* device driver for philips saa7134 based TV cards
* card-specific stuff.
@@ -1237,6 +1237,30 @@ struct saa7134_board saa7134_boards[] = {
.amux = TV,
},
},
+ [SAA7134_BOARD_AVERMEDIA_CARDBUS] = {
+ /* Jon Westgate <oryn@oryn.fsck.tv> */
+ .name = "AVerMedia Cardbus TV/Radio",
+ .audio_clock = 0x00200000,
+ .tuner_type = TUNER_PHILIPS_PAL,
+ .inputs = {{
+ .name = name_tv,
+ .vmux = 1,
+ .amux = LINE2,
+ .tv = 1,
+ },{
+ .name = name_comp1,
+ .vmux = 3,
+ .amux = LINE2,
+ },{
+ .name = name_svideo,
+ .vmux = 8,
+ .amux = LINE2,
+ }},
+ .radio = {
+ .name = name_radio,
+ .amux = LINE1,
+ },
+ },
};
const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -1413,6 +1437,13 @@ struct pci_device_id saa7134_pci_tbl[] = {
.subdevice = 0x10ff,
.driver_data = SAA7134_BOARD_AVERMEDIA_DVD_EZMAKER,
},{
+ /* AVerMedia CardBus */
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
+ .subvendor = 0x1461, /* Avermedia Technologies Inc */
+ .subdevice = 0xd6ee,
+ .driver_data = SAA7134_BOARD_AVERMEDIA_CARDBUS,
+ },{
/* TransGear 3000TV */
.vendor = PCI_VENDOR_ID_PHILIPS,
.device = PCI_DEVICE_ID_PHILIPS_SAA7130,
diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h
index ebaa6e76f..fca251bbb 100644
--- a/linux/drivers/media/video/saa7134/saa7134.h
+++ b/linux/drivers/media/video/saa7134/saa7134.h
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134.h,v 1.25 2004/10/25 11:26:36 kraxel Exp $
+ * $Id: saa7134.h,v 1.26 2004/11/03 09:04:51 kraxel Exp $
*
* v4l2 device driver for philips saa7134 based TV cards
*
@@ -186,6 +186,7 @@ struct saa7134_format {
#define SAA7134_BOARD_ZOLID_XPERT_TV7134 43
#define SAA7134_BOARD_EMPIRE_PCI_TV_RADIO_LE 44
#define SAA7134_BOARD_AVERMEDIA_307 45
+#define SAA7134_BOARD_AVERMEDIA_CARDBUS 46
#define SAA7134_MAXBOARDS 8
#define SAA7134_INPUT_MAX 8