diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb/digitv.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index b5acb11c0bc9..36e0f8fee37a 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -118,7 +118,8 @@ static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_f | |||
118 | { | 118 | { |
119 | struct dvb_usb_adapter *adap = fe->dvb->priv; | 119 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
120 | u8 b[5]; | 120 | u8 b[5]; |
121 | dvb_usb_tuner_calc_regs(fe,fep,b, 5); | 121 | |
122 | fe->ops.tuner_ops.calc_regs(fe, fep, b, sizeof(b)); | ||
122 | if (fe->ops.i2c_gate_ctrl) | 123 | if (fe->ops.i2c_gate_ctrl) |
123 | fe->ops.i2c_gate_ctrl(fe, 1); | 124 | fe->ops.i2c_gate_ctrl(fe, 1); |
124 | return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); | 125 | return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); |
@@ -130,12 +131,14 @@ static struct nxt6000_config digitv_nxt6000_config = { | |||
130 | 131 | ||
131 | static int digitv_frontend_attach(struct dvb_usb_adapter *adap) | 132 | static int digitv_frontend_attach(struct dvb_usb_adapter *adap) |
132 | { | 133 | { |
134 | struct digitv_state *st = adap->dev->priv; | ||
135 | |||
133 | if ((adap->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) { | 136 | if ((adap->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) { |
134 | adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; | 137 | st->is_nxt6000 = 0; |
135 | return 0; | 138 | return 0; |
136 | } | 139 | } |
137 | if ((adap->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) { | 140 | if ((adap->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) { |
138 | adap->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; | 141 | st->is_nxt6000 = 1; |
139 | return 0; | 142 | return 0; |
140 | } | 143 | } |
141 | return -EIO; | 144 | return -EIO; |
@@ -143,8 +146,14 @@ static int digitv_frontend_attach(struct dvb_usb_adapter *adap) | |||
143 | 146 | ||
144 | static int digitv_tuner_attach(struct dvb_usb_adapter *adap) | 147 | static int digitv_tuner_attach(struct dvb_usb_adapter *adap) |
145 | { | 148 | { |
146 | adap->pll_addr = 0x60; | 149 | struct digitv_state *st = adap->dev->priv; |
147 | adap->pll_desc = &dvb_pll_tded4; | 150 | |
151 | if (!dvb_attach(dvb_pll_attach, adap->fe, 0x60, NULL, &dvb_pll_tded4)) | ||
152 | return -ENODEV; | ||
153 | |||
154 | if (st->is_nxt6000) | ||
155 | adap->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; | ||
156 | |||
148 | return 0; | 157 | return 0; |
149 | } | 158 | } |
150 | 159 | ||
@@ -273,6 +282,8 @@ static struct dvb_usb_device_properties digitv_properties = { | |||
273 | .usb_ctrl = CYPRESS_FX2, | 282 | .usb_ctrl = CYPRESS_FX2, |
274 | .firmware = "dvb-usb-digitv-02.fw", | 283 | .firmware = "dvb-usb-digitv-02.fw", |
275 | 284 | ||
285 | .size_of_priv = sizeof(struct digitv_state), | ||
286 | |||
276 | .num_adapters = 1, | 287 | .num_adapters = 1, |
277 | .adapter = { | 288 | .adapter = { |
278 | { | 289 | { |