diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-06-12 11:43:25 -0400 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2007-06-12 11:43:25 -0400 |
commit | bd0e2c8e6f97d63c29f8ddf1762c33f55c795988 (patch) | |
tree | 1eb2e8fd951e0336592f75a2f23925121ab19699 /linux/drivers | |
parent | dcdfa1b4b54bc1a0c6e99a840408698e95d46ad0 (diff) | |
download | mediapointer-dvb-s2-bd0e2c8e6f97d63c29f8ddf1762c33f55c795988.tar.gz mediapointer-dvb-s2-bd0e2c8e6f97d63c29f8ddf1762c33f55c795988.tar.bz2 |
dibusb-mb: fix broken 'tuner_pass_ctrl' functionality
From: Michael Krufky <mkrufky@linuxtv.org>
'tuner_pass_ctrl' functionality of the dib3000-mb devices was
broken in the previous changeset:
"dibusb-mb: convert pll handling to properly use dvb-pll"
This patch fixes this problem by assigning this functionality to the
i2c_gate_ctrl callback
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dibusb-mb.c | 29 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dibusb.h | 1 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dvb-usb.h | 2 |
3 files changed, 24 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c index 2f1f6c80d..42acffc60 100644 --- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c @@ -14,6 +14,14 @@ */ #include "dibusb.h" +static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) +{ + struct dvb_usb_adapter *adap = fe->dvb->priv; + struct dibusb_state *st = adap->priv; + + return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr); +} + static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) { struct dib3000_config demod_cfg; @@ -25,13 +33,17 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) &adap->dev->i2c_adap, &st->ops)) == NULL) return -ENODEV; - adap->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; + adap->fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl; return 0; } static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) { + struct dibusb_state *st = adap->priv; + + st->tuner_addr = 0x61; + dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap, &dvb_pll_tua6010xs); return 0; @@ -39,6 +51,10 @@ static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap) { + struct dibusb_state *st = adap->priv; + + st->tuner_addr = 0x60; + dvb_attach(dvb_pll_attach, adap->fe, 0x60, &adap->dev->i2c_adap, &dvb_pll_tda665x); return 0; @@ -55,20 +71,21 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap) { .flags = 0, .buf = b, .len = 2 }, { .flags = I2C_M_RD, .buf = b2, .len = 1 }, }; + struct dibusb_state *st = adap->priv; /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */ - msg[0].addr = msg[1].addr = 0x60; + st->tuner_addr = 0x60; - if (adap->tuner_pass_ctrl) - adap->tuner_pass_ctrl(adap->fe,1,msg[0].addr); + if (adap->fe->ops.i2c_gate_ctrl) + adap->fe->ops.i2c_gate_ctrl(adap->fe,1); if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) { err("tuner i2c write failed."); ret = -EREMOTEIO; } - if (adap->tuner_pass_ctrl) - adap->tuner_pass_ctrl(adap->fe,0,msg[0].addr); + if (adap->fe->ops.i2c_gate_ctrl) + adap->fe->ops.i2c_gate_ctrl(adap->fe,0); if (b2[0] == 0xfe) { info("This device has the Thomson Cable onboard. Which is default."); diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb.h b/linux/drivers/media/dvb/dvb-usb/dibusb.h index b60781032..8e847aa73 100644 --- a/linux/drivers/media/dvb/dvb-usb/dibusb.h +++ b/linux/drivers/media/dvb/dvb-usb/dibusb.h @@ -99,6 +99,7 @@ struct dibusb_state { struct dib_fe_xfer_ops ops; int mt2060_present; + u8 tuner_addr; }; struct dibusb_device_state { diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h index 2a98c69cb..cc5d432bc 100644 --- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -300,8 +300,6 @@ struct dvb_usb_adapter { int feedcount; int pid_filtering; - int (*tuner_pass_ctrl) (struct dvb_frontend *, int, u8); - /* dvb */ struct dvb_adapter dvb_adap; struct dmxdev dmxdev; |