diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-06-12 11:43:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-18 13:24:16 -0400 |
commit | 6c08d9290e2fc87b217d0f7c9cd67c9240ad7147 (patch) | |
tree | 7954f0d1a19623894826f0205844b4664f5f72eb /drivers/media | |
parent | 865dd115c95df6997f3d9dd638e6f92298f0422f (diff) |
V4L/DVB (5779): Dibusb-mb: fix broken 'tuner_pass_ctrl' functionality
'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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-mb.c | 29 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb.h | 2 |
3 files changed, 24 insertions, 8 deletions
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c index a171900634e0..67cd48425d46 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c | |||
@@ -14,6 +14,14 @@ | |||
14 | */ | 14 | */ |
15 | #include "dibusb.h" | 15 | #include "dibusb.h" |
16 | 16 | ||
17 | static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) | ||
18 | { | ||
19 | struct dvb_usb_adapter *adap = fe->dvb->priv; | ||
20 | struct dibusb_state *st = adap->priv; | ||
21 | |||
22 | return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr); | ||
23 | } | ||
24 | |||
17 | static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) | 25 | static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) |
18 | { | 26 | { |
19 | struct dib3000_config demod_cfg; | 27 | struct dib3000_config demod_cfg; |
@@ -25,13 +33,17 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) | |||
25 | &adap->dev->i2c_adap, &st->ops)) == NULL) | 33 | &adap->dev->i2c_adap, &st->ops)) == NULL) |
26 | return -ENODEV; | 34 | return -ENODEV; |
27 | 35 | ||
28 | adap->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; | 36 | adap->fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl; |
29 | 37 | ||
30 | return 0; | 38 | return 0; |
31 | } | 39 | } |
32 | 40 | ||
33 | static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) | 41 | static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) |
34 | { | 42 | { |
43 | struct dibusb_state *st = adap->priv; | ||
44 | |||
45 | st->tuner_addr = 0x61; | ||
46 | |||
35 | dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap, | 47 | dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap, |
36 | &dvb_pll_tua6010xs); | 48 | &dvb_pll_tua6010xs); |
37 | return 0; | 49 | return 0; |
@@ -39,6 +51,10 @@ static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) | |||
39 | 51 | ||
40 | static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap) | 52 | static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap) |
41 | { | 53 | { |
54 | struct dibusb_state *st = adap->priv; | ||
55 | |||
56 | st->tuner_addr = 0x60; | ||
57 | |||
42 | dvb_attach(dvb_pll_attach, adap->fe, 0x60, &adap->dev->i2c_adap, | 58 | dvb_attach(dvb_pll_attach, adap->fe, 0x60, &adap->dev->i2c_adap, |
43 | &dvb_pll_tda665x); | 59 | &dvb_pll_tda665x); |
44 | return 0; | 60 | return 0; |
@@ -55,20 +71,21 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap) | |||
55 | { .flags = 0, .buf = b, .len = 2 }, | 71 | { .flags = 0, .buf = b, .len = 2 }, |
56 | { .flags = I2C_M_RD, .buf = b2, .len = 1 }, | 72 | { .flags = I2C_M_RD, .buf = b2, .len = 1 }, |
57 | }; | 73 | }; |
74 | struct dibusb_state *st = adap->priv; | ||
58 | 75 | ||
59 | /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */ | 76 | /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */ |
60 | msg[0].addr = msg[1].addr = 0x60; | 77 | st->tuner_addr = 0x60; |
61 | 78 | ||
62 | if (adap->tuner_pass_ctrl) | 79 | if (adap->fe->ops.i2c_gate_ctrl) |
63 | adap->tuner_pass_ctrl(adap->fe,1,msg[0].addr); | 80 | adap->fe->ops.i2c_gate_ctrl(adap->fe,1); |
64 | 81 | ||
65 | if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) { | 82 | if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) { |
66 | err("tuner i2c write failed."); | 83 | err("tuner i2c write failed."); |
67 | ret = -EREMOTEIO; | 84 | ret = -EREMOTEIO; |
68 | } | 85 | } |
69 | 86 | ||
70 | if (adap->tuner_pass_ctrl) | 87 | if (adap->fe->ops.i2c_gate_ctrl) |
71 | adap->tuner_pass_ctrl(adap->fe,0,msg[0].addr); | 88 | adap->fe->ops.i2c_gate_ctrl(adap->fe,0); |
72 | 89 | ||
73 | if (b2[0] == 0xfe) { | 90 | if (b2[0] == 0xfe) { |
74 | info("This device has the Thomson Cable onboard. Which is default."); | 91 | info("This device has the Thomson Cable onboard. Which is default."); |
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h index b60781032742..8e847aa73ba1 100644 --- a/drivers/media/dvb/dvb-usb/dibusb.h +++ b/drivers/media/dvb/dvb-usb/dibusb.h | |||
@@ -99,6 +99,7 @@ | |||
99 | struct dibusb_state { | 99 | struct dibusb_state { |
100 | struct dib_fe_xfer_ops ops; | 100 | struct dib_fe_xfer_ops ops; |
101 | int mt2060_present; | 101 | int mt2060_present; |
102 | u8 tuner_addr; | ||
102 | }; | 103 | }; |
103 | 104 | ||
104 | struct dibusb_device_state { | 105 | struct dibusb_device_state { |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 70be200665e4..d1b3c7b81fff 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -297,8 +297,6 @@ struct dvb_usb_adapter { | |||
297 | int feedcount; | 297 | int feedcount; |
298 | int pid_filtering; | 298 | int pid_filtering; |
299 | 299 | ||
300 | int (*tuner_pass_ctrl) (struct dvb_frontend *, int, u8); | ||
301 | |||
302 | /* dvb */ | 300 | /* dvb */ |
303 | struct dvb_adapter dvb_adap; | 301 | struct dvb_adapter dvb_adap; |
304 | struct dmxdev dmxdev; | 302 | struct dmxdev dmxdev; |