diff options
author | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:24:11 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:24:11 +0000 |
commit | 7e949443baebedef67aaa31d742fa994e218a39b (patch) | |
tree | 46d594c6dcb3327a659aec8e75d68c0c192c803b /linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c | |
parent | abec1400ec7e1b351d714078a12d365f2929f7ab (diff) | |
download | mediapointer-dvb-s2-7e949443baebedef67aaa31d742fa994e218a39b.tar.gz mediapointer-dvb-s2-7e949443baebedef67aaa31d742fa994e218a39b.tar.bz2 |
- moved the mirrored pid_filter_table back to dvb-dibusb
- first almost working version for HanfTek UMT-010
- found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek
- minor cleanups
Diffstat (limited to 'linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c')
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c | 64 |
1 files changed, 53 insertions, 11 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c index 4afd72410..925c8599f 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c @@ -125,6 +125,27 @@ static int dibusb_tuner_quirk(struct usb_dibusb *dib) return 0; } +/* there is a ugly pid_filter in the firmware of the umt devices, it is accessible + * by i2c address 0x8. Don't know how to deactivate it and how many rows it has. + */ +static int dibusb_umt_pid_control(struct dvb_frontend *fe, int index, int pid, int onoff) +{ + struct usb_dibusb *dib = fe->dvb->priv; + u8 b[3]; + b[0] = index; + if (onoff) { + b[1] = (pid >> 8) & 0xff; + b[2] = pid & 0xff; + } else { + b[1] = 0; + b[2] = 0; + } + dibusb_i2c_msg(dib, 0x8, b, 3, NULL,0); + dibusb_set_streaming_mode(dib,0); + dibusb_set_streaming_mode(dib,1); + return 0; +} + int dibusb_fe_init(struct usb_dibusb* dib) { struct dib3000_config demod_cfg; @@ -149,6 +170,7 @@ int dibusb_fe_init(struct usb_dibusb* dib) case DIBUSB_MT352: mt352_hanftek_umt_010_config.demod_address = dib->dibdev->dev_cl->demod->i2c_addrs[i]; dib->fe = mt352_attach(&mt352_hanftek_umt_010_config, &dib->i2c_adap); + dib->xfer_ops.pid_ctrl = dibusb_umt_pid_control; break; } if (dib->fe != NULL) { @@ -156,6 +178,13 @@ int dibusb_fe_init(struct usb_dibusb* dib) break; } } + if (dib->fe->ops->sleep != NULL) + dib->fe_sleep = dib->fe->ops->sleep; + dib->fe->ops->sleep = dibusb_hw_sleep; + + if (dib->fe->ops->init != NULL ) + dib->fe_init = dib->fe->ops->init; + dib->fe->ops->init = dibusb_hw_wakeup; /* setting the default tuner */ dib->tuner = dib->dibdev->dev_cl->tuner; @@ -420,8 +449,6 @@ static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[ #define TUNER_MUL 62500 - deb_info("tdtp debug %d MHz, BW: %d\n",fep->frequency,fep->u.ofdm.bandwidth); - div = (fep->frequency + 36125000 + TUNER_MUL / 2) / TUNER_MUL; if (fep->frequency < 174500000) @@ -441,26 +468,41 @@ static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[ pllbuf[2] = 0xce; pllbuf[3] = (p4 << 4) | p3210; - deb_info("pllbuf[4] = %x\n",pllbuf[4]); - return 0; } static int lg_tdtp_e102p_mt352_demod_init(struct dvb_frontend *fe) { - static u8 mt352_clock_config [] = { 0x89, 0xb0, 0x2d }; - static u8 mt352_reset [] = { 0x50, 0x80 }; - static u8 mt352_adc_ctl_1_cfg [] = { 0x8E, 0x40 }; - static u8 mt352_agc_cfg [] = { 0x67, 0x14, 0x22 }; - static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 }; + static u8 mt352_clock_config[] = { 0x89, 0xb0, 0x2d }; + static u8 mt352_reset[] = { 0x50, 0x80 }; + static u8 mt352_mclk_ratio[] = { 0x8b, 0x00 }; + static u8 mt352_adc_ctl_1_cfg[] = { 0x8E, 0x40 }; + static u8 mt352_agc_cfg[] = { 0x67, 0x14, 0x22 }; + static u8 mt352_sec_agc_cfg[] = { 0x69, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x40, 0x40 }; + + static u8 mt352_unk [] = { 0xb5, 0x7a }; + + static u8 mt352_acq_ctl[] = { 0x53, 0x5f }; + static u8 mt352_input_freq_1[] = { 0x56, 0xf1, 0x05 }; + +// static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 }; mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config)); udelay(2000); mt352_write(fe, mt352_reset, sizeof(mt352_reset)); + mt352_write(fe, mt352_mclk_ratio, sizeof(mt352_mclk_ratio)); + mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg)); - mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg)); - mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg)); + + mt352_write(fe, mt352_sec_agc_cfg, sizeof(mt352_sec_agc_cfg)); + + mt352_write(fe, mt352_unk, sizeof(mt352_unk)); + + mt352_write(fe, mt352_acq_ctl, sizeof(mt352_acq_ctl)); + mt352_write(fe, mt352_input_freq_1, sizeof(mt352_input_freq_1)); + +// mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg)); return 0; } |