diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/mt352.c | 28 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 18 |
2 files changed, 14 insertions, 32 deletions
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c index ed3bede029eb..8601a3f43074 100644 --- a/drivers/media/dvb/frontends/mt352.c +++ b/drivers/media/dvb/frontends/mt352.c | |||
@@ -287,30 +287,22 @@ static int mt352_set_parameters(struct dvb_frontend* fe, | |||
287 | mt352_calc_nominal_rate(state, op->bandwidth, buf+4); | 287 | mt352_calc_nominal_rate(state, op->bandwidth, buf+4); |
288 | mt352_calc_input_freq(state, buf+6); | 288 | mt352_calc_input_freq(state, buf+6); |
289 | 289 | ||
290 | // if there is no secondary tuner, call set_params to set up a potential | ||
291 | // tuner attached elsewhere | ||
292 | if (state->config.no_tuner) { | 290 | if (state->config.no_tuner) { |
293 | if (fe->ops->tuner_ops.set_params) { | 291 | if (fe->ops->tuner_ops.set_params) { |
294 | fe->ops->tuner_ops.set_params(fe, param); | 292 | fe->ops->tuner_ops.set_params(fe, param); |
295 | if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0); | 293 | if (fe->ops->i2c_gate_ctrl) |
294 | fe->ops->i2c_gate_ctrl(fe, 0); | ||
296 | } | 295 | } |
297 | 296 | ||
298 | /* start decoding only */ | 297 | mt352_write(fe, buf, 8); |
299 | mt352_write(fe, fsm_go, 2); | 298 | mt352_write(fe, fsm_go, 2); |
300 | } | 299 | } else { |
301 | 300 | if (fe->ops->tuner_ops.calc_regs) { | |
302 | // retrieve the pllbuf - we do this even if there is no | 301 | fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5); |
303 | // secondary tuner simply so we have a record of what was sent for | 302 | buf[8] <<= 1; |
304 | // debugging. | 303 | mt352_write(fe, buf, sizeof(buf)); |
305 | if (fe->ops->tuner_ops.calc_regs) { | 304 | mt352_write(fe, tuner_go, 2); |
306 | fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5); | 305 | } |
307 | buf[8] <<= 1; | ||
308 | mt352_write(fe, buf, sizeof(buf)); | ||
309 | } | ||
310 | |||
311 | // send PLL and start tuning and then decoding | ||
312 | if (!state->config.no_tuner) { | ||
313 | mt352_write(fe, tuner_go, 2); | ||
314 | } | 306 | } |
315 | 307 | ||
316 | return 0; | 308 | return 0; |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index f2b155a2299d..716b829c460f 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -132,9 +132,8 @@ static int mt352_aver777_init(struct dvb_frontend* fe) | |||
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | static int mt352_pinnacle_tuner_calc_regs(struct dvb_frontend* fe, | 135 | static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe, |
136 | struct dvb_frontend_parameters* params, | 136 | struct dvb_frontend_parameters* params) |
137 | u8* pllbuf, int buf_len) | ||
138 | { | 137 | { |
139 | u8 off[] = { 0x00, 0xf1}; | 138 | u8 off[] = { 0x00, 0xf1}; |
140 | u8 on[] = { 0x00, 0x71}; | 139 | u8 on[] = { 0x00, 0x71}; |
@@ -143,9 +142,6 @@ static int mt352_pinnacle_tuner_calc_regs(struct dvb_frontend* fe, | |||
143 | struct saa7134_dev *dev = fe->dvb->priv; | 142 | struct saa7134_dev *dev = fe->dvb->priv; |
144 | struct v4l2_frequency f; | 143 | struct v4l2_frequency f; |
145 | 144 | ||
146 | if (buf_len < 5) | ||
147 | return -EINVAL; | ||
148 | |||
149 | /* set frequency (mt2050) */ | 145 | /* set frequency (mt2050) */ |
150 | f.tuner = 0; | 146 | f.tuner = 0; |
151 | f.type = V4L2_TUNER_DIGITAL_TV; | 147 | f.type = V4L2_TUNER_DIGITAL_TV; |
@@ -162,13 +158,7 @@ static int mt352_pinnacle_tuner_calc_regs(struct dvb_frontend* fe, | |||
162 | pinnacle_antenna_pwr(dev, antenna_pwr); | 158 | pinnacle_antenna_pwr(dev, antenna_pwr); |
163 | 159 | ||
164 | /* mt352 setup */ | 160 | /* mt352 setup */ |
165 | mt352_pinnacle_init(fe); | 161 | return mt352_pinnacle_init(fe); |
166 | pllbuf[0] = 0x61; | ||
167 | pllbuf[1] = 0x00; | ||
168 | pllbuf[2] = 0x00; | ||
169 | pllbuf[3] = 0x80; | ||
170 | pllbuf[4] = 0x00; | ||
171 | return 5; | ||
172 | } | 162 | } |
173 | 163 | ||
174 | static int mt352_aver777_tuner_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len) | 164 | static int mt352_aver777_tuner_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len) |
@@ -1025,7 +1015,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1025 | dev->dvb.frontend = mt352_attach(&pinnacle_300i, | 1015 | dev->dvb.frontend = mt352_attach(&pinnacle_300i, |
1026 | &dev->i2c_adap); | 1016 | &dev->i2c_adap); |
1027 | if (dev->dvb.frontend) { | 1017 | if (dev->dvb.frontend) { |
1028 | dev->dvb.frontend->ops->tuner_ops.calc_regs = mt352_pinnacle_tuner_calc_regs; | 1018 | dev->dvb.frontend->ops->tuner_ops.set_params = mt352_pinnacle_tuner_set_params; |
1029 | } | 1019 | } |
1030 | break; | 1020 | break; |
1031 | 1021 | ||