Hi there! This patch should make the A700 finally run. (At least I get a lock at most tries :) ) After adding zl10036 and zl10313 support one needs also these patches to use a700 card for dvb: 01_avertv_A700_analog: already sent patch to support analog inputs 02_mt312-invertable-voltage: adds setting inverted_voltage for different wiring of voltage pin. 03_avertv_A700_dvb: adds support for dvb part of A700. This tries to reset the demod via gpio - hope it works. Regards Matthias -- Matthias Schwarzott (zzam)
Index: v4l-dvb/linux/drivers/media/dvb/frontends/mt312.c =================================================================== --- v4l-dvb.orig/linux/drivers/media/dvb/frontends/mt312.c +++ v4l-dvb/linux/drivers/media/dvb/frontends/mt312.c @@ -420,10 +420,11 @@ static int mt312_set_voltage(struct dvb_ struct mt312_state *state = fe->demodulator_priv; const u8 volt_tab[3] = { 0x00, 0x40, 0x00 }; + u8 flip_bits = state->config->voltage_inverted ? 0x40 : 0x00; if (v > SEC_VOLTAGE_OFF) return -EINVAL; - return mt312_writereg(state, DISEQC_MODE, volt_tab[v]); + return mt312_writereg(state, DISEQC_MODE, volt_tab[v] ^ flip_bits); } static int mt312_read_status(struct dvb_frontend *fe, fe_status_t *s) Index: v4l-dvb/linux/drivers/media/dvb/frontends/mt312.h =================================================================== --- v4l-dvb.orig/linux/drivers/media/dvb/frontends/mt312.h +++ v4l-dvb/linux/drivers/media/dvb/frontends/mt312.h @@ -31,6 +31,9 @@ struct mt312_config { /* the demodulator's i2c address */ u8 demod_address; + + /* inverted voltage setting */ + int voltage_inverted:1; }; #if defined(CONFIG_DVB_MT312) || (defined(CONFIG_DVB_MT312_MODULE) && defined(MODULE))
Index: v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c =================================================================== --- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-cards.c +++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -3951,6 +3951,25 @@ struct saa7134_board saa7134_boards[] = }, .mpeg = SAA7134_MPEG_EMPRESS, }, + [SAA7134_BOARD_AVERMEDIA_A700] = { + /* Matthias Schwarzott <zzam@xxxxxxxxxx> */ + .name = "Avermedia A700", + .audio_clock = 0x00187de7, + .tuner_type = TUNER_ABSENT, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + /* no DVB support for now */ + .inputs = {{ + .name = name_comp, + .vmux = 1, + .amux = LINE1, + }, { + .name = name_svideo, + .vmux = 6, + .amux = LINE1, + }}, + }, }; const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); @@ -4183,6 +4202,12 @@ struct pci_device_id saa7134_pci_tbl[] = .driver_data = SAA7134_BOARD_MD2819, },{ .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x1461, /* Avermedia Technologies Inc */ + .subdevice = 0xa7a1, + .driver_data = SAA7134_BOARD_AVERMEDIA_A700, + },{ + .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7130, .subvendor = 0x1461, /* Avermedia Technologies Inc */ .subdevice = 0x2115, @@ -5149,6 +5174,14 @@ int saa7134_board_init1(struct saa7134_d saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x8c040007, 0x8c040007); saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0c0007cd, 0x0c0007cd); break; + case SAA7134_BOARD_AVERMEDIA_A700: + /* write windows gpio values */ + saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x80040100, 0x80040100); + saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x80040100, 0x00040100); + printk("%s: %s: hybrid analog/dvb card\n" + "%s: Sorry, only the analog inputs are supported for now.\n", + dev->name,card(dev).name, dev->name); + break; } return 0; } Index: v4l-dvb/linux/drivers/media/video/saa7134/saa7134.h =================================================================== --- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134.h +++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134.h @@ -260,6 +260,7 @@ struct saa7134_format { #define SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM 128 #define SAA7134_BOARD_BEHOLD_607_9FM 129 #define SAA7134_BOARD_BEHOLD_M6 130 +#define SAA7134_BOARD_AVERMEDIA_A700 131 #define SAA7134_MAXBOARDS 8 #define SAA7134_INPUT_MAX 8 Index: v4l-dvb/linux/Documentation/video4linux/CARDLIST.saa7134 =================================================================== --- v4l-dvb.orig/linux/Documentation/video4linux/CARDLIST.saa7134 +++ v4l-dvb/linux/Documentation/video4linux/CARDLIST.saa7134 @@ -129,3 +129,4 @@ 128 -> Beholder BeholdTV Columbus TVFM [0000:5201] 129 -> Beholder BeholdTV 607 / BeholdTV 609 [5ace:6070,5ace:6071,5ace:6072,5ace:6073,5ace:6090,5ace:6091,5ace:6092,5ace:6093] 130 -> Beholder BeholdTV M6 / BeholdTV M6 Extra [5ace:6190,5ace:6193] +131 -> Avermedia A700 [1461:a7a1]
Index: v4l-dvb/linux/drivers/media/video/saa7134/Kconfig =================================================================== --- v4l-dvb.orig/linux/drivers/media/video/saa7134/Kconfig +++ v4l-dvb/linux/drivers/media/video/saa7134/Kconfig @@ -37,6 +37,8 @@ config VIDEO_SAA7134_DVB select DVB_TDA826X if !DVB_FE_CUSTOMISE select DVB_TDA827X if !DVB_FE_CUSTOMISE select DVB_ISL6421 if !DVB_FE_CUSTOMISE + select DVB_ZL1003X if !DVB_FE_CUSTOMISE + select DVB_MT312 if !DVB_FE_CUSTOMISE ---help--- This adds support for DVB cards based on the Philips saa7134 chip. Index: v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c =================================================================== --- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-cards.c +++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -3959,7 +3959,7 @@ struct saa7134_board saa7134_boards[] = .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - /* no DVB support for now */ + .mpeg = SAA7134_MPEG_DVB, .inputs = {{ .name = name_comp, .vmux = 1, @@ -5178,9 +5178,6 @@ int saa7134_board_init1(struct saa7134_d /* write windows gpio values */ saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x80040100, 0x80040100); saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x80040100, 0x00040100); - printk("%s: %s: hybrid analog/dvb card\n" - "%s: Sorry, only the analog inputs are supported for now.\n", - dev->name,card(dev).name, dev->name); break; } return 0; Index: v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c =================================================================== --- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-dvb.c +++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c @@ -44,6 +44,9 @@ #include "tda827x.h" #include "isl6421.h" +#include "zl1003x.h" +#include "mt312.h" + MODULE_AUTHOR("Gerd Knorr <kraxel@xxxxxxxxxxx> [SuSE Labs]"); MODULE_LICENSE("GPL"); @@ -840,6 +843,18 @@ static struct nxt200x_config kworldatsc1 .demod_address = 0x0a, }; +/* ------------------------------------------------------------------ */ + +static struct mt312_config avertv_a700_mt312 = { + .demod_address = 0x0e, + .voltage_inverted = 1, +}; + +static struct zl1003x_config avertv_a700_tuner = { + .tuner_address = 0x60, + .type = ZL1003X_TYPE_ZL10036, +}; + /* ================================================================== * Core code */ @@ -1044,6 +1059,17 @@ static int dvb_init(struct saa7134_dev * case SAA7134_BOARD_AVERMEDIA_SUPER_007: configure_tda827x_fe(dev, &avermedia_super_007_config); break; + case SAA7134_BOARD_AVERMEDIA_A700: + dev->dvb.frontend = dvb_attach(vp310_mt312_attach, + &avertv_a700_mt312, &dev->i2c_adap); + if (dev->dvb.frontend) { + if (dvb_attach(zl1003x_attach, dev->dvb.frontend, + &avertv_a700_tuner, &dev->i2c_adap) == NULL) { + wprintk("%s: No zl1003x found!\n", + __FUNCTION__); + } + } + break; default: wprintk("Huh? unknown DVB card?\n"); break;
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb