diff options
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-cards.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-cards.c | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index 0f8463a7b..c052a6c40 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.52 2004/12/09 12:51:35 kraxel Exp $ + * $Id: cx88-cards.c,v 1.53 2004/12/14 15:33:30 kraxel Exp $ * * device driver for Conexant 2388x based TV cards * card-specific stuff. @@ -224,21 +224,26 @@ struct cx88_board cx88_boards[] = { }, }, [CX88_BOARD_LEADTEK_PVR2000] = { + // gpio values for PAL version from regspy by DScaler .name = "Leadtek PVR 2000", .tuner_type = 38, .tda9887_conf = TDA9887_PRESENT, .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, + .gpio0 = 0x0000bde6, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, + .gpio0 = 0x0000bde6, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, + .gpio0 = 0x0000bde6, }}, .radio = { .type = CX88_RADIO, + .gpio0 = 0x0000bd62, }, .blackbird = 1, }, @@ -668,6 +673,7 @@ static struct { 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) { @@ -694,6 +700,13 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) 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 @@ -732,7 +745,7 @@ static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee) core->name, model, tuner, core->pll_desc ? core->pll_desc->name : "UNKNOWN"); - core->pll_addr = 0x61; + core->pll_addr = 0x61; core->demod_addr = 0x43; } #endif @@ -790,36 +803,6 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) /* ----------------------------------------------------------------------- */ -static int -i2c_eeprom(struct i2c_client *c, unsigned char *eedata, int len) -{ - unsigned char buf; - int err; - - c->addr = 0xa0 >> 1; - buf = 0; - if (1 != (err = i2c_master_send(c,&buf,1))) { - printk(KERN_INFO "cx88: Huh, no eeprom present (err=%d)?\n", - err); - return -1; - } - if (len != (err = i2c_master_recv(c,eedata,len))) { - printk(KERN_WARNING "cx88: i2c eeprom read error (err=%d)\n", - err); - return -1; - } -#if 0 - for (i = 0; i < len; i++) { - if (0 == (i % 16)) - printk(KERN_INFO "cx88 ee: %02x:",i); - printk(" %02x",eedata[i]); - if (15 == (i % 16)) - printk("\n"); - } -#endif - return 0; -} - void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) { int i; @@ -850,27 +833,28 @@ void cx88_card_setup(struct cx88_core *core) { static u8 eeprom[128]; + if (0 == core->i2c_rc) { + core->i2c_client.addr = 0xa0 >> 1; + tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom)); + } + switch (core->board) { case CX88_BOARD_HAUPPAUGE: if (0 == core->i2c_rc) - i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); - hauppauge_eeprom(core,eeprom+8); + hauppauge_eeprom(core,eeprom+8); break; case CX88_BOARD_GDI: if (0 == core->i2c_rc) - i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); - gdi_eeprom(core,eeprom); + gdi_eeprom(core,eeprom); break; case CX88_BOARD_WINFAST2000XP: if (0 == core->i2c_rc) - i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); - leadtek_eeprom(core,eeprom); + leadtek_eeprom(core,eeprom); break; #ifdef WITH_DVB case CX88_BOARD_HAUPPAUGE_DVB_T1: if (0 == core->i2c_rc) - i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); - hauppauge_eeprom_dvb(core,eeprom); + hauppauge_eeprom_dvb(core,eeprom); break; case CX88_BOARD_CONEXANT_DVB_T1: core->pll_desc = &dvb_pll_thomson_dtt7579; |