Message ID | 201212182245.50722.linux@rainbow-software.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Update: GPIO 9 is CE6313 SLEEP signal GPIO 23 is CE5039 SLEEP signal GPIO 25 is CE6313 RESET# signal - this one needs to be set high for CE6313 to appear on I2C bus But there is a problem with CE5039 (zl10039) - the I2C bus breaks during its initialization (SDA stuck low): Here it works (communication with CE6313): [ 921.556682] start xfer [ 921.556684] send address [ 921.556687] saa7133[0]: i2c data => 0x1c [ 921.556690] saa7133[0]: i2c stat <= BUSY [ 921.556725] saa7133[0]: i2c stat <= BUSY [ 921.556759] saa7133[0]: i2c stat <= BUSY [ 921.556794] saa7133[0]: i2c stat <= BUSY [ 921.556828] saa7133[0]: i2c stat <= DONE_WRITE [ 921.556831] saa7133[0]: i2c stat <= DONE_WRITE [ 921.556833] write bytes [ 921.556836] saa7133[0]: i2c data => 0x14 [ 921.556838] saa7133[0]: i2c stat <= BUSY [ 921.556873] saa7133[0]: i2c stat <= BUSY [ 921.556907] saa7133[0]: i2c stat <= BUSY [ 921.556942] saa7133[0]: i2c stat <= DONE_WRITE [ 921.556945] saa7133[0]: i2c stat <= DONE_WRITE [ 921.556948] saa7133[0]: i2c data => 0x40 [ 921.556950] saa7133[0]: i2c stat <= BUSY [ 921.556985] saa7133[0]: i2c stat <= BUSY [ 921.557019] saa7133[0]: i2c stat <= BUSY [ 921.557054] saa7133[0]: i2c stat <= DONE_WRITE [ 921.557057] saa7133[0]: i2c stat <= DONE_WRITE [ 921.557058] xfer done [ 921.557060] saa7133[0]: i2c attr => STOP [ 921.557064] saa7133[0]: i2c stat <= BUSY [ 921.557098] saa7133[0]: i2c stat <= DONE_STOP [ 921.557101] saa7133[0]: i2c stat <= DONE_STOP Here starts CE5039 communication: [ 921.564672] zl10039_read [ 921.564677] saa7133[0]: i2c stat <= DONE_STOP [ 921.564679] start xfer [ 921.564681] send address [ 921.564684] saa7133[0]: i2c data => 0xc0 [ 921.564686] saa7133[0]: i2c stat <= BUSY [ 921.564721] saa7133[0]: i2c stat <= BUSY [ 921.564755] saa7133[0]: i2c stat <= BUSY [ 921.564790] saa7133[0]: i2c stat <= BUSY And here it breaks: [ 921.564824] saa7133[0]: i2c stat <= ARB_LOST [ 921.564827] saa7133[0]: i2c stat <= ARB_LOST [ 921.564829] zl10039_read: i2c read error [ 921.564833] saa7133[0]: i2c stat <= ARB_LOST [ 921.564834] saa7133[0]: i2c reset [ 921.564837] saa7133[0]: i2c stat <= ARB_LOST [ 921.564839] saa7133[0]: i2c stat => ARB_LOST [ 921.564843] saa7133[0]: i2c stat <= ARB_LOST [ 921.564877] saa7133[0]: i2c stat <= IDLE [ 921.564879] saa7133[0]: i2c attr => NOP And everything is broken now (until reloading saa7134 module): [ 921.564882] start xfer [ 921.564883] send address [ 921.564886] saa7133[0]: i2c data => 0x1c [ 921.564889] saa7133[0]: i2c stat <= BUSY [ 921.564923] saa7133[0]: i2c stat <= BUSY [ 921.564958] saa7133[0]: i2c stat <= BUSY [ 921.564992] saa7133[0]: i2c stat <= BUSY [ 921.565026] saa7133[0]: i2c stat <= BUSY [ 921.565061] saa7133[0]: i2c stat <= BUSY [ 921.565095] saa7133[0]: i2c stat <= BUSY [ 921.565130] saa7133[0]: i2c stat <= BUSY [ 921.565164] saa7133[0]: i2c stat <= BUSY [ 921.565199] saa7133[0]: i2c stat <= BUSY [ 921.565233] saa7133[0]: i2c stat <= BUSY [ 921.565268] saa7133[0]: i2c stat <= BUSY [ 921.565302] saa7133[0]: i2c stat <= BUSY [ 921.565336] saa7133[0]: i2c stat <= BUSY [ 921.565371] saa7133[0]: i2c stat <= BUSY [ 921.565405] saa7133[0]: i2c stat <= BUSY [ 921.565440] mt312_read: ret == -5 [ 921.565450] saa7133[0]/dvb: dvb_init: No zl10039 found!
Update 2: all I2C breakage is caused by i2c gates in CE6313 and TDA8290 so I just commented-out the calls in tuner drivers for now. Tuner detection in tda8290 breaks because it finds CE5039 at 0x60. Disabling CE5039 using GPIO in board_init1() and enabling it in dvb_init() allows all chips to initialize properly: [ 130.658813] saa7130/34: v4l2 driver version 0, 2, 17 loaded [ 130.662715] saa7133[0]: found at 0000:02:01.0, rev: 209, irq: 9, latency: 32, mmio: 0xf4000000 [ 130.665879] saa7133[0]: subsystem: 1461:2055, board: AverMedia AverTV Satellite Hybrid+FM A706 [card=191,autodetected] [ 130.669347] saa7133[0]: board init: gpio is 3500 [ 130.822347] saa7133[0]: i2c eeprom 00: 61 14 55 20 00 00 00 00 00 00 00 00 00 00 00 00 [ 130.825689] saa7133[0]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff [ 130.829008] saa7133[0]: i2c eeprom 20: 02 40 01 02 02 01 01 04 06 ff 00 57 ff ff ff ff [ 130.832317] saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.835627] saa7133[0]: i2c eeprom 40: 60 a0 00 c6 96 ff 05 30 8b 05 ff 40 ff ff ff ff [ 130.838932] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.842222] saa7133[0]: i2c eeprom 60: ff 89 00 c0 ff 1c 08 19 97 89 ff ff 80 15 0a ff [ 130.845525] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.848833] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.852109] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.855351] saa7133[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.858565] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.861736] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.864894] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.868021] saa7133[0]: i2c eeprom e0: 00 01 81 b0 65 07 ff ff ff ff ff ff ff ff ff ff [ 130.871133] saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 130.930349] tuner 2-004b: Tuner -1 found with type(s) Radio TV. [ 130.974345] tda829x 2-004b: setting tuner address to 63 [ 131.019535] tda18271 2-0063: creating new instance [ 131.030345] TDA18271HD/C2 detected @ 2-0063 [ 131.454335] tda18271: performing RF tracking filter calibration [ 135.778283] tda18271: RF tracking filter calibration complete [ 135.786296] tda829x 2-004b: type set to tda8290+18271 [ 138.635047] saa7133[0]: registered device video0 [v4l2] [ 138.639407] saa7133[0]: registered device vbi0 [ 138.643130] saa7133[0]: registered device radio0 [ 138.676190] dvb_init() allocating 1 frontend [ 139.730238] DVB: registering new adapter (saa7133[0]) [ 139.733196] saa7134 0000:02:01.0: DVB: registering adapter 0 frontend 0 (Zarlink ZL10313 DVB-S)... [ 140.321583] saa7134 ALSA driver for DMA sound loaded [ 140.325361] saa7133[0]/alsa: saa7133[0] at 0xf4000000 irq 9 registered as card -1 The card comes to life slowly: FM radio works for a couple of seconds! With arecord | aplay, noise is played. When a radio station is tuned (v4l2ctl -d /dev/radio0 -f something), I can hear it clearly for a 2-3 seconds, then it fades to noise. These errors appear in log: [ 521.281639] tda18271c2_rf_tracking_filters_correction: [2-0063|M] error -22 on line 277 [ 521.289675] tda18271_calc_ir_measure: [2-0063|M] error -34 on line 686 [ 521.289682] tda18271_calc_bp_filter: [2-0063|M] error -34 on line 618 [ 521.289686] tda18271_calc_rf_band: [2-0063|M] error -34 on line 652 [ 521.289690] tda18271_calc_gain_taper: [2-0063|M] error -34 on line 669
--- a/drivers/media/pci/saa7134/saa7134-cards.c +++ b/drivers/media/pci/saa7134/saa7134-cards.c @@ -5773,6 +5773,36 @@ struct saa7134_board saa7134_boards[] = { .gpio = 0x0000000, }, }, + [SAA7134_BOARD_AVERMEDIA_A706] = { + .name = "AverMedia AverTV Satellite Hybrid+FM A706", + .audio_clock = 0x00187de7, + .tuner_type = TUNER_PHILIPS_TDA8290, + .radio_type = UNSET, + .tuner_addr = 0x63, + .radio_addr = ADDR_UNSET, + .tuner_config = 2, + .gpiomask = 1 << 21, + .mpeg = SAA7134_MPEG_DVB, + .inputs = {{ + .name = name_tv, + .vmux = 1, + .amux = TV, + .tv = 1, + }, { + .name = name_comp, + .vmux = 0, + .amux = LINE2, + }, { + .name = name_svideo, + .vmux = 8, + .amux = LINE2, + } }, + .radio = { + .name = name_radio, + .amux = TV, + .gpio = 0x0200000, + }, + }, }; @@ -7020,6 +7050,12 @@ struct pci_device_id saa7134_pci_tbl[] = { .subdevice = 0x0911, .driver_data = SAA7134_BOARD_SENSORAY811_911, }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x1461, /* Avermedia Technologies Inc */ + .subdevice = 0x2055, /* AverTV Satellite Hybrid+FM A706 */ + .driver_data = SAA7134_BOARD_AVERMEDIA_A706, + }, { /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, @@ -7266,6 +7302,7 @@ static int saa7134_tda8290_callback(struct saa7134_dev *dev, case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: case SAA7134_BOARD_KWORLD_PC150U: case SAA7134_BOARD_MAGICPRO_PROHDTV_PRO2: + case SAA7134_BOARD_AVERMEDIA_A706: /* tda8290 + tda18271 */ ret = saa7134_tda8290_18271_callback(dev, command, arg); break; diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index b209de4..c6f886d 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c @@ -1070,6 +1070,11 @@ static struct mt312_config zl10313_compro_s350_config = { .demod_address = 0x0e, }; +static struct mt312_config zl10313_avermedia_a706_config = { + .demod_address = 0x0e, +}; + + static struct lgdt3305_config hcw_lgdt3305_config = { .i2c_addr = 0x0e, .mpeg_mode = LGDT3305_MPEG_SERIAL, @@ -1817,6 +1822,19 @@ static int dvb_init(struct saa7134_dev *dev) &prohdtv_pro2_tda18271_config); } break; + case SAA7134_BOARD_AVERMEDIA_A706: + fe0->dvb.frontend = dvb_attach(mt312_attach, + &zl10313_avermedia_a706_config, &dev->i2c_adap); + if (fe0->dvb.frontend) { + dvb_attach(tda829x_attach, fe0->dvb.frontend, + &dev->i2c_adap, 0x4b, + &tda829x_no_probe); + if (dvb_attach(zl10039_attach, fe0->dvb.frontend, + 0x60, &dev->i2c_adap) == NULL) + wprintk("%s: No zl10039 found!\n", + __func__); + } + break; default: wprintk("Huh? unknown DVB card?\n"); break; diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h index c24b651..6cef84d 100644 --- a/drivers/media/pci/saa7134/saa7134.h +++ b/drivers/media/pci/saa7134/saa7134.h @@ -332,6 +332,7 @@ struct saa7134_card_ir { #define SAA7134_BOARD_SENSORAY811_911 188 #define SAA7134_BOARD_KWORLD_PC150U 189 #define SAA7134_BOARD_ASUSTeK_PS3_100 190 +#define SAA7134_BOARD_AVERMEDIA_A706 191 #define SAA7134_MAXBOARDS 32 #define SAA7134_INPUT_MAX 8