summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/Documentation/video4linux/bttv/Cards2
-rw-r--r--linux/drivers/media/video/bttv-cards.c109
-rw-r--r--linux/drivers/media/video/bttv-vbi.c4
-rw-r--r--linux/drivers/media/video/cx88/cx88-cards.c102
-rw-r--r--linux/drivers/media/video/cx88/cx88.h4
-rw-r--r--linux/drivers/media/video/msp3400-driver.c2
-rw-r--r--linux/drivers/media/video/msp3400.c2
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c44
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-dvb.c87
-rw-r--r--linux/drivers/media/video/saa7134/saa7134.h5
-rw-r--r--linux/drivers/media/video/tda9887.c32
-rw-r--r--linux/drivers/media/video/tveeprom.c3
-rw-r--r--linux/include/linux/videodev2.h1
-rw-r--r--linux/include/media/tuner.h6
-rw-r--r--v4l/mt352.c91
-rw-r--r--v4l/scripts/update2
16 files changed, 242 insertions, 254 deletions
diff --git a/linux/Documentation/video4linux/bttv/Cards b/linux/Documentation/video4linux/bttv/Cards
index 8647e874c..bfbcf56c4 100644
--- a/linux/Documentation/video4linux/bttv/Cards
+++ b/linux/Documentation/video4linux/bttv/Cards
@@ -3,7 +3,7 @@ Gunther Mayer's bttv card gallery (graphical version of this text file :-)
is available at: http://mayerg.gmxhome.de/bttv/bttv-gallery.html
-Suppported cards:
+Supported cards:
Bt848/Bt848a/Bt849/Bt878/Bt879 cards
------------------------------------
diff --git a/linux/drivers/media/video/bttv-cards.c b/linux/drivers/media/video/bttv-cards.c
index 5308b81e0..a96b08bfe 100644
--- a/linux/drivers/media/video/bttv-cards.c
+++ b/linux/drivers/media/video/bttv-cards.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-cards.c,v 1.41 2005/01/07 13:58:49 kraxel Exp $
+ $Id: bttv-cards.c,v 1.42 2005/01/13 17:22:33 kraxel Exp $
bttv-cards.c
@@ -298,12 +298,12 @@ static struct CARD {
// DVB cards (using pci function .1 for mpeg data xfer)
{ 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
- { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T" },
+ { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
{ 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" },
{ 0x002611bd, BTTV_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
{ 0x00011822, BTTV_TWINHAN_DST, "Twinhan VisionPlus DVB-T" },
{ 0xfc00270f, BTTV_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
- { 0x07711461, BTTV_AVDVBT_771, "AVermedia DVB-T 771" },
+ { 0x07711461, BTTV_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
{ 0xdb1018ac, BTTV_DVICO_DVBT_LITE, "DVICO FusionHDTV DVB-T Lite" },
{ 0, -1, NULL }
@@ -2794,7 +2794,10 @@ void __devinit bttv_init_card2(struct bttv *btv)
if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
tda9887 = 1;
- if (tda9887)
+ if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
+ (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
+ (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
+ tda9887)
request_module("tda9887");
if (btv->tuner_type != UNSET)
request_module("tuner");
@@ -2802,67 +2805,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
/* ----------------------------------------------------------------------- */
-/* some hauppauge specific stuff */
-
-static struct HAUPPAUGE_TUNER
-{
- int id;
- char *name;
-}
-hauppauge_tuner[] __devinitdata =
-{
- { TUNER_ABSENT, "" },
- { TUNER_ABSENT, "External" },
- { TUNER_ABSENT, "Unspecified" },
- { TUNER_PHILIPS_PAL, "Philips FI1216" },
- { TUNER_PHILIPS_SECAM, "Philips FI1216MF" },
- { TUNER_PHILIPS_NTSC, "Philips FI1236" },
- { TUNER_PHILIPS_PAL_I, "Philips FI1246" },
- { TUNER_PHILIPS_PAL_DK,"Philips FI1256" },
- { TUNER_PHILIPS_PAL, "Philips FI1216 MK2" },
- { TUNER_PHILIPS_SECAM, "Philips FI1216MF MK2" },
- { TUNER_PHILIPS_NTSC, "Philips FI1236 MK2" },
- { TUNER_PHILIPS_PAL_I, "Philips FI1246 MK2" },
- { TUNER_PHILIPS_PAL_DK,"Philips FI1256 MK2" },
- { TUNER_TEMIC_NTSC, "Temic 4032FY5" },
- { TUNER_TEMIC_PAL, "Temic 4002FH5" },
- { TUNER_TEMIC_PAL_I, "Temic 4062FY5" },
- { TUNER_PHILIPS_PAL, "Philips FR1216 MK2" },
- { TUNER_PHILIPS_SECAM, "Philips FR1216MF MK2" },
- { TUNER_PHILIPS_NTSC, "Philips FR1236 MK2" },
- { TUNER_PHILIPS_PAL_I, "Philips FR1246 MK2" },
- { TUNER_PHILIPS_PAL_DK,"Philips FR1256 MK2" },
- { TUNER_PHILIPS_PAL, "Philips FM1216" },
- { TUNER_PHILIPS_SECAM, "Philips FM1216MF" },
- { TUNER_PHILIPS_NTSC, "Philips FM1236" },
- { TUNER_PHILIPS_PAL_I, "Philips FM1246" },
- { TUNER_PHILIPS_PAL_DK,"Philips FM1256" },
- { TUNER_TEMIC_4036FY5_NTSC, "Temic 4036FY5" },
- { TUNER_ABSENT, "Samsung TCPN9082D" },
- { TUNER_ABSENT, "Samsung TCPM9092P" },
- { TUNER_TEMIC_4006FH5_PAL, "Temic 4006FH5" },
- { TUNER_ABSENT, "Samsung TCPN9085D" },
- { TUNER_ABSENT, "Samsung TCPB9085P" },
- { TUNER_ABSENT, "Samsung TCPL9091P" },
- { TUNER_TEMIC_4039FR5_NTSC, "Temic 4039FR5" },
- { TUNER_PHILIPS_FQ1216ME, "Philips FQ1216 ME" },
- { TUNER_TEMIC_4066FY5_PAL_I, "Temic 4066FY5" },
- { TUNER_PHILIPS_NTSC, "Philips TD1536" },
- { TUNER_PHILIPS_NTSC, "Philips TD1536D" },
- { TUNER_PHILIPS_NTSC, "Philips FMR1236" }, /* mono radio */
- { TUNER_ABSENT, "Philips FI1256MP" },
- { TUNER_ABSENT, "Samsung TCPQ9091P" },
- { TUNER_TEMIC_4006FN5_MULTI_PAL, "Temic 4006FN5" },
- { TUNER_TEMIC_4009FR5_PAL, "Temic 4009FR5" },
- { TUNER_TEMIC_4046FM5, "Temic 4046FM5" },
- { TUNER_TEMIC_4009FN5_MULTI_PAL_FM, "Temic 4009FN5" },
- { TUNER_ABSENT, "Philips TD1536D_FH_44"},
- { TUNER_LG_NTSC_FM, "LG TPI8NSR01F"},
- { TUNER_LG_PAL_FM, "LG TPI8PSB01D"},
- { TUNER_LG_PAL, "LG TPI8PSB11D"},
- { TUNER_LG_PAL_I_FM, "LG TAPC-I001D"},
- { TUNER_LG_PAL_I, "LG TAPC-I701D"}
-};
static void modtec_eeprom(struct bttv *btv)
{
@@ -2886,39 +2828,11 @@ static void modtec_eeprom(struct bttv *btv)
static void __devinit hauppauge_eeprom(struct bttv *btv)
{
-#if 0
- unsigned int blk2,tuner,radio,model;
-
- if (eeprom_data[0] != 0x84 || eeprom_data[2] != 0)
- printk(KERN_WARNING "bttv%d: Hauppauge eeprom: invalid\n",
- btv->c.nr);
-
- /* Block 2 starts after len+3 bytes header */
- blk2 = eeprom_data[1] + 3;
-
- /* decode + use some config infos */
- model = eeprom_data[12] << 8 | eeprom_data[11];
- tuner = eeprom_data[9];
- radio = eeprom_data[blk2-1] & 0x01;
-
- if (tuner < ARRAY_SIZE(hauppauge_tuner))
- btv->tuner_type = hauppauge_tuner[tuner].id;
- if (radio)
- btv->has_radio = 1;
-
- if (bttv_verbose)
- printk(KERN_INFO "bttv%d: Hauppauge eeprom: model=%d, "
- "tuner=%s (%d), radio=%s\n",
- btv->c.nr, model, (tuner < ARRAY_SIZE(hauppauge_tuner)
- ? hauppauge_tuner[tuner].name : "?"),
- btv->tuner_type, radio ? "yes" : "no");
-#else
struct tveeprom tv;
tveeprom_hauppauge_analog(&tv, eeprom_data);
btv->tuner_type = tv.tuner_type;
btv->has_radio = tv.has_radio;
-#endif
}
static int terratec_active_radio_upgrade(struct bttv *btv)
@@ -3138,7 +3052,8 @@ static int tuner_0_table[] = {
TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
- TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL};
+ TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
+ TUNER_PHILIPS_FM1216ME_MK3 };
#if 0
int tuner_0_fm_table[] = {
PHILIPS_FR1236_NTSC, PHILIPS_FR1216_PAL,
@@ -3165,12 +3080,16 @@ static void __devinit avermedia_eeprom(struct bttv *btv)
btv->has_remote = (eeprom_data[0x42] & 0x01);
if (tuner_make == 0 || tuner_make == 2)
- if(tuner_format <=9)
+ if(tuner_format <=0x0a)
tuner = tuner_0_table[tuner_format];
if (tuner_make == 1)
if(tuner_format <=9)
tuner = tuner_1_table[tuner_format];
+ if (tuner_make == 4)
+ if(tuner_format == 0x09)
+ tuner = TUNER_LG_NTSC_NEW_TAPC; // TAPC-G702P
+
printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
if(tuner) {
diff --git a/linux/drivers/media/video/bttv-vbi.c b/linux/drivers/media/video/bttv-vbi.c
index a53a73f7e..06f3e62b3 100644
--- a/linux/drivers/media/video/bttv-vbi.c
+++ b/linux/drivers/media/video/bttv-vbi.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-vbi.c,v 1.8 2004/12/10 12:33:39 kraxel Exp $
+ $Id: bttv-vbi.c,v 1.9 2005/01/13 17:22:33 kraxel Exp $
bttv - Bt848 frame grabber driver
vbi interface
@@ -183,7 +183,7 @@ void bttv_vbi_try_fmt(struct bttv_fh *fh, struct v4l2_format *f)
case 2: /* SECAM */
default:
start0 = 7;
- start1 = 319;
+ start1 = 320;
}
count0 = (f->fmt.vbi.start[0] + f->fmt.vbi.count[0]) - start0;
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c
index 81f9d0aa1..ea8410687 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.55 2005/01/03 18:56:19 kraxel Exp $
+ * $Id: cx88-cards.c,v 1.56 2005/01/13 17:22:33 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* card-specific stuff.
@@ -127,7 +127,7 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x03fe,
}},
},
- [CX88_BOARD_WINFAST2000XP] = {
+ [CX88_BOARD_WINFAST2000XP_EXPERT] = {
.name = "Leadtek Winfast 2000XP Expert",
.tuner_type = 44,
.tda9887_conf = TDA9887_PRESENT,
@@ -506,11 +506,11 @@ struct cx88_subid cx88_subids[] = {
},{
.subvendor = 0x107d,
.subdevice = 0x6611,
- .card = CX88_BOARD_WINFAST2000XP,
+ .card = CX88_BOARD_WINFAST2000XP_EXPERT,
},{
.subvendor = 0x107d,
.subdevice = 0x6613, /* NTSC */
- .card = CX88_BOARD_WINFAST2000XP,
+ .card = CX88_BOARD_WINFAST2000XP_EXPERT,
},{
.subvendor = 0x107d,
.subdevice = 0x6620,
@@ -588,7 +588,7 @@ const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
{
- /* This is just for the Winfast 2000 XP board ATM; I don't have data on
+ /* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
* any others.
*
* Byte 0 is 1 on the NTSC board.
@@ -605,109 +605,21 @@ static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
core->has_radio = 1;
core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
- printk(KERN_INFO "%s: Leadtek Winfast 2000 XP config: "
+ printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
"tuner=%d, eeprom[0]=0x%02x\n",
core->name, core->tuner_type, eeprom_data[0]);
}
/* ----------------------------------------------------------------------- */
-/* some hauppauge specific stuff */
-
-static struct {
- int id;
- char *name;
-} hauppauge_tuner[] __devinitdata = {
- { TUNER_ABSENT, "" },
- { TUNER_ABSENT, "External" },
- { TUNER_ABSENT, "Unspecified" },
- { TUNER_PHILIPS_PAL, "Philips FI1216" },
- { TUNER_PHILIPS_SECAM, "Philips FI1216MF" },
- { TUNER_PHILIPS_NTSC, "Philips FI1236" },
- { TUNER_PHILIPS_PAL_I, "Philips FI1246" },
- { TUNER_PHILIPS_PAL_DK,"Philips FI1256" },
- { TUNER_PHILIPS_PAL, "Philips FI1216 MK2" },
- { TUNER_PHILIPS_SECAM, "Philips FI1216MF MK2" },
- { TUNER_PHILIPS_NTSC, "Philips FI1236 MK2" },
- { TUNER_PHILIPS_PAL_I, "Philips FI1246 MK2" },
- { TUNER_PHILIPS_PAL_DK,"Philips FI1256 MK2" },
- { TUNER_TEMIC_NTSC, "Temic 4032FY5" },
- { TUNER_TEMIC_PAL, "Temic 4002FH5" },
- { TUNER_TEMIC_PAL_I, "Temic 4062FY5" },
- { TUNER_PHILIPS_PAL, "Philips FR1216 MK2" },
- { TUNER_PHILIPS_SECAM, "Philips FR1216MF MK2" },
- { TUNER_PHILIPS_NTSC, "Philips FR1236 MK2" },
- { TUNER_PHILIPS_PAL_I, "Philips FR1246 MK2" },
- { TUNER_PHILIPS_PAL_DK,"Philips FR1256 MK2" },
- { TUNER_PHILIPS_PAL, "Philips FM1216" },
- { TUNER_PHILIPS_SECAM, "Philips FM1216MF" },
- { TUNER_PHILIPS_NTSC, "Philips FM1236" },
- { TUNER_PHILIPS_PAL_I, "Philips FM1246" },
- { TUNER_PHILIPS_PAL_DK,"Philips FM1256" },
- { TUNER_TEMIC_4036FY5_NTSC, "Temic 4036FY5" },
- { TUNER_ABSENT, "Samsung TCPN9082D" },
- { TUNER_ABSENT, "Samsung TCPM9092P" },
- { TUNER_TEMIC_4006FH5_PAL, "Temic 4006FH5" },
- { TUNER_ABSENT, "Samsung TCPN9085D" },
- { TUNER_ABSENT, "Samsung TCPB9085P" },
- { TUNER_ABSENT, "Samsung TCPL9091P" },
- { TUNER_TEMIC_4039FR5_NTSC, "Temic 4039FR5" },
- { TUNER_PHILIPS_FQ1216ME, "Philips FQ1216 ME" },
- { TUNER_TEMIC_4066FY5_PAL_I, "Temic 4066FY5" },
- { TUNER_PHILIPS_NTSC, "Philips TD1536" },
- { TUNER_PHILIPS_NTSC, "Philips TD1536D" },
- { TUNER_PHILIPS_NTSC, "Philips FMR1236" }, /* mono radio */
- { TUNER_ABSENT, "Philips FI1256MP" },
- { TUNER_ABSENT, "Samsung TCPQ9091P" },
- { TUNER_TEMIC_4006FN5_MULTI_PAL, "Temic 4006FN5" },
- { TUNER_TEMIC_4009FR5_PAL, "Temic 4009FR5" },
- { TUNER_TEMIC_4046FM5, "Temic 4046FM5" },
- { TUNER_TEMIC_4009FN5_MULTI_PAL_FM, "Temic 4009FN5" },
- { TUNER_ABSENT, "Philips TD1536D_FH_44"},
- { TUNER_LG_NTSC_FM, "LG TPI8NSR01F"},
- { TUNER_LG_PAL_FM, "LG TPI8PSB01D"},
- { TUNER_LG_PAL, "LG TPI8PSB11D"},
- { TUNER_LG_PAL_I_FM, "LG TAPC-I001D"},
- { TUNER_LG_PAL_I, "LG TAPC-I701D"},
- { TUNER_THOMSON_DTT7610, "DTT-7610"}
-};
static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
{
-#if 0
- unsigned int blk2,tuner,radio,model;
-
- if (eeprom_data[0] != 0x84 || eeprom_data[2] != 0) {
- printk(KERN_WARNING "%s: Hauppauge eeprom: invalid\n",
- core->name);
- return;
- }
-
- /* Block 2 starts after len+3 bytes header */
- blk2 = eeprom_data[1] + 3;
-
- /* decode + use some config infos */
- model = eeprom_data[12] << 8 | eeprom_data[11];
- tuner = eeprom_data[9];
- radio = eeprom_data[blk2-1] & 0x01;
-
- if (tuner < ARRAY_SIZE(hauppauge_tuner))
- core->tuner_type = hauppauge_tuner[tuner].id;
- if (radio)
- core->has_radio = 1;
-
- printk(KERN_INFO "%s: hauppauge eeprom: model=%d, "
- "tuner=%s (%d), radio=%s\n",
- core->name, model, (tuner < ARRAY_SIZE(hauppauge_tuner)
- ? hauppauge_tuner[tuner].name : "?"),
- core->tuner_type, radio ? "yes" : "no");
-#else
struct tveeprom tv;
tveeprom_hauppauge_analog(&tv, eeprom_data);
core->tuner_type = tv.tuner_type;
core->has_radio = tv.has_radio;
-#endif
}
#ifdef WITH_DVB
@@ -848,7 +760,7 @@ void cx88_card_setup(struct cx88_core *core)
if (0 == core->i2c_rc)
gdi_eeprom(core,eeprom);
break;
- case CX88_BOARD_WINFAST2000XP:
+ case CX88_BOARD_WINFAST2000XP_EXPERT:
if (0 == core->i2c_rc)
leadtek_eeprom(core,eeprom);
break;
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index 63fe71b90..5567ab9c9 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.47 2004/12/14 15:33:30 kraxel Exp $
+ * $Id: cx88.h,v 1.48 2005/01/13 17:22:33 kraxel Exp $
*
* v4l2 device driver for cx2388x based TV cards
*
@@ -141,7 +141,7 @@ extern struct sram_channel cx88_sram_channels[];
#define CX88_BOARD_GDI 2
#define CX88_BOARD_PIXELVIEW 3
#define CX88_BOARD_ATI_WONDER_PRO 4
-#define CX88_BOARD_WINFAST2000XP 5
+#define CX88_BOARD_WINFAST2000XP_EXPERT 5
#define CX88_BOARD_AVERTV_303 6
#define CX88_BOARD_MSI_TVANYWHERE_MASTER 7
#define CX88_BOARD_WINFAST_DV2000 8
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index 42b9ec14c..5bfb7e174 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -381,7 +381,7 @@ static void msp3400c_setvolume(struct i2c_client *client,
int val = 0, bal = 0;
if (!muted) {
- val = (volume * 0x73 / 65535) << 8;
+ val = (volume * 0x7F / 65535) << 8;
}
if (val) {
bal = (balance / 256) - 128;
diff --git a/linux/drivers/media/video/msp3400.c b/linux/drivers/media/video/msp3400.c
index 42b9ec14c..5bfb7e174 100644
--- a/linux/drivers/media/video/msp3400.c
+++ b/linux/drivers/media/video/msp3400.c
@@ -381,7 +381,7 @@ static void msp3400c_setvolume(struct i2c_client *client,
int val = 0, bal = 0;
if (!muted) {
- val = (volume * 0x73 / 65535) << 8;
+ val = (volume * 0x7F / 65535) << 8;
}
if (val) {
bal = (balance / 256) - 128;
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index 3e3455ecd..519a42c35 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -1,6 +1,6 @@
/*
- * $Id: saa7134-cards.c,v 1.47 2005/01/11 14:17:48 kraxel Exp $
+ * $Id: saa7134-cards.c,v 1.48 2005/01/13 17:22:33 kraxel Exp $
*
* device driver for philips saa7134 based TV cards
* card-specific stuff.
@@ -1003,8 +1003,8 @@ struct saa7134_board saa7134_boards[] = {
.vmux = 8,
}},
},
- [SAA7134_BOARD_AVERMEDIA_305] = {
- .name = "AverMedia 305",
+ [SAA7134_BOARD_AVERMEDIA_STUDIO_305] = {
+ .name = "AverMedia AverTV Studio 305",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_PHILIPS_FM1256_IH3,
.tda9887_conf = TDA9887_PRESENT,
@@ -1409,6 +1409,37 @@ struct saa7134_board saa7134_boards[] = {
.amux = LINE2,
},
},
+ [SAA7134_BOARD_AVERMEDIA_305] = {
+ /* much like the "studio" version but without radio
+ * and another tuner (sirspiritus@yandex.ru) */
+ .name = "AverMedia AverTV/305",
+ .audio_clock = 0x00187de7,
+ .tuner_type = TUNER_PHILIPS_FQ1216ME,
+ .tda9887_conf = TDA9887_PRESENT,
+ .gpiomask = 0x3,
+ .inputs = {{
+ .name = name_tv,
+ .vmux = 1,
+ .amux = LINE2,
+ .tv = 1,
+ },{
+ .name = name_comp1,
+ .vmux = 0,
+ .amux = LINE2,
+ },{
+ .name = name_comp2,
+ .vmux = 3,
+ .amux = LINE2,
+ },{
+ .name = name_svideo,
+ .vmux = 8,
+ .amux = LINE2,
+ }},
+ .mute = {
+ .name = name_mute,
+ .amux = LINE1,
+ },
+ },
};
const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -1589,6 +1620,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
.device = PCI_DEVICE_ID_PHILIPS_SAA7130,
.subvendor = 0x1461, /* Avermedia Technologies Inc */
.subdevice = 0x2115,
+ .driver_data = SAA7134_BOARD_AVERMEDIA_STUDIO_305,
+ },{
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
+ .subvendor = 0x1461, /* Avermedia Technologies Inc */
+ .subdevice = 0x2108,
.driver_data = SAA7134_BOARD_AVERMEDIA_305,
},{
.vendor = PCI_VENDOR_ID_PHILIPS,
@@ -1794,6 +1831,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
case SAA7134_BOARD_ECS_TVP3XP:
case SAA7134_BOARD_ECS_TVP3XP_4CB5:
case SAA7134_BOARD_MD2819:
+ case SAA7134_BOARD_AVERMEDIA_STUDIO_305:
case SAA7134_BOARD_AVERMEDIA_305:
case SAA7134_BOARD_AVERMEDIA_307:
// case SAA7134_BOARD_SABRENT_SBTTVFM: /* not finished yet */
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
index 325631fd0..968a9080c 100644
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-dvb.c,v 1.7 2005/01/04 16:31:20 kraxel Exp $
+ * $Id: saa7134-dvb.c,v 1.8 2005/01/13 17:22:33 kraxel Exp $
*
* (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
*
@@ -39,6 +39,27 @@ MODULE_LICENSE("GPL");
/* ------------------------------------------------------------------ */
+static int mt352_pinnacle_fixup(struct dvb_frontend* fe)
+{
+ static u8 wr[][2] = {
+ { 0x67, 0x28 },
+ { 0x68, 0xa0 },
+
+ { 0x7b, 0x04 },
+
+ { 0x88, 0x0d },
+ { 0x8a, 0x28 },
+ { 0x8c, 0x0f },
+ };
+ struct saa7134_dev *dev= fe->dvb->priv;
+ int i;
+
+ printk("%s: %s called\n",dev->name,__FUNCTION__);
+ for (i = 0; i < ARRAY_SIZE(wr); i++) {
+ mt352_write(fe, wr[i], 2);
+ }
+}
+
static int mt352_pinnacle_init(struct dvb_frontend* fe)
{
static u8 clock_config [] = { CLOCK_CTL, 0x3d, 0x39 };
@@ -67,6 +88,34 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
return 0;
}
+static int mt352_pinnacle_antenna_pwr(struct saa7134_dev *dev, int on)
+{
+ u32 ok;
+
+ if (!on) {
+ saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 26));
+ saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26));
+ return 0;
+ }
+
+ saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 26));
+ saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26));
+ udelay(10);
+
+ saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 28));
+ saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28));
+ udelay(10);
+ saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28));
+ udelay(10);
+ ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27);
+ printk("%s: %s %s\n", dev->name, __FUNCTION__,
+ ok ? "on" : "off");
+
+ if (!ok)
+ saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26));
+ return ok;
+}
+
static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params,
u8* pllbuf)
@@ -77,19 +126,34 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
[ BANDWIDTH_7_MHZ ] = { TRL_NOMINAL_RATE_1, 0x64, 0xB8 },
[ BANDWIDTH_8_MHZ ] = { TRL_NOMINAL_RATE_1, 0x73, 0x1C },
};
- struct saa7134_dev *dev= fe->dvb->priv;
+ static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
+ static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE;
+ struct saa7134_dev *dev = fe->dvb->priv;
struct v4l2_frequency f;
int bw = params->u.ofdm.bandwidth;
printk("%s: %s called (freq=%d,bw=%d)\n",dev->name,__FUNCTION__,
params->frequency,bw);
- /* set frequency */
+ mt352_pinnacle_antenna_pwr(dev, 0);
+
+ /* set frequency (mt2050) */
f.tuner = 0;
- f.type = V4L2_TUNER_ANALOG_TV; /* FIXME */
+ f.type = V4L2_TUNER_DIGITAL_TV;
f.frequency = params->frequency / 1000 * 16 / 1000;
+ saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on);
saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
- memset(pllbuf,0,5);
+ saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off);
+
+ /* mt352 setup */
+ mt352_pinnacle_init(fe);
+ mt352_pinnacle_fixup(fe);
+
+ pllbuf[0] = 0xc2;
+ pllbuf[1] = 0x00;
+ pllbuf[2] = 0x00;
+ pllbuf[3] = 0x80;
+ pllbuf[4] = 0x00;
if (bw < ARRAY_SIZE(buf) && NULL != buf[bw]) {
#if 1
@@ -97,8 +161,8 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
* adc freq 20.48 MHz values hardcoded */
pllbuf[-4] = buf[bw][1];
pllbuf[-3] = buf[bw][2];
- pllbuf[-2] = 0x31; /* if 36.1667 + adc 20.333 */
- pllbuf[-1] = 0xD9;
+ pllbuf[-2] = 0x31; /* if 36.15 + adc 20.333 */
+ pllbuf[-1] = 0xB8;
#else
mt352_write(fe, buf[bw], 3);
#endif
@@ -148,7 +212,16 @@ static int dvb_init(struct saa7134_dev *dev)
static int dvb_fini(struct saa7134_dev *dev)
{
+ static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
+
printk("%s: %s\n",dev->name,__FUNCTION__);
+
+ switch (dev->board) {
+ case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
+ /* otherwise we don't detect the tuner on next insmod */
+ saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on);
+ break;
+ };
videobuf_dvb_unregister(&dev->dvb);
return 0;
}
diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h
index bab2b7575..50b51ffa3 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.34 2004/12/14 15:33:30 kraxel Exp $
+ * $Id: saa7134.h,v 1.35 2005/01/13 17:22:33 kraxel Exp $
*
* v4l2 device driver for philips saa7134 based TV cards
*
@@ -176,7 +176,7 @@ struct saa7134_format {
#define SAA7134_BOARD_AVACSSMARTTV 32
#define SAA7134_BOARD_AVERMEDIA_DVD_EZMAKER 33
#define SAA7134_BOARD_NOVAC_PRIMETV7133 34
-#define SAA7134_BOARD_AVERMEDIA_305 35
+#define SAA7134_BOARD_AVERMEDIA_STUDIO_305 35
#define SAA7133_BOARD_UPMOST_PURPLE_TV 36
#define SAA7134_BOARD_ITEMS_MTV005 37
#define SAA7134_BOARD_CINERGY200 38
@@ -193,6 +193,7 @@ struct saa7134_format {
#define SAA7134_BOARD_VIDEOMATE_GOLD_PLUS 49
#define SAA7134_BOARD_PINNACLE_300I_DVBT_PAL 50
#define SAA7134_BOARD_PROVIDEO_PV952 51
+#define SAA7134_BOARD_AVERMEDIA_305 52
#define SAA7134_MAXBOARDS 8
#define SAA7134_INPUT_MAX 8
diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c
index e5c67036f..e30546f4f 100644
--- a/linux/drivers/media/video/tda9887.c
+++ b/linux/drivers/media/video/tda9887.c
@@ -384,8 +384,8 @@ static int tda9887_set_tvnorm(struct tda9887 *t, char *buf)
return 0;
}
-static unsigned int port1 = 1;
-static unsigned int port2 = 1;
+static unsigned int port1 = UNSET;
+static unsigned int port2 = UNSET;
static unsigned int qss = UNSET;
static unsigned int adjust = 0x10;
module_param(port1, int, 0644);
@@ -395,10 +395,19 @@ module_param(adjust, int, 0644);
static int tda9887_set_insmod(struct tda9887 *t, char *buf)
{
- if (port1)
- buf[1] |= cOutputPort1Inactive;
- if (port2)
- buf[1] |= cOutputPort2Inactive;
+ if (UNSET != port1) {
+ if (port1)
+ buf[1] |= cOutputPort1Inactive;
+ else
+ buf[1] &= ~cOutputPort1Inactive;
+ }
+ if (UNSET != port2) {
+ if (port2)
+ buf[1] |= cOutputPort2Inactive;
+ else
+ buf[1] &= ~cOutputPort2Inactive;
+ }
+
if (UNSET != qss) {
if (qss)
buf[1] |= cQSS;
@@ -413,10 +422,15 @@ static int tda9887_set_insmod(struct tda9887 *t, char *buf)
static int tda9887_set_config(struct tda9887 *t, char *buf)
{
- if (t->config & TDA9887_PORT1)
+ if (t->config & TDA9887_PORT1_ACTIVE)
+ buf[1] &= ~cOutputPort1Inactive;
+ if (t->config & TDA9887_PORT1_INACTIVE)
buf[1] |= cOutputPort1Inactive;
- if (t->config & TDA9887_PORT2)
+ if (t->config & TDA9887_PORT2_ACTIVE)
+ buf[1] &= ~cOutputPort2Inactive;
+ if (t->config & TDA9887_PORT2_INACTIVE)
buf[1] |= cOutputPort2Inactive;
+
if (t->config & TDA9887_QSS)
buf[1] |= cQSS;
if (t->config & TDA9887_INTERCARRIER)
@@ -539,6 +553,8 @@ static int tda9887_configure(struct tda9887 *t)
int rc;
memset(buf,0,sizeof(buf));
+ buf[1] |= cOutputPort1Inactive;
+ buf[1] |= cOutputPort2Inactive;
tda9887_set_tvnorm(t,buf);
if (UNSET != t->pinnacle_id) {
tda9887_set_pinnacle(t,buf);
diff --git a/linux/drivers/media/video/tveeprom.c b/linux/drivers/media/video/tveeprom.c
index 0bba7d25f..9c3638c18 100644
--- a/linux/drivers/media/video/tveeprom.c
+++ b/linux/drivers/media/video/tveeprom.c
@@ -512,6 +512,8 @@ tveeprom_detect_client(struct i2c_adapter *adapter,
{
struct i2c_client *client;
+ dprintk(1,"%s: id 0x%x @ 0x%x\n",__FUNCTION__,
+ adapter->id, address << 1);
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
if (client == 0)
return -ENOMEM;
@@ -527,6 +529,7 @@ tveeprom_detect_client(struct i2c_adapter *adapter,
static int
tveeprom_attach_adapter (struct i2c_adapter *adapter)
{
+ dprintk(1,"%s: id 0x%x\n",__FUNCTION__,adapter->id);
if (adapter->id != (I2C_ALGO_BIT | I2C_HW_B_BT848))
return 0;
return i2c_probe(adapter, &addr_data, tveeprom_detect_client);
diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index 6c1daffd6..3f30d319f 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -78,6 +78,7 @@ enum v4l2_ctrl_type {
enum v4l2_tuner_type {
V4L2_TUNER_RADIO = 1,
V4L2_TUNER_ANALOG_TV = 2,
+ V4L2_TUNER_DIGITAL_TV = 3,
};
enum v4l2_memory {
diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h
index 6f97e0478..3e9bac43d 100644
--- a/linux/include/media/tuner.h
+++ b/linux/include/media/tuner.h
@@ -110,10 +110,12 @@
#define TDA9887_SET_CONFIG _IOW('t',5,int)
/* tv card specific */
# define TDA9887_PRESENT (1<<0)
-# define TDA9887_PORT1 (1<<1)
-# define TDA9887_PORT2 (1<<2)
+# define TDA9887_PORT1_INACTIVE (1<<1)
+# define TDA9887_PORT2_INACTIVE (1<<2)
# define TDA9887_QSS (1<<3)
# define TDA9887_INTERCARRIER (1<<4)
+# define TDA9887_PORT1_ACTIVE (1<<5)
+# define TDA9887_PORT2_ACTIVE (1<<6)
/* config options */
# define TDA9887_DEEMPHASIS_MASK (3<<16)
# define TDA9887_DEEMPHASIS_NONE (1<<16)
diff --git a/v4l/mt352.c b/v4l/mt352.c
index b4b8ff830..7b0489dec 100644
--- a/v4l/mt352.c
+++ b/v4l/mt352.c
@@ -63,26 +63,28 @@ int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen)
struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv;
struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0,
.buf = ibuf, .len = ilen };
+#if 0
int i;
printk("%s:",__FUNCTION__);
for (i = 0; i < ilen; i++)
printk(" %02x",ibuf[i]);
printk("\n");
+#endif
int err = i2c_transfer(state->i2c, &msg, 1);
if (err != 1) {
printk(KERN_WARNING
"mt352_write() failed (err = %d)!\n", err);
return err;
-}
+ }
return 0;
}
static u8 mt352_read_register(struct mt352_state* state, u8 reg)
{
- int ret;
+ int ret,i;
u8 b0 [] = { reg };
u8 b1 [] = { 0 };
struct i2c_msg msg [] = { { .addr = state->config->demod_address,
@@ -92,7 +94,12 @@ static u8 mt352_read_register(struct mt352_state* state, u8 reg)
.flags = I2C_M_RD,
.buf = b1, .len = 1 } };
- ret = i2c_transfer(state->i2c, msg, 2);
+ for (i = 0; i < 3; i++) {
+ ret = i2c_transfer(state->i2c, msg, 2);
+ if (2 == ret)
+ break;
+ udelay(10);
+ }
if (ret != 2)
printk(KERN_WARNING
@@ -101,6 +108,34 @@ static u8 mt352_read_register(struct mt352_state* state, u8 reg)
return b1[0];
}
+static u8 mt352_register_dump(struct mt352_state* state)
+{
+ int i,val;
+
+ for (i = 0x50; i < 0x8f; i++) {
+ val = mt352_read_register(state,i);
+ printk("%s: %02x %02x\n",__FUNCTION__,i,val);
+ }
+}
+
+static u8 mt352_state_dump(struct mt352_state* state)
+{
+ int i,val,agc,snr;
+
+ printk("mt352: status:");
+ for (i = STATUS_0; i <= STATUS_4; i++) {
+ val = mt352_read_register(state,i);
+ printk(" %02x",val);
+ }
+ agc = 0;
+ agc |= mt352_read_register(state,AGC_GAIN_3) << 24;
+ agc |= mt352_read_register(state,AGC_GAIN_2) << 16;
+ agc |= mt352_read_register(state,AGC_GAIN_1) << 8;
+ agc |= mt352_read_register(state,AGC_GAIN_0);
+ snr = mt352_read_register(state,SNR);
+ printk(" agc: %5d snr: %02x\n", (~agc)>>16, snr);
+}
+
static int mt352_sleep(struct dvb_frontend* fe)
{
static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 };
@@ -114,14 +149,11 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
struct dvb_frontend_parameters *param)
{
struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv;
- unsigned char buf[13];
- static unsigned char go[2] = { 0x5b, 0x01 };
+ unsigned char buf[14];
unsigned int tps = 0;
struct dvb_ofdm_parameters *op = &param->u.ofdm;
- int regs, tune, i;
+ int i;
- dprintk("%s: hello\n",__FUNCTION__);
-
switch (op->code_rate_HP) {
case FEC_2_3:
tps |= (1 << 7);
@@ -231,7 +263,8 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
buf[1] = msb(tps); /* TPS_GIVEN_(1|0) */
buf[2] = lsb(tps);
- buf[3] = 0x50;
+// buf[3] = 0x50;
+ buf[3] = 0xf4;
/**
* these settings assume 20.48MHz f_ADC, for other tuners you might
@@ -253,30 +286,27 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
state->config->pll_set(fe, param, buf+8);
+ buf[13] = 0x01; /* TUNER_GO!! */
- if (0 != buf[8]) {
- /* default */
- regs = 13;
- tune = 0;
- } else {
- /* no tuner address given => don't write these registers */
- regs = 8;
- tune = 1;
- }
+#if 0
/* Only send the tuning request if the tuner doesn't have the requested
* parameters already set. Enhances tuning time and prevents stream
* breakup when retuning the same transponder. */
- for (i = 1; i < regs; i++) {
+ for (i = 1; i < 13; i++)
if (buf[i] != mt352_read_register(state, i + 0x50)) {
- mt352_write(fe, buf, regs);
- tune = 1;
+ mt352_write(fe, buf, sizeof(buf));
break;
}
- }
-
- if (tune)
- mt352_write(fe, go, sizeof(go)); /* set TUNER_GO */
+#else
+ mt352_write(fe, buf, sizeof(buf));
+#endif
+ if (0)
+ mt352_register_dump(state);
+ for (i = 0; i < 2; i++) {
+ msleep(500);
+ mt352_state_dump(state);
+ }
return 0;
}
@@ -468,12 +498,12 @@ static int mt352_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
static int mt352_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings)
{
- fe_tune_settings->min_delay_ms = 800;
+ fe_tune_settings->min_delay_ms = 800 * 10000;
fe_tune_settings->step_size = 0;
fe_tune_settings->max_drift = 0;
return 0;
- }
+}
static int mt352_init(struct dvb_frontend* fe)
{
@@ -518,13 +548,6 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config,
memcpy(&state->ops, &mt352_ops, sizeof(struct dvb_frontend_ops));
/* check if the demod is there */
-#if 0
- {
- int i;
- for (i = 0; i < 4; i++)
- mt352_read_register(state, i);
- }
-#endif
if (mt352_read_register(state, CHIP_ID) != ID_MT352) goto error;
/* create dvb_frontend */
diff --git a/v4l/scripts/update b/v4l/scripts/update
index f73ec913e..1a9731e47 100644
--- a/v4l/scripts/update
+++ b/v4l/scripts/update
@@ -69,7 +69,7 @@ v4l2basic
#xrmmod v4l1-compat
#xinsmod v4l1-compat debug=1
-xinsmod tveeprom debug=0
+xinsmod tveeprom debug=1
xinsmod dvb-pll debug=1
xinsmod btcx-risc debug=0
xinsmod ir-common debug=1 repeat=0