diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/common/tuners/tuner-simple.c | 31 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 64 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dvb-pll.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/mt352.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/nxt200x.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/zl10353.c | 2 |
8 files changed, 54 insertions, 57 deletions
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c index e6342dbb2cf7..1dad5fbb4de0 100644 --- a/drivers/media/common/tuners/tuner-simple.c +++ b/drivers/media/common/tuners/tuner-simple.c | |||
@@ -884,7 +884,6 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, | |||
884 | } | 884 | } |
885 | 885 | ||
886 | static int simple_dvb_calc_regs(struct dvb_frontend *fe, | 886 | static int simple_dvb_calc_regs(struct dvb_frontend *fe, |
887 | struct dvb_frontend_parameters *params, | ||
888 | u8 *buf, int buf_len) | 887 | u8 *buf, int buf_len) |
889 | { | 888 | { |
890 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 889 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
@@ -896,28 +895,14 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe, | |||
896 | if (buf_len < 5) | 895 | if (buf_len < 5) |
897 | return -EINVAL; | 896 | return -EINVAL; |
898 | 897 | ||
899 | switch (delsys) { | 898 | frequency = simple_dvb_configure(fe, buf+1, delsys, c->frequency, bw); |
900 | case SYS_DVBT: | ||
901 | case SYS_DVBT2: | ||
902 | if (params->u.ofdm.bandwidth == BANDWIDTH_6_MHZ) | ||
903 | bw = 6000000; | ||
904 | if (params->u.ofdm.bandwidth == BANDWIDTH_7_MHZ) | ||
905 | bw = 7000000; | ||
906 | if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) | ||
907 | bw = 8000000; | ||
908 | break; | ||
909 | default: | ||
910 | break; | ||
911 | } | ||
912 | frequency = simple_dvb_configure(fe, buf+1, delsys, params->frequency, bw); | ||
913 | if (frequency == 0) | 899 | if (frequency == 0) |
914 | return -EINVAL; | 900 | return -EINVAL; |
915 | 901 | ||
916 | buf[0] = priv->i2c_props.addr; | 902 | buf[0] = priv->i2c_props.addr; |
917 | 903 | ||
918 | priv->frequency = frequency; | 904 | priv->frequency = frequency; |
919 | priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? | 905 | priv->bandwidth = c->bandwidth_hz; |
920 | params->u.ofdm.bandwidth : 0; | ||
921 | 906 | ||
922 | return 5; | 907 | return 5; |
923 | } | 908 | } |
@@ -1044,7 +1029,17 @@ static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency) | |||
1044 | static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) | 1029 | static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) |
1045 | { | 1030 | { |
1046 | struct tuner_simple_priv *priv = fe->tuner_priv; | 1031 | struct tuner_simple_priv *priv = fe->tuner_priv; |
1047 | *bandwidth = priv->bandwidth; | 1032 | switch (priv->bandwidth) { |
1033 | case 6000000: | ||
1034 | *bandwidth = BANDWIDTH_6_MHZ; | ||
1035 | break; | ||
1036 | case 7000000: | ||
1037 | *bandwidth = BANDWIDTH_7_MHZ; | ||
1038 | break; | ||
1039 | case 8000000: | ||
1040 | *bandwidth = BANDWIDTH_8_MHZ; | ||
1041 | break; | ||
1042 | } | ||
1048 | return 0; | 1043 | return 0; |
1049 | } | 1044 | } |
1050 | 1045 | ||
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 5948601ec809..87e4c72989d1 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -148,8 +148,9 @@ static int thomson_dtt7579_demod_init(struct dvb_frontend* fe) | |||
148 | return 0; | 148 | return 0; |
149 | } | 149 | } |
150 | 150 | ||
151 | static int thomson_dtt7579_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len) | 151 | static int thomson_dtt7579_tuner_calc_regs(struct dvb_frontend *fe, u8* pllbuf, int buf_len) |
152 | { | 152 | { |
153 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
153 | u32 div; | 154 | u32 div; |
154 | unsigned char bs = 0; | 155 | unsigned char bs = 0; |
155 | unsigned char cp = 0; | 156 | unsigned char cp = 0; |
@@ -157,18 +158,18 @@ static int thomson_dtt7579_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_f | |||
157 | if (buf_len < 5) | 158 | if (buf_len < 5) |
158 | return -EINVAL; | 159 | return -EINVAL; |
159 | 160 | ||
160 | div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; | 161 | div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; |
161 | 162 | ||
162 | if (params->frequency < 542000000) | 163 | if (c->frequency < 542000000) |
163 | cp = 0xb4; | 164 | cp = 0xb4; |
164 | else if (params->frequency < 771000000) | 165 | else if (c->frequency < 771000000) |
165 | cp = 0xbc; | 166 | cp = 0xbc; |
166 | else | 167 | else |
167 | cp = 0xf4; | 168 | cp = 0xf4; |
168 | 169 | ||
169 | if (params->frequency == 0) | 170 | if (c->frequency == 0) |
170 | bs = 0x03; | 171 | bs = 0x03; |
171 | else if (params->frequency < 443250000) | 172 | else if (c->frequency < 443250000) |
172 | bs = 0x02; | 173 | bs = 0x02; |
173 | else | 174 | else |
174 | bs = 0x08; | 175 | bs = 0x08; |
@@ -342,50 +343,51 @@ static int advbt771_samsung_tdtc9251dh0_demod_init(struct dvb_frontend* fe) | |||
342 | return 0; | 343 | return 0; |
343 | } | 344 | } |
344 | 345 | ||
345 | static int advbt771_samsung_tdtc9251dh0_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len) | 346 | static int advbt771_samsung_tdtc9251dh0_tuner_calc_regs(struct dvb_frontend *fe, u8 *pllbuf, int buf_len) |
346 | { | 347 | { |
348 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
347 | u32 div; | 349 | u32 div; |
348 | unsigned char bs = 0; | 350 | unsigned char bs = 0; |
349 | unsigned char cp = 0; | 351 | unsigned char cp = 0; |
350 | 352 | ||
351 | if (buf_len < 5) return -EINVAL; | 353 | if (buf_len < 5) return -EINVAL; |
352 | 354 | ||
353 | div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; | 355 | div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; |
354 | 356 | ||
355 | if (params->frequency < 150000000) | 357 | if (c->frequency < 150000000) |
356 | cp = 0xB4; | 358 | cp = 0xB4; |
357 | else if (params->frequency < 173000000) | 359 | else if (c->frequency < 173000000) |
358 | cp = 0xBC; | 360 | cp = 0xBC; |
359 | else if (params->frequency < 250000000) | 361 | else if (c->frequency < 250000000) |
360 | cp = 0xB4; | 362 | cp = 0xB4; |
361 | else if (params->frequency < 400000000) | 363 | else if (c->frequency < 400000000) |
362 | cp = 0xBC; | 364 | cp = 0xBC; |
363 | else if (params->frequency < 420000000) | 365 | else if (c->frequency < 420000000) |
364 | cp = 0xF4; | 366 | cp = 0xF4; |
365 | else if (params->frequency < 470000000) | 367 | else if (c->frequency < 470000000) |
366 | cp = 0xFC; | 368 | cp = 0xFC; |
367 | else if (params->frequency < 600000000) | 369 | else if (c->frequency < 600000000) |
368 | cp = 0xBC; | 370 | cp = 0xBC; |
369 | else if (params->frequency < 730000000) | 371 | else if (c->frequency < 730000000) |
370 | cp = 0xF4; | 372 | cp = 0xF4; |
371 | else | 373 | else |
372 | cp = 0xFC; | 374 | cp = 0xFC; |
373 | 375 | ||
374 | if (params->frequency < 150000000) | 376 | if (c->frequency < 150000000) |
375 | bs = 0x01; | 377 | bs = 0x01; |
376 | else if (params->frequency < 173000000) | 378 | else if (c->frequency < 173000000) |
377 | bs = 0x01; | 379 | bs = 0x01; |
378 | else if (params->frequency < 250000000) | 380 | else if (c->frequency < 250000000) |
379 | bs = 0x02; | 381 | bs = 0x02; |
380 | else if (params->frequency < 400000000) | 382 | else if (c->frequency < 400000000) |
381 | bs = 0x02; | 383 | bs = 0x02; |
382 | else if (params->frequency < 420000000) | 384 | else if (c->frequency < 420000000) |
383 | bs = 0x02; | 385 | bs = 0x02; |
384 | else if (params->frequency < 470000000) | 386 | else if (c->frequency < 470000000) |
385 | bs = 0x02; | 387 | bs = 0x02; |
386 | else if (params->frequency < 600000000) | 388 | else if (c->frequency < 600000000) |
387 | bs = 0x08; | 389 | bs = 0x08; |
388 | else if (params->frequency < 730000000) | 390 | else if (c->frequency < 730000000) |
389 | bs = 0x08; | 391 | bs = 0x08; |
390 | else | 392 | else |
391 | bs = 0x08; | 393 | bs = 0x08; |
@@ -514,31 +516,31 @@ static int digitv_alps_tded4_demod_init(struct dvb_frontend* fe) | |||
514 | return 0; | 516 | return 0; |
515 | } | 517 | } |
516 | 518 | ||
517 | static int digitv_alps_tded4_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len) | 519 | static int digitv_alps_tded4_tuner_calc_regs(struct dvb_frontend *fe, u8 *pllbuf, int buf_len) |
518 | { | 520 | { |
519 | u32 div; | 521 | u32 div; |
520 | struct dvb_ofdm_parameters *op = ¶ms->u.ofdm; | 522 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
521 | 523 | ||
522 | if (buf_len < 5) | 524 | if (buf_len < 5) |
523 | return -EINVAL; | 525 | return -EINVAL; |
524 | 526 | ||
525 | div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; | 527 | div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; |
526 | 528 | ||
527 | pllbuf[0] = 0x61; | 529 | pllbuf[0] = 0x61; |
528 | pllbuf[1] = (div >> 8) & 0x7F; | 530 | pllbuf[1] = (div >> 8) & 0x7F; |
529 | pllbuf[2] = div & 0xFF; | 531 | pllbuf[2] = div & 0xFF; |
530 | pllbuf[3] = 0x85; | 532 | pllbuf[3] = 0x85; |
531 | 533 | ||
532 | dprintk("frequency %u, div %u\n", params->frequency, div); | 534 | dprintk("frequency %u, div %u\n", c->frequency, div); |
533 | 535 | ||
534 | if (params->frequency < 470000000) | 536 | if (c->frequency < 470000000) |
535 | pllbuf[4] = 0x02; | 537 | pllbuf[4] = 0x02; |
536 | else if (params->frequency > 823000000) | 538 | else if (c->frequency > 823000000) |
537 | pllbuf[4] = 0x88; | 539 | pllbuf[4] = 0x88; |
538 | else | 540 | else |
539 | pllbuf[4] = 0x08; | 541 | pllbuf[4] = 0x08; |
540 | 542 | ||
541 | if (op->bandwidth == 8) | 543 | if (c->bandwidth_hz == 8000000) |
542 | pllbuf[4] |= 0x04; | 544 | pllbuf[4] |= 0x04; |
543 | 545 | ||
544 | return 5; | 546 | return 5; |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h index 67bbfa728016..99ae7828f893 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb/dvb-core/dvb_frontend.h | |||
@@ -202,7 +202,7 @@ struct dvb_tuner_ops { | |||
202 | int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p); | 202 | int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p); |
203 | 203 | ||
204 | /** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */ | 204 | /** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */ |
205 | int (*calc_regs)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p, u8 *buf, int buf_len); | 205 | int (*calc_regs)(struct dvb_frontend *fe, u8 *buf, int buf_len); |
206 | 206 | ||
207 | /** This is to allow setting tuner-specific configs */ | 207 | /** This is to allow setting tuner-specific configs */ |
208 | int (*set_config)(struct dvb_frontend *fe, void *priv_cfg); | 208 | int (*set_config)(struct dvb_frontend *fe, void *priv_cfg); |
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index f7184111aa64..2856ab74e964 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -123,7 +123,7 @@ static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_f | |||
123 | struct dvb_usb_adapter *adap = fe->dvb->priv; | 123 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
124 | u8 b[5]; | 124 | u8 b[5]; |
125 | 125 | ||
126 | fe->ops.tuner_ops.calc_regs(fe, fep, b, sizeof(b)); | 126 | fe->ops.tuner_ops.calc_regs(fe, b, sizeof(b)); |
127 | if (fe->ops.i2c_gate_ctrl) | 127 | if (fe->ops.i2c_gate_ctrl) |
128 | fe->ops.i2c_gate_ctrl(fe, 1); | 128 | fe->ops.i2c_gate_ctrl(fe, 1); |
129 | return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); | 129 | return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index c19d6bbc68ce..f967cf9b4a60 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -647,9 +647,9 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, | |||
647 | } | 647 | } |
648 | 648 | ||
649 | static int dvb_pll_calc_regs(struct dvb_frontend *fe, | 649 | static int dvb_pll_calc_regs(struct dvb_frontend *fe, |
650 | struct dvb_frontend_parameters *params, | ||
651 | u8 *buf, int buf_len) | 650 | u8 *buf, int buf_len) |
652 | { | 651 | { |
652 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
653 | struct dvb_pll_priv *priv = fe->tuner_priv; | 653 | struct dvb_pll_priv *priv = fe->tuner_priv; |
654 | int result; | 654 | int result; |
655 | u32 frequency = 0; | 655 | u32 frequency = 0; |
@@ -657,7 +657,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, | |||
657 | if (buf_len < 5) | 657 | if (buf_len < 5) |
658 | return -EINVAL; | 658 | return -EINVAL; |
659 | 659 | ||
660 | result = dvb_pll_configure(fe, buf + 1, params->frequency); | 660 | result = dvb_pll_configure(fe, buf + 1, c->frequency); |
661 | if (result < 0) | 661 | if (result < 0) |
662 | return result; | 662 | return result; |
663 | else | 663 | else |
@@ -666,7 +666,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, | |||
666 | buf[0] = priv->pll_i2c_address; | 666 | buf[0] = priv->pll_i2c_address; |
667 | 667 | ||
668 | priv->frequency = frequency; | 668 | priv->frequency = frequency; |
669 | priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0; | 669 | priv->bandwidth = c->bandwidth_hz; |
670 | 670 | ||
671 | return 5; | 671 | return 5; |
672 | } | 672 | } |
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c index 319672f8e1a7..e2a86daba502 100644 --- a/drivers/media/dvb/frontends/mt352.c +++ b/drivers/media/dvb/frontends/mt352.c | |||
@@ -302,7 +302,7 @@ static int mt352_set_parameters(struct dvb_frontend* fe, | |||
302 | _mt352_write(fe, fsm_go, 2); | 302 | _mt352_write(fe, fsm_go, 2); |
303 | } else { | 303 | } else { |
304 | if (fe->ops.tuner_ops.calc_regs) { | 304 | if (fe->ops.tuner_ops.calc_regs) { |
305 | fe->ops.tuner_ops.calc_regs(fe, param, buf+8, 5); | 305 | fe->ops.tuner_ops.calc_regs(fe, buf+8, 5); |
306 | buf[8] <<= 1; | 306 | buf[8] <<= 1; |
307 | _mt352_write(fe, buf, sizeof(buf)); | 307 | _mt352_write(fe, buf, sizeof(buf)); |
308 | _mt352_write(fe, tuner_go, 2); | 308 | _mt352_write(fe, tuner_go, 2); |
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c index eac20650499f..ae5c3c32f407 100644 --- a/drivers/media/dvb/frontends/nxt200x.c +++ b/drivers/media/dvb/frontends/nxt200x.c | |||
@@ -566,7 +566,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe, | |||
566 | 566 | ||
567 | if (fe->ops.tuner_ops.calc_regs) { | 567 | if (fe->ops.tuner_ops.calc_regs) { |
568 | /* get tuning information */ | 568 | /* get tuning information */ |
569 | fe->ops.tuner_ops.calc_regs(fe, p, buf, 5); | 569 | fe->ops.tuner_ops.calc_regs(fe, buf, 5); |
570 | 570 | ||
571 | /* write frequency information */ | 571 | /* write frequency information */ |
572 | nxt200x_writetuner(state, buf); | 572 | nxt200x_writetuner(state, buf); |
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index adbbf6d3d044..9caccc03d588 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c | |||
@@ -367,7 +367,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe, | |||
367 | fe->ops.i2c_gate_ctrl(fe, 0); | 367 | fe->ops.i2c_gate_ctrl(fe, 0); |
368 | } | 368 | } |
369 | } else if (fe->ops.tuner_ops.calc_regs) { | 369 | } else if (fe->ops.tuner_ops.calc_regs) { |
370 | fe->ops.tuner_ops.calc_regs(fe, param, pllbuf + 1, 5); | 370 | fe->ops.tuner_ops.calc_regs(fe, pllbuf + 1, 5); |
371 | pllbuf[1] <<= 1; | 371 | pllbuf[1] <<= 1; |
372 | zl10353_write(fe, pllbuf, sizeof(pllbuf)); | 372 | zl10353_write(fe, pllbuf, sizeof(pllbuf)); |
373 | } | 373 | } |