diff options
author | Andrew de Quincy <devnull@localhost> | 2004-11-20 15:23:34 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-11-20 15:23:34 +0000 |
commit | 6aaa3c9b588cb65eba7bb68b476a36c7f4478349 (patch) | |
tree | ff4015a4794e6868d89db770595d15c654a02579 /linux/drivers/media/dvb | |
parent | 783ec6850117d92bbe63bb8b0497b83e73faa562 (diff) | |
download | mediapointer-dvb-s2-6aaa3c9b588cb65eba7bb68b476a36c7f4478349.tar.gz mediapointer-dvb-s2-6aaa3c9b588cb65eba7bb68b476a36c7f4478349.tar.bz2 |
Added setting to allow inversion of OCLK
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda1004x.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda1004x.h | 3 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-av.c | 26 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-ci.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 9 |
5 files changed, 20 insertions, 23 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index 394f9eb68..ce7dbcf8f 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -533,6 +533,8 @@ static int tda10045_init(struct dvb_frontend* fe) tda1004x_write_mask(state, TDA1004X_CONFC1, 0x10, 0); // VAGC polarity tda1004x_write_byteI(state, TDA1004X_CONFADC1, 0x2e); + tda1004x_write_mask(state, 0x1f, 0x01, state->config->invert_oclk); + state->initialised = 1; return 0; } @@ -585,6 +587,8 @@ static int tda10046_init(struct dvb_frontend* fe) tda1004x_write_mask(state, TDA10046H_GPIO_SELECT, 8, 8); // GPIO select tda10046h_set_bandwidth(state, BANDWIDTH_8_MHZ); // default bandwidth 8 MHz + tda1004x_write_mask(state, 0x3a, 0x80, state->config->invert_oclk << 7); + state->initialised = 1; return 0; } diff --git a/linux/drivers/media/dvb/frontends/tda1004x.h b/linux/drivers/media/dvb/frontends/tda1004x.h index 22004e188..e452fc0ba 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.h +++ b/linux/drivers/media/dvb/frontends/tda1004x.h @@ -34,6 +34,9 @@ struct tda1004x_config /* does the "inversion" need inverted? */ u8 invert:1; + /* Does the OCLK signal need inverted? */ + u8 invert_oclk:1; + /* PLL maintenance */ int (*pll_init)(struct dvb_frontend* fe); int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c index 40dc26e9c..ffbe501d4 100644 --- a/linux/drivers/media/dvb/ttpci/budget-av.c +++ b/linux/drivers/media/dvb/ttpci/budget-av.c @@ -559,23 +559,13 @@ static int philips_tu1216_pll_init(struct dvb_frontend *fe) { struct budget *budget = (struct budget *) fe->dvb->priv; static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab }; - static u8 disable_mc44BC374c[] = { 0x1d, 0x74, 0xa0, 0x68 }; - struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tu1216_init,.len = - sizeof(tu1216_init) }; + struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; // setup PLL configuration if (i2c_transfer(&budget->i2c_adap, &tuner_msg, 1) != 1) return -EIO; msleep(1); - // disable the mc44BC374c (do not check for errors) - tuner_msg.addr = 0x65; - tuner_msg.buf = disable_mc44BC374c; - tuner_msg.len = sizeof(disable_mc44BC374c); - if (i2c_transfer(&budget->i2c_adap, &tuner_msg, 1) != 1) { - i2c_transfer(&budget->i2c_adap, &tuner_msg, 1); - } - return 0; } @@ -589,7 +579,7 @@ static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_p u8 band, cp, filter; // determine charge pump - tuner_frequency = params->frequency + 36130000; + tuner_frequency = params->frequency + 36166000; if (tuner_frequency < 87000000) return -EINVAL; else if (tuner_frequency < 130000000) @@ -616,7 +606,7 @@ static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_p // determine band if (params->frequency < 49000000) return -EINVAL; - else if (params->frequency < 159000000) + else if (params->frequency < 161000000) band = 1; else if (params->frequency < 444000000) band = 2; @@ -628,17 +618,14 @@ static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_p // setup PLL filter switch (params->u.ofdm.bandwidth) { case BANDWIDTH_6_MHZ: - tda1004x_write_byte(fe, 0x0C, 0); filter = 0; break; case BANDWIDTH_7_MHZ: - tda1004x_write_byte(fe, 0x0C, 0); filter = 0; break; case BANDWIDTH_8_MHZ: - tda1004x_write_byte(fe, 0x0C, 0xFF); filter = 1; break; @@ -647,11 +634,11 @@ static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_p } // calculate divisor - // ((36130000+((1000000/6)/2)) + Finput)/(1000000/6) - tuner_frequency = (((params->frequency / 1000) * 6) + 217280) / 1000; + // ((36166000+((1000000/6)/2)) + Finput)/(1000000/6) + tuner_frequency = (((params->frequency / 1000) * 6) + 217496) / 1000; // setup tuner buffer - tuner_buf[0] = tuner_frequency >> 8; + tuner_buf[0] = (tuner_frequency >> 8) & 0x7f; tuner_buf[1] = tuner_frequency & 0xff; tuner_buf[2] = 0xca; tuner_buf[3] = (cp << 5) | (filter << 3) | band; @@ -675,6 +662,7 @@ struct tda1004x_config philips_tu1216_config = { .demod_address = 0x8, .invert = 1, + .invert_oclk = 1, .pll_init = philips_tu1216_pll_init, .pll_set = philips_tu1216_pll_set, .request_firmware = philips_tu1216_request_firmware, diff --git a/linux/drivers/media/dvb/ttpci/budget-ci.c b/linux/drivers/media/dvb/ttpci/budget-ci.c index 287776f57..7a15c49ea 100644 --- a/linux/drivers/media/dvb/ttpci/budget-ci.c +++ b/linux/drivers/media/dvb/ttpci/budget-ci.c @@ -837,6 +837,7 @@ struct tda1004x_config philips_tdm1316l_config = { .demod_address = 0x8, .invert = 0, + .invert_oclk = 0, .pll_init = philips_tdm1316l_pll_init, .pll_set = philips_tdm1316l_pll_set, .request_firmware = philips_tdm1316l_request_firmware, diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index db786eb76..9fac18df1 100644 --- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -85,7 +85,7 @@ struct ttusb { struct dvb_adapter *adapter; struct usb_device *dev; - struct i2c_adapter i2c_adap; + struct i2c_adapter i2c_adap; int disconnecting; int iso_streaming; @@ -116,7 +116,7 @@ struct ttusb { int cc; /* MuxCounter - will increment on EVERY MUX PACKET */ /* (including stuffing. yes. really.) */ - + u8 last_result[32]; @@ -1179,7 +1179,7 @@ static int philips_tdm1316l_pll_set(struct dvb_frontend* fe, struct dvb_frontend tuner_buf[3] = (cp << 5) | (filter << 3) | band; if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) return -EIO; - + msleep(1); return 0; } @@ -1195,6 +1195,7 @@ struct tda1004x_config philips_tdm1316l_config = { .demod_address = 0x8, .invert = 1, + .invert_oclk = 0, .pll_init = philips_tdm1316l_pll_init, .pll_set = philips_tdm1316l_pll_set, .request_firmware = philips_tdm1316l_request_firmware, @@ -1203,7 +1204,7 @@ struct tda1004x_config philips_tdm1316l_config = { static void frontend_init(struct ttusb* ttusb) -{ +{ switch(ttusb->dev->descriptor.idProduct) { case 0x1005: // Hauppauge/TT Nova-USB-t budget (tda10046/Philips td1316(tda6651tt) OR cx22700/ALPS TDMB7(??)) // try the ALPS TDMB7 first |